barebox: support multiple image files
authorMarcin Niestroj <m.niestroj@grinn-global.com>
Wed, 21 Jun 2017 07:03:53 +0000 (09:03 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 21 Jun 2017 19:40:33 +0000 (21:40 +0200)
Add support for specifying multiple image files in
BR2_TARGET_BAREBOX_IMAGE_FILE config option.

This is useful for boards with several RAM size variants.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
[Thomas: rename internal variable from $(1)_IMAGE_FILE to
$(1)_IMAGE_FILES.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
boot/barebox/barebox-aux/Config.in
boot/barebox/barebox.mk
boot/barebox/barebox/Config.in

index ec3b97cb8ac87e9c21619d39b2b044f7ad2759b7..d39d24f763e0203e1ff79b261dacc655db6a5176 100644 (file)
@@ -30,9 +30,9 @@ config BR2_TARGET_BAREBOX_AUX_CONFIG_FRAGMENT_FILES
          that will be merged to the main Barebox configuration file.
 
 config BR2_TARGET_BAREBOX_AUX_IMAGE_FILE
-       string "Image filename"
+       string "Image file names"
        help
-         Name of the generated barebox image, which will be copied to
+         Space-separated list of barebox images which will be copied to
          the images directory.
 
          If left empty, defaults to:
index 1690e8fa59781ddf205311918e00db75304ca13f..b811e322b503b6000508f2fbf30ff51388dc49cf 100644 (file)
@@ -109,11 +109,11 @@ define $(1)_BUILD_CMDS
        $$($(1)_BUILD_CUSTOM_ENV)
 endef
 
-$(1)_IMAGE_FILE = $$(call qstrip,$$(BR2_TARGET_$(1)_IMAGE_FILE))
+$(1)_IMAGE_FILES = $$(call qstrip,$$(BR2_TARGET_$(1)_IMAGE_FILE))
 
 define $(1)_INSTALL_IMAGES_CMDS
-       if test -n "$$($(1)_IMAGE_FILE)"; then \
-               cp -L $$(@D)/$$($(1)_IMAGE_FILE) $$(BINARIES_DIR) ; \
+       if test -n "$$($(1)_IMAGE_FILES)"; then \
+               cp -L $$(foreach image,$$($(1)_IMAGE_FILES),$$(@D)/$$(image)) $$(BINARIES_DIR) ; \
        elif test -h $$(@D)/barebox-flash-image ; then \
                cp -L $$(@D)/barebox-flash-image $$(BINARIES_DIR)/barebox.bin ; \
        else \
index 3d8d014561ef6c99e9a2560f8f7a1d5cf8129f28..0be26adf93f71b25af7f6fa6aca75c91204d71aa 100644 (file)
@@ -31,9 +31,9 @@ config BR2_TARGET_BAREBOX_CONFIG_FRAGMENT_FILES
          that will be merged to the main Barebox configuration file.
 
 config BR2_TARGET_BAREBOX_IMAGE_FILE
-       string "Image filename"
+       string "Image file names"
        help
-         Name of the generated barebox image, which will be copied to
+         Space-separated list of barebox images which will be copied to
          the images directory.
 
          If left empty, defaults to: