summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/kernel.bbclass33
1 files changed, 31 insertions, 2 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index af58887f28..f3a55535fb 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -88,7 +88,7 @@ do_compile_kernelmodules() {
88 bbnote "no modules to compile" 88 bbnote "no modules to compile"
89 fi 89 fi
90} 90}
91addtask compile_kernelmodules after do_compile before do_install 91addtask compile_kernelmodules after do_compile before do_strip
92 92
93kernel_do_install() { 93kernel_do_install() {
94 # 94 #
@@ -289,6 +289,35 @@ python split_kernel_packages () {
289 do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.cis$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') 289 do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.cis$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
290} 290}
291 291
292do_strip() {
293 if [ -n "${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}" ]; then
294 if [[ "${KERNEL_IMAGETYPE}" != "vmlinux" ]]; then
295 bbwarn "image type will not be stripped (not supported): ${KERNEL_IMAGETYPE}"
296 return
297 fi
298
299 cd ${B}
300 headers=`"$CROSS_COMPILE"readelf -S ${KERNEL_OUTPUT} | \
301 grep "^ \{1,\}\[[0-9 ]\{1,\}\] [^ ]" | \
302 sed "s/^ \{1,\}\[[0-9 ]\{1,\}\] //" | \
303 gawk '{print $1}'`
304
305 for str in ${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}; do {
306 if [[ "$headers" != *"$str"* ]]; then
307 bbwarn "Section not found: $str";
308 fi
309
310 "$CROSS_COMPILE"strip -s -R $str ${KERNEL_OUTPUT}
311 }; done
312
313 bbnote "KERNEL_IMAGE_STRIP_EXTRA_SECTIONS is set, stripping sections:" \
314 "${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}"
315 fi;
316}
317do_strip[dirs] = "${B}"
318
319addtask do_strip before do_sizecheck after do_kernel_link_vmlinux
320
292# Support checking the kernel size since some kernels need to reside in partitions 321# Support checking the kernel size since some kernels need to reside in partitions
293# with a fixed length or there is a limit in transferring the kernel to memory 322# with a fixed length or there is a limit in transferring the kernel to memory
294do_sizecheck() { 323do_sizecheck() {
@@ -302,7 +331,7 @@ do_sizecheck() {
302} 331}
303do_sizecheck[dirs] = "${B}" 332do_sizecheck[dirs] = "${B}"
304 333
305addtask sizecheck before do_install after do_kernel_link_vmlinux 334addtask sizecheck before do_install after do_strip
306 335
307KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PE}-${PV}-${PR}-${MACHINE}-${DATETIME}" 336KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
308# Don't include the DATETIME variable in the sstate package signatures 337# Don't include the DATETIME variable in the sstate package signatures