]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Makefile: fix broken pipe error for lcd4_lwmon5 board
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Wed, 18 Dec 2013 10:00:51 +0000 (19:00 +0900)
committerTom Rini <trini@ti.com>
Wed, 18 Dec 2013 15:23:37 +0000 (10:23 -0500)
Before this commit, a broken pipe error sometimes happened
when building lcd4_lwmon5 board with Buildman.

This commit re-writes build rules of
u-boot.spr and u-boot-img-spl-at-end.bin
more simply without using a pipe.

Besides fixing a broken pipe error,
this commit gives us other advantages:

  - Do not generate intermidiate files, spl/u-boot-spl.img
    and spl/u-boot-spl-pad.img for creating u-boot.spr

  - Do not generate an intermidiate file, u-boot-pad.img
    for creating u-boot-img-spl-at-end.bin

Such intermidiate files were not deleted by "make clean" or "make mrpropr".
Nor u-boot-pad.img was ignored by git.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Stefan Roese <sr@denx.de>
Makefile

index de36187fb0c5e540ed5f144585fe8ec68431ee0f..cbd45a7f178d75801661c586559ae2bb6ad6b774 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -471,12 +471,10 @@ $(obj)u-boot.sb:       $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin
 $(obj)u-boot.spr:      $(obj)u-boot.img $(obj)spl/u-boot-spl.bin
                $(obj)tools/mkimage -A $(ARCH) -T firmware -C none \
                -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n XLOADER \
-               -d $(obj)spl/u-boot-spl.bin $(obj)spl/u-boot-spl.img
-               tr "\000" "\377" < /dev/zero | dd ibs=1 count=$(CONFIG_SPL_PAD_TO) \
-                       of=$(obj)spl/u-boot-spl-pad.img 2>/dev/null
-               dd if=$(obj)spl/u-boot-spl.img of=$(obj)spl/u-boot-spl-pad.img \
-                       conv=notrunc 2>/dev/null
-               cat $(obj)spl/u-boot-spl-pad.img $(obj)u-boot.img > $@
+               -d $(obj)spl/u-boot-spl.bin $@
+               $(OBJCOPY) -I binary -O binary \
+                       --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff $@
+               cat $(obj)u-boot.img >> $@
 
 ifneq ($(CONFIG_TEGRA),)
 $(obj)u-boot-nodtb-tegra.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
@@ -499,11 +497,9 @@ $(obj)u-boot-img.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
 # at the start padded up to the start of the SPL image. And then concat
 # the SPL image to the end.
 $(obj)u-boot-img-spl-at-end.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
-               tr "\000" "\377" < /dev/zero | dd ibs=1 count=$(CONFIG_UBOOT_PAD_TO) \
-                       of=$(obj)u-boot-pad.img 2>/dev/null
-               dd if=$(obj)u-boot.img of=$(obj)u-boot-pad.img \
-                       conv=notrunc 2>/dev/null
-               cat $(obj)u-boot-pad.img $(obj)spl/u-boot-spl.bin > $@
+               $(OBJCOPY) -I binary -O binary --pad-to=$(CONFIG_UBOOT_PAD_TO) \
+                        --gap-fill=0xff $(obj)u-boot.img $@
+               cat $(obj)spl/u-boot-spl.bin >> $@
 
 ifeq ($(CONFIG_SANDBOX),y)
 GEN_UBOOT = \