[oe-commits] Nathan Rossi : kernel.bbclass: Fix empty modules directory QA issue

git at git.openembedded.org git at git.openembedded.org
Sun Feb 2 11:17:28 UTC 2014


Module: openembedded-core.git
Branch: master
Commit: 63d3070b7e1207164891b154a5b9017731e75872
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=63d3070b7e1207164891b154a5b9017731e75872

Author: Nathan Rossi <nathan.rossi at xilinx.com>
Date:   Tue Jan 14 11:21:00 2014 +1000

kernel.bbclass: Fix empty modules directory QA issue

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 at xilinx.com>
Signed-off-by: Saul Wold <sgw at linux.intel.com>

---

 meta/classes/kernel.bbclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index f2a5ec5..51626b0 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -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



More information about the Openembedded-commits mailing list