@@ -1122,7 +1122,6 @@ python split_and_strip_files () {
#
elffiles = {}
symlinks = {}
- kernmods = []
staticlibs = []
inodes = {}
libdir = os.path.abspath(dvar + os.sep + d.getVar("libdir"))
@@ -1145,9 +1144,6 @@ python split_and_strip_files () {
if file in skipfiles:
continue
- if file.endswith(".ko") and file.find("/lib/modules/") != -1:
- kernmods.append(file)
- continue
if oe.package.is_static_lib(file):
staticlibs.append(file)
continue
@@ -1164,8 +1160,11 @@ python split_and_strip_files () {
if not s:
continue
# Check its an executable
- if (s[stat.ST_MODE] & stat.S_IXUSR) or (s[stat.ST_MODE] & stat.S_IXGRP) or (s[stat.ST_MODE] & stat.S_IXOTH) \
- or ((file.startswith(libdir) or file.startswith(baselibdir)) and (".so" in f or ".node" in f)):
+ if (s[stat.ST_MODE] & stat.S_IXUSR) or (s[stat.ST_MODE] & stat.S_IXGRP) \
+ or (s[stat.ST_MODE] & stat.S_IXOTH) \
+ or ((file.startswith(libdir) or file.startswith(baselibdir)) \
+ and (".so" in f or ".node" in f)) \
+ or (f.startswith('vmlinux') or ".ko" in f):
if cpath.islink(file):
checkelflinks[file] = ltarget
@@ -1310,13 +1309,15 @@ python split_and_strip_files () {
sfiles = []
for file in elffiles:
elf_file = int(elffiles[file])
- #bb.note("Strip %s" % file)
- sfiles.append((file, elf_file, strip))
- for f in kernmods:
- sfiles.append((f, 16, strip))
+ bb.note("Strip %s" % file)
+ extra_sections = d.getVar('KERNEL_IMAGE_STRIP_EXTRA_SECTIONS')
+ if (extra_sections is not None and file.find('boot/vmlinux')):
+ sfiles.append((file, elf_file, strip, extra_sections))
+ else:
+ sfiles.append((file, elf_file, strip, ''))
if (d.getVar('PACKAGE_STRIP_STATIC') == '1' or d.getVar('PACKAGE_DEBUG_STATIC_SPLIT') == '1'):
for f in staticlibs:
- sfiles.append((f, 16, strip))
+ sfiles.append((f, 16, strip, ''))
oe.utils.multiprocess_launch(oe.package.runstrip, sfiles, d)
@@ -16,7 +16,7 @@ def runstrip(arg):
# 8 - shared library
# 16 - kernel module
- (file, elftype, strip) = arg
+ (file, elftype, strip, extra_strip_sections) = arg
newmode = None
if not os.access(file, os.W_OK) or os.access(file, os.R_OK):
@@ -40,6 +40,9 @@ def runstrip(arg):
# shared or executable:
elif elftype & 8 or elftype & 4:
stripcmd.extend(["--remove-section=.comment", "--remove-section=.note"])
+ if "boot/vmlinux" in file and extra_strip_sections != '':
+ for section in extra_strip_sections.split():
+ stripcmd.extend(["--remove-section=" + section])
stripcmd.append(file)
bb.debug(1, "runstrip: %s" % stripcmd)
@@ -172,7 +175,7 @@ def strip_execs(pn, dstdir, strip_cmd, libdir, base_libdir, d, qa_already_stripp
sfiles = []
for file in elffiles:
elf_file = int(elffiles[file])
- sfiles.append((file, elf_file, strip_cmd))
+ sfiles.append((file, elf_file, strip_cmd, ''))
oe.utils.multiprocess_launch(runstrip, sfiles, d)
This moves the KERNEL_IMAGE_STRIP_EXTRA_SECTIONS from kernel.bbclass to the split_and_strip_files() flow. Since the multiprocess_launch is used here the variable needs to be passed as an argument. Since is_elf() understands kernel modules there is no need to keep a seperate list for kernmodules or hardcode the values to runstrip. Signed-off-by: Saul Wold <saul.wold@windriver.com> --- meta/classes/package.bbclass | 23 ++++++++++++----------- meta/lib/oe/package.py | 7 +++++-- 2 files changed, 17 insertions(+), 13 deletions(-)