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

Bruce Ashfield bruce.ashfield at gmail.com
Fri Sep 21 12:38:02 UTC 2018


On Fri, Sep 21, 2018 at 7:49 AM, Mikko Rapeli <mikko.rapeli at bmw.de> wrote:
> 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
> }

This is what I've always done in the past (and in fact, there's an
open Yocto bug
to track this), but I haven't actually needed to do what you are
modifying in the
bbclass itself.

If you call the sysroot stage routines directly in that
install_append, are you really
not seeing the files appear in the recipe's sysroot ?

Have you confirmed that we get a warning/error from bitbake about
conflicting files
from multiple recipes if someone doesn't know to use a custom path for their
headers ? That has always been the main concern about allowing something like
this.

Cheers,

Bruce

>
> 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
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"



More information about the Openembedded-core mailing list