Move the do_strip() functionality to a more common location in the
package split_and_strip_files() flow. This makes it possible for the
extended packaging data to be generated correctly for the kernel and
kernel modules. The KERNEL_IMAGE_STRIP_EXTRA_SECTIONS is reused in 
the runstrip() part of package stripping.

Signed-off-by: Saul Wold <[email protected]>
---
 meta/classes/kernel.bbclass | 35 +++--------------------------------
 1 file changed, 3 insertions(+), 32 deletions(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 7685c6921fa..30e67abb936 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -421,7 +421,7 @@ do_compile_kernelmodules() {
                bbnote "no modules to compile"
        fi
 }
-addtask compile_kernelmodules after do_compile before do_strip
+addtask compile_kernelmodules after do_compile before do_sizecheck
 
 kernel_do_install() {
        #
@@ -698,36 +698,7 @@ do_kernel_link_images() {
                ln -sf ../../../vmlinux.64
        fi
 }
-addtask kernel_link_images after do_compile before do_strip
-
-do_strip() {
-       if [ -n "${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}" ]; then
-               if ! (echo "${KERNEL_IMAGETYPES}" | grep -wq "vmlinux"); then
-                       bbwarn "image type(s) will not be stripped (not 
supported): ${KERNEL_IMAGETYPES}"
-                       return
-               fi
-
-               cd ${B}
-               headers=`"$CROSS_COMPILE"readelf -S 
${KERNEL_OUTPUT_DIR}/vmlinux | \
-                         grep "^ \{1,\}\[[0-9 ]\{1,\}\] [^ ]" | \
-                         sed "s/^ \{1,\}\[[0-9 ]\{1,\}\] //" | \
-                         gawk '{print $1}'`
-
-               for str in ${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}; do {
-                       if ! (echo "$headers" | grep -q "^$str$"); then
-                               bbwarn "Section not found: $str";
-                       fi
-
-                       "$CROSS_COMPILE"strip -s -R $str 
${KERNEL_OUTPUT_DIR}/vmlinux
-               }; done
-
-               bbnote "KERNEL_IMAGE_STRIP_EXTRA_SECTIONS is set, stripping 
sections:" \
-                       "${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}"
-       fi;
-}
-do_strip[dirs] = "${B}"
-
-addtask strip before do_sizecheck after do_kernel_link_images
+addtask kernel_link_images after do_compile before do_sizecheck
 
 # Support checking the kernel size since some kernels need to reside in 
partitions
 # with a fixed length or there is a limit in transferring the kernel to memory.
@@ -755,7 +726,7 @@ do_sizecheck() {
 }
 do_sizecheck[dirs] = "${B}"
 
-addtask sizecheck before do_install after do_strip
+addtask sizecheck before do_install after do_kernel_link_images
 
 inherit kernel-artifact-names
 
-- 
2.31.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#160269): 
https://lists.openembedded.org/g/openembedded-core/message/160269
Mute This Topic: https://lists.openembedded.org/mt/88271781/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to