From 603e1cf2f9901603452544d79f6d8d8aeb57dec8 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Fri, 20 Nov 2009 10:24:16 +0100 Subject: package bbclass: give better diagnostic when bb.copyfile fails --- classes/package.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes/package.bbclass') diff --git a/classes/package.bbclass b/classes/package.bbclass index 246ecd4ecc..008eca5530 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -428,7 +428,7 @@ python populate_packages () { bb.mkdirhier(dpath) ret = bb.copyfile(file, fpath) if ret is False or ret == 0: - raise bb.build.FuncFailed("File population failed") + raise bb.build.FuncFailed("File population failed when copying %s to %s" % (file, fpath)) if pkg == main_pkg and main_is_empty: main_is_empty = 0 del localdata -- cgit v1.2.3 From 9fd535b0de736044013231d1c6d576f07d0dcf93 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Fri, 20 Nov 2009 11:14:45 +0100 Subject: package bbclass: drop ret = 0 check for bb.copyfile since it will return either False or the new mtime * Yes, I have files that claim to be from 19700101 :) --- classes/package.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes/package.bbclass') diff --git a/classes/package.bbclass b/classes/package.bbclass index 008eca5530..bb81f33b29 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -427,7 +427,7 @@ python populate_packages () { dpath = os.path.dirname(fpath) bb.mkdirhier(dpath) ret = bb.copyfile(file, fpath) - if ret is False or ret == 0: + if ret is False: raise bb.build.FuncFailed("File population failed when copying %s to %s" % (file, fpath)) if pkg == main_pkg and main_is_empty: main_is_empty = 0 -- cgit v1.2.3 From 8581bc05f43d81179added7909e99d3afde1f447 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 23 Nov 2009 00:45:02 +0000 Subject: package.bbclass: Make sure PKGD is empty before populating fixing certain bugs (from Poky) Signed-off-by: Richard Purdie --- classes/package.bbclass | 1 + 1 file changed, 1 insertion(+) (limited to 'classes/package.bbclass') diff --git a/classes/package.bbclass b/classes/package.bbclass index bb81f33b29..8892fa9084 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -334,6 +334,7 @@ python perform_packagecopy () { # Start by package population by taking a copy of the installed # files to operate on + os.system('rm -rf %s/*' % (dvar)) os.system('cp -pPR %s/* %s/' % (dest, dvar)) } -- cgit v1.2.3 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/package.bbclass | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'classes/package.bbclass') 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) -- cgit v1.2.3