[PATCH 2/2] build/DTC: fix sed usage in DTC command

Warner Losh imp at bsdimp.com
Sat Feb 13 17:43:51 CET 2021


On Sat, Feb 13, 2021 at 3:06 AM Roger Pau Monne <royger at freebsd.org> wrote:

> Current sed usage in the DTC command relies on GNU sed specific -i
> option which has a slightly different syntax for BSD sed and always
> expects an extension to be provided in order to create a backup file.
>
> Instead drop the cat concatenation done before the sed call and use
> sed itself to edit and concatenate the files.
>
> No functional change intended.
>
> Signed-off-by: Roger Pau Monné <royger at FreeBSD.org>
>

Reviewed by: Warner Losh <imp at FreeBSD.org>


> ---
> Cc: Masahiro Yamada <masahiroy at kernel.org>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Michal Simek <michal.simek at xilinx.com>
> Cc: Wolfgang Wallner <wolfgang.wallner at br-automation.com>
> Cc: Jan Kiszka <jan.kiszka at siemens.com>
> ---
>  scripts/Makefile.lib | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 56e9d54242..78543c6dd1 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -326,8 +326,7 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
>                 -d $(depfile).dtc.tmp $(dtc-tmp) || \
>                 (echo "Check $(shell pwd)/$(pre-tmp) for errors" && false)
> \
>                 ; \
> -       cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) ; \
> -       sed -i "s:$(pre-tmp):$(<):" $(depfile)
> +       sed "s:$(pre-tmp):$(<):" $(depfile).pre.tmp $(depfile).dtc.tmp >
> $(depfile)
>
>  $(obj)/%.dtb: $(src)/%.dts FORCE
>         $(call if_changed_dep,dtc)
> --
> 2.30.1
>
> _______________________________________________
> freebsd-uboot at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-uboot
> To unsubscribe, send any mail to "freebsd-uboot-unsubscribe at freebsd.org"
>


More information about the U-Boot mailing list