Skip to contentSkip to conversation

Add the output of depmod into kernel module .tgz file

PATCH New Mark Hatle 1 participant 1 message Nov 19, 2014

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

PATCH 1/1 Add the output of depmod into kernel module .tgz file

From: Yue Tao <[email protected]>

[ 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.

---
 meta/classes/kernel.bbclass | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
meta/classes/kernel.bbclass +7 -1
index e0c3a2e..f0e2a28 100644
@@ -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
Signature · 1 line
1.9.3