aboutsummaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorGravatar Yann E. MORIN <yann.morin.1998@free.fr>2017-12-09 12:35:49 +0100
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-12-14 06:37:13 +0100
commitc9b6604fa7871087120cd8a469452807d14a4c1c (patch)
tree1b3d8c0931ff783ff14bf0978ad2e4c773b0258c /boot
parent8636a3cbefdfd03a39cfe1ccda024b95fb0ba7f1 (diff)
downloadbuildroot-c9b6604fa7871087120cd8a469452807d14a4c1c.tar.gz
buildroot-c9b6604fa7871087120cd8a469452807d14a4c1c.tar.bz2
package/uboot: detect missing user-supplied environment source files
Since 0542bb79e8 (uboot: Support multiple environment source files), missing user-supplied environment source files is no longer detected. This is because we cat them all, and feed the concatenation to the stdin of mkenvimage. So, if one source file is missing, the cat exits in error, but the compound command exits with the exit code of the last command, which is that of mkenvimage, which happens to be happy with whatever it is fed on its stdin, even is empty. We fix that by creating a temporary file, that we even leave afterward for the user to inspect. We also move it out of the _CMDS block and into a macro of its own, so that it is easier to write and maintain. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Cam Hutchison <camh@xdna.net> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'boot')
-rw-r--r--boot/uboot/uboot.mk19
1 files changed, 13 insertions, 6 deletions
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 39175999ec..d2f241cd8b 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -243,6 +243,18 @@ define UBOOT_BUILD_OMAP_IFT
-c $(call qstrip,$(BR2_TARGET_UBOOT_OMAP_IFT_CONFIG))
endef
+ifneq ($(BR2_TARGET_UBOOT_ENVIMAGE),)
+define UBOOT_GENERATE_ENV_IMAGE
+ cat $(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE)) \
+ >$(@D)/buildroot-env.txt
+ $(HOST_DIR)/bin/mkenvimage -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \
+ $(if $(BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT),-r) \
+ $(if $(filter BIG,$(BR2_ENDIAN)),-b) \
+ -o $(BINARIES_DIR)/uboot-env.bin \
+ $(@D)/buildroot-env.txt
+endef
+endif
+
define UBOOT_INSTALL_IMAGES_CMDS
$(foreach f,$(UBOOT_BINS), \
cp -dpf $(@D)/$(f) $(BINARIES_DIR)/
@@ -254,12 +266,7 @@ define UBOOT_INSTALL_IMAGES_CMDS
cp -dpf $(@D)/$(f) $(BINARIES_DIR)/
)
)
- $(if $(BR2_TARGET_UBOOT_ENVIMAGE),
- cat $(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE)) | \
- $(HOST_DIR)/bin/mkenvimage -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \
- $(if $(BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT),-r) \
- $(if $(filter BIG,$(BR2_ENDIAN)),-b) \
- -o $(BINARIES_DIR)/uboot-env.bin -)
+ $(UBOOT_GENERATE_ENV_IMAGE)
$(if $(BR2_TARGET_UBOOT_BOOT_SCRIPT),
$(HOST_DIR)/bin/mkimage -C none -A $(MKIMAGE_ARCH) -T script \
-d $(call qstrip,$(BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE)) \