Another u-boot build problem.

Thomas Skibo thomas-bsd at skibo.net
Mon Jan 27 22:12:51 UTC 2020


I was looking into creating a patch to submit to u-boot to fix a problem with building u-boot for Zynq boards on FreeBSD and I ran into another issue.  This probably affects other boards so I thought I’d give a heads up:

It appears the build fails while building device tree blobs:

DTC     arch/arm/dts/bitmain-antminer-s9.dtb
sed: 1: "arch/arm/dts/.bitmain-a ...": command a expects \ followed by text
gmake[2]: *** [scripts/Makefile.lib:308: arch/arm/dts/bitmain-antminer-s9.dtb] Error 1
gmake[2]: *** Deleting file 'arch/arm/dts/bitmain-antminer-s9.dtb'
gmake[1]: *** [dts/Makefile:38: arch-dtbs] Error 2
gmake: *** [Makefile:1087: dts/dt.dtb] Error 2
skibo at ashbury:~/u-boot-official % 

The problem is that sed on FreeBSD requires the “-e” option in front of the script but it’s optional with Linux sed.  This diff seems to fix it:

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index ef116e0e0a..79d8ae2a23 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -302,7 +302,7 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
              -i $(dir $<) $(DTC_FLAGS) \
              -d $(depfile).dtc.tmp $(dtc-tmp) ; \
      cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) ; \
-       sed -i "s:$(pre-tmp):$(<):" $(depfile)
+       sed -i -e "s:$(pre-tmp):$(<):" $(depfile)

$(obj)/%.dtb: $(src)/%.dts FORCE
      $(call if_changed_dep,dtc)



—Thomas Skibo




More information about the freebsd-uboot mailing list