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

Details

Message ID 1416364862-213839-1-git-send-email-mark.hatle@windriver.com
State New
Headers show

Commit Message

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


[ 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 <Yue.Tao@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 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() {
 	install -m 0644 ${KERNEL_OUTPUT} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
 	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/System.map-${KERNEL_VERSION} ${DEPLOYDIR})
+		depmodwrapper -a -b ${DEPLOYDIR} ${KERNEL_VERSION}
+		tar -cvzf ${DEPLOYDIR}/${MODULE_TARBALL_BASE_NAME} -C ${DEPLOYDIR} lib boot/System.map-${KERNEL_VERSION}
 		ln -sf ${MODULE_TARBALL_BASE_NAME} ${DEPLOYDIR}/${MODULE_TARBALL_SYMLINK_NAME}
+		rm -rf ${DEPLOYDIR}/lib ${DEPLOYDIR}/boot
 	fi
 
 	ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${DEPLOYDIR}/${KERNEL_IMAGE_SYMLINK_NAME}.bin