Commit 57270260adc6076facd284107be463f9beebb153

Authored by Masahiro Yamada
Committed by Tom Rini
1 parent ace8f50642

Makefile: fix broken pipe error for lcd4_lwmon5 board

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>

Showing 1 changed file with 7 additions and 11 deletions Side-by-side Diff

... ... @@ -471,12 +471,10 @@
471 471 $(obj)u-boot.spr: $(obj)u-boot.img $(obj)spl/u-boot-spl.bin
472 472 $(obj)tools/mkimage -A $(ARCH) -T firmware -C none \
473 473 -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n XLOADER \
474   - -d $(obj)spl/u-boot-spl.bin $(obj)spl/u-boot-spl.img
475   - tr "\000" "\377" < /dev/zero | dd ibs=1 count=$(CONFIG_SPL_PAD_TO) \
476   - of=$(obj)spl/u-boot-spl-pad.img 2>/dev/null
477   - dd if=$(obj)spl/u-boot-spl.img of=$(obj)spl/u-boot-spl-pad.img \
478   - conv=notrunc 2>/dev/null
479   - cat $(obj)spl/u-boot-spl-pad.img $(obj)u-boot.img > $@
  474 + -d $(obj)spl/u-boot-spl.bin $@
  475 + $(OBJCOPY) -I binary -O binary \
  476 + --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff $@
  477 + cat $(obj)u-boot.img >> $@
480 478  
481 479 ifneq ($(CONFIG_TEGRA),)
482 480 $(obj)u-boot-nodtb-tegra.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
... ... @@ -499,11 +497,9 @@
499 497 # at the start padded up to the start of the SPL image. And then concat
500 498 # the SPL image to the end.
501 499 $(obj)u-boot-img-spl-at-end.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
502   - tr "\000" "\377" < /dev/zero | dd ibs=1 count=$(CONFIG_UBOOT_PAD_TO) \
503   - of=$(obj)u-boot-pad.img 2>/dev/null
504   - dd if=$(obj)u-boot.img of=$(obj)u-boot-pad.img \
505   - conv=notrunc 2>/dev/null
506   - cat $(obj)u-boot-pad.img $(obj)spl/u-boot-spl.bin > $@
  500 + $(OBJCOPY) -I binary -O binary --pad-to=$(CONFIG_UBOOT_PAD_TO) \
  501 + --gap-fill=0xff $(obj)u-boot.img $@
  502 + cat $(obj)spl/u-boot-spl.bin >> $@
507 503  
508 504 ifeq ($(CONFIG_SANDBOX),y)
509 505 GEN_UBOOT = \