diff options
author | Saul Wold <Saul.Wold@windriver.com> | 2022-01-12 09:20:40 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-01-13 13:57:26 +0000 |
commit | d756b346f248df47b0540644adb1d0f17bcc4b6e (patch) | |
tree | 9acb73ee771be6fc4eb0d488f26f07d0df139bc7 /meta/lib/oe | |
parent | 987d30df5bb18de3cf17d38bbb745ea65cb86266 (diff) | |
download | poky-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/lib/oe')
-rw-r--r-- | meta/lib/oe/package.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index dd700cbb0c..7d387ee81d 100644 --- a/meta/lib/oe/package.py +++ b/meta/lib/oe/package.py | |||
@@ -16,7 +16,11 @@ def runstrip(arg): | |||
16 | # 8 - shared library | 16 | # 8 - shared library |
17 | # 16 - kernel module | 17 | # 16 - kernel module |
18 | 18 | ||
19 | (file, elftype, strip) = arg | 19 | if len(arg) == 3: |
20 | (file, elftype, strip) = arg | ||
21 | extra_strip_sections = '' | ||
22 | else: | ||
23 | (file, elftype, strip, extra_strip_sections) = arg | ||
20 | 24 | ||
21 | newmode = None | 25 | newmode = None |
22 | if not os.access(file, os.W_OK) or os.access(file, os.R_OK): | 26 | if not os.access(file, os.W_OK) or os.access(file, os.R_OK): |
@@ -40,6 +44,9 @@ def runstrip(arg): | |||
40 | # shared or executable: | 44 | # shared or executable: |
41 | elif elftype & 8 or elftype & 4: | 45 | elif elftype & 8 or elftype & 4: |
42 | stripcmd.extend(["--remove-section=.comment", "--remove-section=.note"]) | 46 | stripcmd.extend(["--remove-section=.comment", "--remove-section=.note"]) |
47 | if extra_strip_sections != '': | ||
48 | for section in extra_strip_sections.split(): | ||
49 | stripcmd.extend(["--remove-section=" + section]) | ||
43 | 50 | ||
44 | stripcmd.append(file) | 51 | stripcmd.append(file) |
45 | bb.debug(1, "runstrip: %s" % stripcmd) | 52 | bb.debug(1, "runstrip: %s" % stripcmd) |