]> code.ossystems Code Review - openembedded-core.git/commitdiff
kernel.bbclass: Fix empty modules directory QA issue
authorNathan Rossi <nathan.rossi@xilinx.com>
Tue, 14 Jan 2014 01:21:00 +0000 (11:21 +1000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 2 Feb 2014 11:21:53 +0000 (11:21 +0000)
If a kernel is built without any external modules (aka no CONFIG_*=m),
then during a modules_install of the kernel an empty directory is
created at /lib/modules/${KERNEL_VERIONS}/kernel. This is behaviour of
the kernel infrastructure, the directory would normally be populated
with the modules that were built.

However because of the expectations of kernel-modules-split, no packages
are created when there are no modules and an empty directory lingers.
This raises QA issues as warning or errors (depending on the distro).

The following patch changes the kernel_do_install task to check if the
directory is empty and if so removes it.

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/classes/kernel.bbclass

index f2a5ec5de76f554d06cf4d6a5818ae5d12c292a5..51626b03f824fa7a5dcd0113c7c1b3383af5980a 100644 (file)
@@ -188,6 +188,8 @@ kernel_do_install() {
                oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install
                rm "${D}/lib/modules/${KERNEL_VERSION}/build"
                rm "${D}/lib/modules/${KERNEL_VERSION}/source"
+               # If the kernel/ directory is empty remove it to prevent QA issues
+               rmdir --ignore-fail-on-non-empty "${D}/lib/modules/${KERNEL_VERSION}/kernel"
        else
                bbnote "no modules to install"
        fi