]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
uboot: Support multiple environment source files
authorCam Hutchison <camh@xdna.net>
Sun, 31 Jan 2016 00:48:33 +0000 (11:48 +1100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 31 May 2016 20:59:35 +0000 (22:59 +0200)
Allow multiple file names to be listed in
BR2_TARGET_UBOOT_ENVIMAGE_SOURCE, concatenating them in the order
listed.

This allows the bulk of the environment to be shared across multiple
boards using a common environment file with board-specific values
supplied in a secondary environment source file.

Signed-off-by: Cam Hutchison <camh@xdna.net>
[Thomas: adjust indentation in the .mk file.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
boot/uboot/Config.in
boot/uboot/uboot.mk

index 21f9abda55eef53d14b3d5c09d0da9119b9e98d3..9ffbb5145c0f7c3f62f2e15f9f40e7bc2d984085 100644 (file)
@@ -348,9 +348,13 @@ menuconfig BR2_TARGET_UBOOT_ENVIMAGE
 if BR2_TARGET_UBOOT_ENVIMAGE
 
 config BR2_TARGET_UBOOT_ENVIMAGE_SOURCE
-       string "Source file for environment"
+       string "Source files for environment"
        help
-         Text file describing the environment.
+         Text files describing the environment. Files should have
+         lines of the form var=value, one per line. Blank lines and
+         lines starting with a # are ignored.
+
+         Multiple source files are concatenated in the order listed.
 
 config BR2_TARGET_UBOOT_ENVIMAGE_SIZE
        string "Size of environment"
index e071303f7cf27773461dd2c945dd3a82c0606c45..3b2a23040797c8e59a0a615c461d69942a61aa25 100644 (file)
@@ -165,9 +165,10 @@ define UBOOT_INSTALL_IMAGES_CMDS
        $(if $(BR2_TARGET_UBOOT_SPL),
                cp -dpf $(@D)/$(call qstrip,$(BR2_TARGET_UBOOT_SPL_NAME)) $(BINARIES_DIR)/)
        $(if $(BR2_TARGET_UBOOT_ENVIMAGE),
-               $(HOST_DIR)/usr/bin/mkenvimage -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \
-               $(if $(BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT),-r) \
-               -o $(BINARIES_DIR)/uboot-env.bin $(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE))
+               cat $(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE)) | \
+                       $(HOST_DIR)/usr/bin/mkenvimage -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \
+                       $(if $(BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT),-r) \
+                       -o $(BINARIES_DIR)/uboot-env.bin -)
 endef
 
 define UBOOT_INSTALL_OMAP_IFT_IMAGE