Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] kernel.bbclass: allow exporting files from kernel recipes to sysroot
@ 2018-09-21 11:49 Mikko Rapeli
  2018-09-21 12:38 ` Bruce Ashfield
  2018-09-24  7:25 ` Mikko.Rapeli
  0 siblings, 2 replies; 18+ messages in thread
From: Mikko Rapeli @ 2018-09-21 11:49 UTC (permalink / raw)
  To: openembedded-core

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@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



^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2018-09-24 14:34 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-21 11:49 [PATCH] kernel.bbclass: allow exporting files from kernel recipes to sysroot Mikko Rapeli
2018-09-21 12:38 ` Bruce Ashfield
2018-09-24  7:25 ` Mikko.Rapeli
2018-09-24 12:12   ` Bruce Ashfield
2018-09-24 12:19     ` Mikko.Rapeli
2018-09-24 13:11       ` Richard Purdie
2018-09-24 13:20         ` Mikko.Rapeli
2018-09-24 13:38           ` richard.purdie
2018-09-24 13:42             ` Mikko.Rapeli
2018-09-24 13:44               ` richard.purdie
2018-09-24 13:46                 ` Bruce Ashfield
2018-09-24 13:48                   ` Bruce Ashfield
2018-09-24 13:55                     ` Mikko.Rapeli
2018-09-24 14:16                       ` richard.purdie
2018-09-24 13:43             ` Bruce Ashfield
2018-09-24 13:56               ` richard.purdie
2018-09-24 14:19                 ` Mikko.Rapeli
2018-09-24 14:34                   ` richard.purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox