summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/kernel.bbclass14
1 files changed, 11 insertions, 3 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 7ef4f47981..e7eda83bd0 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -596,19 +596,27 @@ do_strip[dirs] = "${B}"
596addtask strip before do_sizecheck after do_kernel_link_images 596addtask strip before do_sizecheck after do_kernel_link_images
597 597
598# Support checking the kernel size since some kernels need to reside in partitions 598# Support checking the kernel size since some kernels need to reside in partitions
599# with a fixed length or there is a limit in transferring the kernel to memory 599# with a fixed length or there is a limit in transferring the kernel to memory.
600# If more than one image type is enabled, warn on any that don't fit but only fail
601# if none fit.
600do_sizecheck() { 602do_sizecheck() {
601 if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then 603 if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then
602 invalid=`echo ${KERNEL_IMAGE_MAXSIZE} | sed 's/[0-9]//g'` 604 invalid=`echo ${KERNEL_IMAGE_MAXSIZE} | sed 's/[0-9]//g'`
603 if [ -n "$invalid" ]; then 605 if [ -n "$invalid" ]; then
604 die "Invalid KERNEL_IMAGE_MAXSIZE: ${KERNEL_IMAGE_MAXSIZE}, should be an integerx (The unit is Kbytes)" 606 die "Invalid KERNEL_IMAGE_MAXSIZE: ${KERNEL_IMAGE_MAXSIZE}, should be an integer (The unit is Kbytes)"
605 fi 607 fi
608 at_least_one_fits=
606 for type in ${KERNEL_IMAGETYPES} ; do 609 for type in ${KERNEL_IMAGETYPES} ; do
607 size=`du -ks ${B}/${KERNEL_OUTPUT_DIR}/$type | awk '{print $1}'` 610 size=`du -ks ${B}/${KERNEL_OUTPUT_DIR}/$type | awk '{print $1}'`
608 if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then 611 if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then
609 warn "This kernel $type (size=$size(K) > ${KERNEL_IMAGE_MAXSIZE}(K)) is too big for your device. Please reduce the size of the kernel by making more of it modular." 612 bbwarn "This kernel $type (size=$size(K) > ${KERNEL_IMAGE_MAXSIZE}(K)) is too big for your device."
613 else
614 at_least_one_fits=y
610 fi 615 fi
611 done 616 done
617 if [ -z "$at_least_one_fits" ]; then
618 die "All kernel images are too big for your device. Please reduce the size of the kernel by making more of it modular."
619 fi
612 fi 620 fi
613} 621}
614do_sizecheck[dirs] = "${B}" 622do_sizecheck[dirs] = "${B}"