[oe] [RFC] kernel NOTE messages fix

Frans Meulenbroeks fransmeulenbroeks at gmail.com
Tue Sep 28 16:39:42 UTC 2010


Dear all,

Earlier today Henning and I (tirggered by ynezz) had a discussion on
irc on the loooong list of kernel NOTE messages.
(things like: NOTE: /kernel/arch/arm/mach-at91/at91x40_time.c)
This was also discussed earlier with Eric Benard (also on irc).
I promised Henning that I should write a note (pun intended :-) ) to
the list, and here it is.

Basically the issue is that kernel.bbclass in kernel_do_install copies
a lot of files to ${D} so that eventually they end up in staging (this
copying is done in sysroot_stage_all_append ). These files are not
added to any package so insane.bbclass (or is it sane.bbclass
nowadays) barfs about these files.
The reason these files end up in staging is for building out-of-tree
kernel modules.

As it stands we see 3 solutions:

1) rm -rf the files in sysroot_stage_all_append after staging them
issue is that packaging can run in parallel, so in order to do this
these these two tasks need to be serialized

2) add them to kernel-dev. That way the NOTE disappears. However this
does increase the kernel-dev package size with 90 MB or so.
Technically it would allow building out-of-kernel modules on the
target. Then again currently this is not possible and I have never
heard complaints about it (actually for embedded systems it is often
not a good plan to build on the target, although with current high end
systems this becomes more feasible).

3) copy the files directly from the work area to staging. That way
there are no unpackaged files in image/ so no NOTE messages.
Additional advantage is that it is faster as we save the copy to the image dir.

The following patch makes (3) happen:

diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
index 5f8bc8a..05ddcc1 100644
--- a/classes/kernel.bbclass
+++ b/classes/kernel.bbclass
@@ -121,7 +121,12 @@ kernel_do_install() {
                 oe_runmake SUBDIRS="scripts/genksyms"
         fi

-       kerneldir=${D}/kernel/
+
+}
+
+sysroot_stage_all_append() {
+
+        kerneldir=${SYSROOT_DESTDIR}${STAGING_KERNEL_DIR}

        if [ -e include/asm ] ; then
                # This link is generated only in kernel before
2.6.33-rc1, don't stage it for newer kernels
@@ -197,12 +202,7 @@ kernel_do_install() {
        install -m 0644 System.map $kerneldir/System.map-${KERNEL_VERSION}
        [ -e Module.symvers ] && install -m 0644 Module.symvers $kerneldir/

-       cp -fR scripts $kerneldir/
-}
-
-sysroot_stage_all_append() {
-       sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}${STAGING_KERNEL_DIR}
-       cp -fpPR ${D}/kernel/.config ${SYSROOT_DESTDIR}${STAGING_KERNEL_DIR}
+       cp -fR scripts $kerneldir/
 }

 kernel_do_configure() {

I have tested this patch and for me it works fine and building the
kernel is greatly improved (mostly due to the NOTE messages that are
not generated, but also partly due to the copying step that is
avoided, so personally I am quite happy with this one.

But before committing this patch I'd like to discuss this on the list.
Your response is appreciated.

Frans.

PS: anyone an idea why these NOTE messages take so long time? I must
say I never timed it, but I heard people say 2 messages/sec, which
seems quite slow.




More information about the Openembedded-devel mailing list