fs/ubi: expose BINARIES_DIR to ubinize.cfg
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Sat, 6 Jun 2020 10:50:15 +0000 (12:50 +0200)
committerYann E. MORIN <yann.morin.1998@free.fr>
Sat, 6 Jun 2020 11:43:43 +0000 (13:43 +0200)
It is often necessary to refer to other images that are present in
BINARIES_DIR from a custom ubinize configuration e.g. to include the
kernel in a UBI volume.

As we do for BR2_ROOTFS_UBIFS_PATH, replace BINARIES_DIR when copying
the file.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
[yann.morin.1998@free.fr:
  - add the blurb in the help text
  - rewrap commit log
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
fs/ubi/Config.in
fs/ubi/ubi.mk

index 85b1c56bb0bc80a868309d5fea1b18a32e329461..3427ea0518795b3da5c1ebc3693c5ac91aced7f3 100644 (file)
@@ -38,6 +38,11 @@ config BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG
          So the volume defined for the root filesystem can specify the
          image path as:  image=BR2_ROOTFS_UBIFS_PATH
 
+         Buildroot also replaces the string "BINARIES_DIR" with the
+         value of $(BINARIES_DIR), so that it is possible to reference
+         other build artefacts (e.g. to include the kernel in a UBI
+         volume).
+
 config BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE
        string "Configuration file path"
        depends on BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG
index d848f8b23a655ca8550fff90d4a7b4aab9eadc76..54bb81ea08a4252978506c9c921995c03a40e9e8 100644 (file)
@@ -23,7 +23,7 @@ endif
 # don't use sed -i as it misbehaves on systems with SELinux enabled when this is
 # executed through fakeroot (see #9386)
 define ROOTFS_UBI_CMD
-       sed 's;BR2_ROOTFS_UBIFS_PATH;$@fs;' \
+       sed 's;BR2_ROOTFS_UBIFS_PATH;$@fs;;s;BINARIES_DIR;$(BINARIES_DIR);' \
                $(UBI_UBINIZE_CONFIG_FILE_PATH) > $(BUILD_DIR)/ubinize.cfg
        $(HOST_DIR)/sbin/ubinize -o $@ $(UBI_UBINIZE_OPTS) $(BUILD_DIR)/ubinize.cfg
        rm $(BUILD_DIR)/ubinize.cfg