Commit 5cb141ab authored by Yann E. MORIN's avatar Yann E. MORIN Committed by Peter Korsgaard
Browse files

package/uboot: detect missing user-supplied environment source files

Since 0542bb79

 (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: default avatar"Yann E. MORIN" <>
Cc: Cam Hutchison <>
Cc: Thomas Petazzoni <>
Signed-off-by: default avatarThomas Petazzoni <>
(cherry picked from commit c9b6604fa7871087120cd8a469452807d14a4c1c)
Signed-off-by: default avatarPeter Korsgaard <>
parent e9c97ab4
......@@ -238,6 +238,18 @@ define UBOOT_BUILD_OMAP_IFT
-c $(call qstrip,$(BR2_TARGET_UBOOT_OMAP_IFT_CONFIG))
cat $(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE)) \
$(HOST_DIR)/bin/mkenvimage -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \
$(if $(filter BIG,$(BR2_ENDIAN)),-b) \
-o $(BINARIES_DIR)/uboot-env.bin \
$(foreach f,$(UBOOT_BINS), \
cp -dpf $(@D)/$(f) $(BINARIES_DIR)/
......@@ -249,12 +261,7 @@ define UBOOT_INSTALL_IMAGES_CMDS
cp -dpf $(@D)/$(f) $(BINARIES_DIR)/
cat $(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE)) | \
$(HOST_DIR)/bin/mkenvimage -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \
$(if $(filter BIG,$(BR2_ENDIAN)),-b) \
-o $(BINARIES_DIR)/uboot-env.bin -)
$(HOST_DIR)/bin/mkimage -C none -A $(MKIMAGE_ARCH) -T script \
-d $(call qstrip,$(BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE)) \
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment