diff mbox series

[RFC,1/4] bootconfig: add recipe

Message ID 20260319-bootconfig-v1-1-a4d467c3f0ba@valla.it
State New
Headers show
Series Add support for bootconfig on initramfs and FIT images | expand

Commit Message

Francesco Valla March 18, 2026, 11:30 p.m. UTC
Add a new recipe for the bootconfig tool, with source coming directly
from the kernel shared workdir.

Signed-off-by: Francesco Valla <francesco@valla.it>
---
 meta/recipes-kernel/bootconfig/bootconfig.bb | 44 ++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-kernel/bootconfig/bootconfig.bb b/meta/recipes-kernel/bootconfig/bootconfig.bb
new file mode 100644
index 0000000000000000000000000000000000000000..77ee70dd1839ef90a292cf829f4f3a4353f85c28
--- /dev/null
+++ b/meta/recipes-kernel/bootconfig/bootconfig.bb
@@ -0,0 +1,44 @@ 
+SUMMARY = "Apply, delete or show boot config"
+DESCRIPTION = "bootconfig is a tool that can be used to add a boot config block \
+at the end of a kernel initramfs, as well as remove it or show its content."
+LICENSE = "GPL-2.0-only"
+
+inherit kernelsrc kernel-arch
+
+do_populate_lic[depends] += "virtual/kernel:do_shared_workdir"
+do_configure[depends] += "virtual/kernel:do_shared_workdir"
+
+EXTRA_OEMAKE = "\
+    -C ${S}/tools/bootconfig \
+    O=${B} \
+    CROSS=${TARGET_PREFIX} \
+    CC="${CC} ${DEBUG_PREFIX_MAP} -ffile-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH} ${CFLAGS}" \
+    HOSTCC="${BUILD_CC} ${BUILD_CFLAGS}" \
+    LD="${LD}" \
+    AR=${AR} \
+    ARCH=${ARCH} \
+    V=1 \
+    'DESTDIR=${D}' \
+    'prefix=${prefix}' \
+    'bindir=${bindir}' \
+"
+
+do_compile() {
+	oe_runmake ${B}/bootconfig
+}
+
+do_install() {
+	install -d ${D}${bindir}
+	oe_runmake install
+}
+
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+python do_package:prepend() {
+    d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0])
+}
+
+B = "${WORKDIR}/${BPN}-${PV}"
+
+BBCLASSEXTEND = "native nativesdk"