Add the output of depmod into kernel module .tgz file

Submitted by Mark Hatle on Nov. 19, 2014, 2:41 a.m. | Patch ID: 83509


Message ID
State New
Headers show

Commit Message

Mark Hatle Nov. 19, 2014, 2:41 a.m.
From: Yue Tao <>

[ Sent for Yocto Project compliance, not believed to be generally applicable ]

do_rootfs() runs depmod on the final rootfs, so the depmod files are
in the rootfs image. But the kernel module .tgz doesn't have the files.
If you un-tar the new version of the kernel module .tgz on the board,
it will need to re-run depmod. The avoid this we are running depmod in
kernel_do_deploy() before generating the kernel .tgz.

Signed-off-by: Yue Tao <>
Signed-off-by: Mark Hatle <>
 meta/classes/kernel.bbclass | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index e0c3a2e..f0e2a28 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -489,9 +489,15 @@  addtask uboot_mkimage before do_install after do_compile
 kernel_do_deploy() {
 	if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
+		# Generate modules.* files in order to adding the modules.* into kernel module tar ball
+		# after making the tar ball, remove the modules.* files to avoid unnecessary QA warnings.
 		mkdir -p ${D}/lib
-		tar -cvzf ${DEPLOYDIR}/${MODULE_TARBALL_BASE_NAME} -C ${D} lib
+		cp -r ${D}/lib ${DEPLOYDIR}
+		(cd ${D}; cp --parent boot/${KERNEL_VERSION} ${DEPLOYDIR})
+		depmodwrapper -a -b ${DEPLOYDIR} ${KERNEL_VERSION}
+		rm -rf ${DEPLOYDIR}/lib ${DEPLOYDIR}/boot