[OE-core] [meta-oe][PATCH] bootconfig: Add recipe for bootconfig kernel tool

Adriana Kobylak anoo at linux.ibm.com
Mon Mar 16 18:09:10 UTC 2020


From: Adriana Kobylak <anoo at us.ibm.com>

The Boot Configuration kernel feature provides a tool named
bootconfig to add a config file to an initramfs. Reference:
https://github.com/torvalds/linux/blob/master/Documentation/admin-guide/bootconfig.rst

Add a recipe to meta-oe/recipes-kernel/ where other kernel
tools reside to build it. Add a native option so that this
tool can be used during the build process to add the config
file to the initramfs which can then be used on a system.

Signed-off-by: Adriana Kobylak <anoo at us.ibm.com>
---
 .../recipes-kernel/bootconfig/bootconfig_git.bb    | 50 ++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 meta-oe/recipes-kernel/bootconfig/bootconfig_git.bb

diff --git a/meta-oe/recipes-kernel/bootconfig/bootconfig_git.bb b/meta-oe/recipes-kernel/bootconfig/bootconfig_git.bb
new file mode 100644
index 0000000..8b8945e
--- /dev/null
+++ b/meta-oe/recipes-kernel/bootconfig/bootconfig_git.bb
@@ -0,0 +1,50 @@
+SUMMARY = "Boot configuration kernel tool"
+DESCRIPTION = "Adds a boot configuration file to the initrd that expands the \
+kernel command line."
+LICENSE = "GPLv2"
+
+inherit kernelsrc kernel-arch
+
+do_configure[depends] += "virtual/kernel:do_shared_workdir"
+
+EXTRA_OEMAKE_class-target = '\
+    -C ${S}/tools/bootconfig \
+    AR="${AR}" \
+    ARCH=${ARCH} \
+    CC="${CC} ${CFLAGS} ${LDFLAGS}" \
+    CROSS=${TARGET_PREFIX} \
+    DESTDIR="${D}" \
+    LD="${LD}" \
+    O=${B} \
+'
+
+EXTRA_OEMAKE_class-native = '\
+    -C ${S}/tools/bootconfig \
+    AR="${AR}" \
+    ARCH=${ARCH} \
+    CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" \
+    DESTDIR="${D}" \
+    LD="${LD}" \
+    O=${B} \
+'
+
+EXTRA_OEMAKE_class-nativesdk = '\
+    -C ${S}/tools/bootconfig \
+    AR="${AR}" \
+    ARCH=${ARCH} \
+    CC="${CC} ${CFLAGS} ${LDFLAGS}" \
+    CROSS_COMPILE=${HOST_PREFIX} \
+    DESTDIR="${D}" \
+    LD="${LD}" \
+    O=${B} \
+'
+
+do_compile() {
+    oe_runmake
+}
+
+do_install() {
+    oe_runmake install
+}
+
+BBCLASSEXTEND = "native nativesdk"
-- 
1.8.3.1



More information about the Openembedded-core mailing list