From 18a377dcf50c5c10ebc73a36963a6e83d1bbad5d Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 23 Nov 2009 01:20:04 +0000 Subject: package.bbclass/module-strip.bbclass: Various strip fixes * Turn striping functionality into functions and call in the appropriate place * Removing various races and ordering issues * Should mean kernel modules are correctly stripped (and stripping can be disabled) * Addresses bug 1182 * kernel module stripping applied to ${PKGD} (the correct place) Signed-off-by: Richard Purdie --- classes/module_strip.bbclass | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'classes/module_strip.bbclass') diff --git a/classes/module_strip.bbclass b/classes/module_strip.bbclass index 17409190ed..ce36e213ff 100644 --- a/classes/module_strip.bbclass +++ b/classes/module_strip.bbclass @@ -1,26 +1,20 @@ -#DEPENDS_append = " module-strip" +PACKAGESTRIPFUNCS += "do_strip_modules" do_strip_modules () { - for p in ${PACKAGES}; do - if test -e ${PKGDEST}/$p/lib/modules; then - if [ "${KERNEL_MAJOR_VERSION}" == "2.6" ]; then - modules="`find ${PKGDEST}/${p}/lib/modules -name \*.ko`" - else - modules="`find ${PKGDEST}/${p}/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 + if test -e ${PKGDEST}/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 - done + if [ -n "$modules" ]; then + for module in $modules ; do + if ! [ -d "$module" ] ; then + ${STRIP} -v -g $module + fi + done + fi + fi } -python do_package_append () { - if (bb.data.getVar('INHIBIT_PACKAGE_STRIP', d, 1) != '1'): - bb.build.exec_func('do_strip_modules', d) -} + -- cgit v1.2.3