[OE-core] [PATCH] kernel.bbclass: allow exporting files from kernel recipes to sysroot

Mikko Rapeli mikko.rapeli at bmw.de
Fri Sep 21 11:49:27 UTC 2018


This change enables kernel recipes to share files with other
recipes. Firmware, modules and kernel-depmod are still not shared
since according to git history they cause problems with multiarch,
but all others are allowed. Examples of shared files are
kernel version and recipe specific headers and scripts which
are not needed by common linux-libc-headers to bootstrap glibc.

For example, if a kernel recipe wants to share headers, it can do:

PACKAGES =+ "${PN}-headers"

do_install_append() {
    install -d "${D}${includedir}/${PN}"
    oe_runmake INSTALL_HDR_PATH="${D}${includedir}/${PN}" headers_install
}

FILES_${PN}-headers = "\
                      ${includedir}/${PN}/* \
                      "

Users can find the headers from ${includedir}/${PN} and they don't conflict
with the generic linux-libc-headers which are used to boostrap userspace.

Signed-off-by: Mikko Rapeli <mikko.rapeli at bmw.de>
---
 meta/classes/kernel.bbclass | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index bfb4243..acf9c2c 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -487,10 +487,14 @@ do_shared_workdir () {
 	fi
 }
 
-# We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware
-sysroot_stage_all () {
-	:
-}
+# We don't need to stage modules/firmware since those would clash with linux-firmware, but
+# kernel recipes can still expose kernel version specific headers or scripts to userspace
+# sysroot.
+SYSROOT_DIRS_BLACKLIST_append += "\
+    ${datadir}/kernel-depmod \
+    ${base_libdir}/modules \
+    ${base_libdir}/firmware \
+"
 
 KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} CC="${KERNEL_CC}" O=${B} oldnoconfig"
 
-- 
1.9.1




More information about the Openembedded-core mailing list