diff mbox series

barebox: install generated dtbs

Message ID 20260924-barebox-dts-v1-1-9a07c07458e0@pengutronix.de
State New
Headers show
Series barebox: install generated dtbs | expand

Commit Message

Fabian Pfitzner Sept. 24, 2026, 6:09 a.m. UTC
Sometimes it's useful to be able to include the barebox-
generated dtb. An example would be generating a FIP image
for use by TF-A on the stm32mp1:

There, the barebox binary and its device tree need to be provided
separately to the fiptool command.

Add a variable called `BAREBOX_INSTALL_DTB` to control,
whether the dtb files should be installed into the sysroot.

Signed-off-by: Fabian Pfitzner <f.pfitzner@pengutronix.de>
---
 meta/classes-recipe/barebox.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)


---
base-commit: c264544ea440477db8ab84ca26fd9a7ab2c7da90
change-id: 20260909-barebox-dts-c8d00b35b0fc

Best regards,
diff mbox series

Patch

diff --git a/meta/classes-recipe/barebox.bbclass b/meta/classes-recipe/barebox.bbclass
index d8f568594849aa0d17d792a73fabda249617e287..3980849b531028c944fdaec76e6656a38210ec7c 100644
--- a/meta/classes-recipe/barebox.bbclass
+++ b/meta/classes-recipe/barebox.bbclass
@@ -48,6 +48,9 @@  BAREBOX_BUILDSYSTEM_VERSION ??= "${@get_layer_rev(os.path.dirname(d.getVar('FILE
 BAREBOX_FIRMWARE_DIR[doc] = "Overwrite barebox' firmware blobs search directory (CONFIG_EXTRA_FIRMWARE_DIR) with this path, default ${B}/firmware"
 BAREBOX_FIRMWARE_DIR ??= "${B}/firmware"
 
+BAREBOX_INSTALL_DTB[doc] = "Install dtb files from barebox into sysroot. By default, this variable is set to '0'."
+BAREBOX_INSTALL_DTB ??= "0"
+
 EXTRA_OEMAKE = " \
     ARCH=${@oe.kernel.map_kernel_arch(d)} CROSS_COMPILE=${TARGET_PREFIX} -C ${S} O=${B} \
     BUILDSYSTEM_VERSION=${BAREBOX_BUILDSYSTEM_VERSION} \
@@ -138,6 +141,10 @@  barebox_do_install () {
                         install -m 644 ${B}/${image} ${D}${BAREBOX_INSTALL_PATH}/
                 done
         fi
+
+        if [ "${BAREBOX_INSTALL_DTB}" = "1" ]; then
+                make dtbs_install INSTALL_DTBS_PATH=${D}/sysroot-only/
+        fi
 }
 FILES:${PN} = "${BAREBOX_INSTALL_PATH}"