summaryrefslogtreecommitdiffstats
path: root/meta/classes/package.bbclass
diff options
context:
space:
mode:
authorSaul Wold <Saul.Wold@windriver.com>2022-01-12 09:20:40 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-01-13 13:57:26 +0000
commitd756b346f248df47b0540644adb1d0f17bcc4b6e (patch)
tree9acb73ee771be6fc4eb0d488f26f07d0df139bc7 /meta/classes/package.bbclass
parent987d30df5bb18de3cf17d38bbb745ea65cb86266 (diff)
downloadpoky-d756b346f248df47b0540644adb1d0f17bcc4b6e.tar.gz
package: Add support for kernel stripping
Extend runstrip() to accept additional argument to enable sharing it with the kernel do_strip() so that KERNEL_IMAGE_STRIP_EXTRA_SECTIONS can be passed. Since is_elf() understands kernel modules there is no need to keep a seperate list for kernmodules or hardcode the values to runstrip. (From OE-Core rev: e09a8fa931fe617afc05bd5e00dca5dd3fe386e8) Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r--meta/classes/package.bbclass17
1 files changed, 5 insertions, 12 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 09cd376f4a..4927fb99ff 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -390,10 +390,6 @@ def splitdebuginfo(file, dvar, debugdir, debuglibdir, debugappend, debugsrcdir,
390 dvar = d.getVar('PKGD') 390 dvar = d.getVar('PKGD')
391 objcopy = d.getVar("OBJCOPY") 391 objcopy = d.getVar("OBJCOPY")
392 392
393 # We ignore kernel modules, we don't generate debug info files.
394 if file.find("/lib/modules/") != -1 and file.endswith(".ko"):
395 return (file, sources)
396
397 newmode = None 393 newmode = None
398 if not os.access(file, os.W_OK) or os.access(file, os.R_OK): 394 if not os.access(file, os.W_OK) or os.access(file, os.R_OK):
399 origmode = os.stat(file)[stat.ST_MODE] 395 origmode = os.stat(file)[stat.ST_MODE]
@@ -1122,7 +1118,6 @@ python split_and_strip_files () {
1122 # 1118 #
1123 elffiles = {} 1119 elffiles = {}
1124 symlinks = {} 1120 symlinks = {}
1125 kernmods = []
1126 staticlibs = [] 1121 staticlibs = []
1127 inodes = {} 1122 inodes = {}
1128 libdir = os.path.abspath(dvar + os.sep + d.getVar("libdir")) 1123 libdir = os.path.abspath(dvar + os.sep + d.getVar("libdir"))
@@ -1145,9 +1140,6 @@ python split_and_strip_files () {
1145 if file in skipfiles: 1140 if file in skipfiles:
1146 continue 1141 continue
1147 1142
1148 if file.endswith(".ko") and file.find("/lib/modules/") != -1:
1149 kernmods.append(file)
1150 continue
1151 if oe.package.is_static_lib(file): 1143 if oe.package.is_static_lib(file):
1152 staticlibs.append(file) 1144 staticlibs.append(file)
1153 continue 1145 continue
@@ -1164,8 +1156,11 @@ python split_and_strip_files () {
1164 if not s: 1156 if not s:
1165 continue 1157 continue
1166 # Check its an executable 1158 # Check its an executable
1167 if (s[stat.ST_MODE] & stat.S_IXUSR) or (s[stat.ST_MODE] & stat.S_IXGRP) or (s[stat.ST_MODE] & stat.S_IXOTH) \ 1159 if (s[stat.ST_MODE] & stat.S_IXUSR) or (s[stat.ST_MODE] & stat.S_IXGRP) \
1168 or ((file.startswith(libdir) or file.startswith(baselibdir)) and (".so" in f or ".node" in f)): 1160 or (s[stat.ST_MODE] & stat.S_IXOTH) \
1161 or ((file.startswith(libdir) or file.startswith(baselibdir)) \
1162 and (".so" in f or ".node" in f)) \
1163 or (f.startswith('vmlinux') or ".ko" in f):
1169 1164
1170 if cpath.islink(file): 1165 if cpath.islink(file):
1171 checkelflinks[file] = ltarget 1166 checkelflinks[file] = ltarget
@@ -1312,8 +1307,6 @@ python split_and_strip_files () {
1312 elf_file = int(elffiles[file]) 1307 elf_file = int(elffiles[file])
1313 #bb.note("Strip %s" % file) 1308 #bb.note("Strip %s" % file)
1314 sfiles.append((file, elf_file, strip)) 1309 sfiles.append((file, elf_file, strip))
1315 for f in kernmods:
1316 sfiles.append((f, 16, strip))
1317 if (d.getVar('PACKAGE_STRIP_STATIC') == '1' or d.getVar('PACKAGE_DEBUG_STATIC_SPLIT') == '1'): 1310 if (d.getVar('PACKAGE_STRIP_STATIC') == '1' or d.getVar('PACKAGE_DEBUG_STATIC_SPLIT') == '1'):
1318 for f in staticlibs: 1311 for f in staticlibs:
1319 sfiles.append((f, 16, strip)) 1312 sfiles.append((f, 16, strip))