[oe-commits] Martin Jansa : kernel.bbclass: deploy both stripped and non-stripped modules in tgz

git version control git at git.openembedded.org
Sun Nov 22 16:35:49 UTC 2009


Module: openembedded.git
Branch: shr/merge
Commit: f3de2a1a3f2f518570d7c69f4961a1e26cff3b2a
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=f3de2a1a3f2f518570d7c69f4961a1e26cff3b2a

Author: Martin Jansa <Martin.Jansa at gmail.com>
Date:   Sun Nov 22 03:21:58 2009 +0100

kernel.bbclass: deploy both stripped and non-stripped modules in tgz

* Change name of old modules*.tgz file to modules*-dbg.tgz
* Run do_strip_modules in PKGDEST for every package and then in PKGD,
  from where .tgz will be created, just because I haven't found where
  do_strip_modules can be hooked, to be run only in PKGD before files
  are copied to PKGDEST, or are they moved directly from source?
* After do_strip_modules create modules*.tgz with stripped modules

Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>

---

 classes/kernel.bbclass       |    2 +-
 classes/module_strip.bbclass |   26 ++++++++++++++++++++++++--
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
index 637805e..335957d 100644
--- a/classes/kernel.bbclass
+++ b/classes/kernel.bbclass
@@ -528,7 +528,7 @@ do_deploy() {
 	package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin
 
 	if [ -d "${D}/lib" ]; then
-		fakeroot tar -cvzf ${DEPLOY_DIR_IMAGE}/${MODULES_IMAGE_BASE_NAME}.tgz -C ${D} lib
+		fakeroot tar -cvzf ${DEPLOY_DIR_IMAGE}/${MODULES_IMAGE_BASE_NAME}-dbg.tgz -C ${D} lib
 	fi
 
 	cd ${DEPLOY_DIR_IMAGE}
diff --git a/classes/module_strip.bbclass b/classes/module_strip.bbclass
index 3316e20..caf4c40 100644
--- a/classes/module_strip.bbclass
+++ b/classes/module_strip.bbclass
@@ -13,14 +13,36 @@ do_strip_modules () {
 					if ! [ -d "$module"  ] ; then
 						${STRIP} -v -g $module
 					fi
-				done	
-#				NM="${CROSS_DIR}/bin/${HOST_PREFIX}nm" OBJCOPY="${CROSS_DIR}/bin/${HOST_PREFIX}objcopy" strip_module $modules
+				done
+#			      NM="${CROSS_DIR}/bin/${HOST_PREFIX}nm" OBJCOPY="${CROSS_DIR}/bin/${HOST_PREFIX}objcopy" strip_module $modules
 			fi
 		fi
 	done
+	if test -e ${PKGD}/lib/modules; then
+		if [ "${KERNEL_MAJOR_VERSION}" == "2.6" ]; then
+			modules="`find ${PKGD}/lib/modules -name \*.ko`"
+		else
+			modules="`find ${PKGD}/lib/modules -name \*.o`"
+		fi
+		if [ -n "$modules" ]; then
+			for module in $modules ; do
+				if ! [ -d "$module"  ] ; then
+					${STRIP} -v -g $module
+				fi
+			done	
+#			NM="${CROSS_DIR}/bin/${HOST_PREFIX}nm" OBJCOPY="${CROSS_DIR}/bin/${HOST_PREFIX}objcopy" strip_module $modules
+		fi
+	fi
+}
+
+do_deploy_stripped_modules () {
+	if [ -d "${PKGD}/lib" ]; then
+		fakeroot tar -cvzf ${DEPLOY_DIR_IMAGE}/${MODULES_IMAGE_BASE_NAME}.tgz -C ${PKGD} lib
+	fi
 }
 
 python do_package_append () {
 	if (bb.data.getVar('INHIBIT_PACKAGE_STRIP', d, 1) != '1'):
 		bb.build.exec_func('do_strip_modules', d)
+		bb.build.exec_func('do_deploy_stripped_modules', d)
 }





More information about the Openembedded-commits mailing list