diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-11-23 01:20:04 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-11-23 01:20:04 +0000 |
commit | 18a377dcf50c5c10ebc73a36963a6e83d1bbad5d (patch) | |
tree | 987322f54fb1c70ece62fa276c9900eeef6fa2f8 /classes/package.bbclass | |
parent | d35cf88e849ccad6fce5ab4bbf4cbe96f6e513b9 (diff) |
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 <rpurdie@linux.intel.com>
Diffstat (limited to 'classes/package.bbclass')
-rw-r--r-- | classes/package.bbclass | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/classes/package.bbclass b/classes/package.bbclass index 8892fa9084..4196135710 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -201,6 +201,26 @@ def runstrip(file, d): return 1 +PACKAGESTRIPFUNCS += "do_runstrip" +python do_runstrip() { + import stat + + dvar = bb.data.getVar('PKGD', d, True) + def isexec(path): + try: + s = os.stat(path) + except (os.error, AttributeError): + return 0 + return (s[stat.ST_MODE] & stat.S_IEXEC) + + for root, dirs, files in os.walk(dvar): + for f in files: + file = os.path.join(root, f) + if not os.path.islink(file) and not os.path.isdir(file) and isexec(file): + runstrip(file, d) +} + + def write_package_md5sums (root, outfile, ignorepaths): # For each regular file under root, writes an md5sum to outfile. # With thanks to patch.bbclass. @@ -339,7 +359,7 @@ python perform_packagecopy () { } python populate_packages () { - import glob, stat, errno, re,os + import glob, errno, re,os workdir = bb.data.getVar('WORKDIR', d, True) outdir = bb.data.getVar('DEPLOY_DIR', d, True) @@ -350,13 +370,6 @@ python populate_packages () { bb.mkdirhier(outdir) os.chdir(dvar) - def isexec(path): - try: - s = os.stat(path) - except (os.error, AttributeError): - return 0 - return (s[stat.ST_MODE] & stat.S_IEXEC) - # Sanity check PACKAGES for duplicates - should be moved to # sanity.bbclass once we have the infrastucture package_list = [] @@ -369,12 +382,10 @@ python populate_packages () { else: package_list.append(pkg) + if (bb.data.getVar('INHIBIT_PACKAGE_STRIP', d, True) != '1'): - for root, dirs, files in os.walk(dvar): - for f in files: - file = os.path.join(root, f) - if not os.path.islink(file) and not os.path.isdir(file) and isexec(file): - runstrip(file, d) + for f in (bb.data.getVar('PACKAGESTRIPFUNCS', d, True) or '').split(): + bb.build.exec_func(f, d) pkgdest = bb.data.getVar('PKGDEST', d, True) os.system('rm -rf %s' % pkgdest) |