summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorMike Crowe <mac@mcrowe.com>2017-12-08 13:43:26 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-06 10:13:57 +0000
commita3eba3947efdd7ce27622408aae9fad058791015 (patch)
treeaa96b0d2e6e852182cf3c64021cdfd3aebd76293 /meta/classes
parent292214ea74ea8d70012f830b049c1ee7e1e29771 (diff)
downloadpoky-a3eba3947efdd7ce27622408aae9fad058791015.tar.gz
kernel.bbclass: Fix do_sizecheck behaviour
During the introduction of support for multiple kernel image types in 849b67b2e4820564b5e5c9bd4bb293c44351c5f3, do_sizecheck was changed to only warn if any kernel was bigger than ${KERNEL_IMAGE_MAXSIZE}. (Well, it tried to warn - it turns out that there's no function called "warn", it should be "bbwarn".) The previous behaviour had been to fail the build if the single kernel image did not fit. It seems possible that people might be generating both compressed and uncompressed kernels and only really care whether the compressed one fits. This means that we shouldn't just always fail if any of the images are too large. So, let's warn (correctly this time) on every image that is too large, but only ultimately fail if no image will fit. The build will also fail if ${KERNEL_IMAGETYPES} is empty, but I hope that no-one needs to do that. While we're here correct a typo in the KERNEL_IMAGE_MAXSIZE validity check. (From OE-Core rev: 6476d2c0ede654dca51a81045a8ccbca532c317d) Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Ross Burton <ross.burton@intel.com> (cherry picked from commit 59f1ee104d1a6c04b0690b7c8ce481449da174d6) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-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 756707a3c2..14f41e9b17 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -595,19 +595,27 @@ do_strip[dirs] = "${B}"
595addtask strip before do_sizecheck after do_kernel_link_images 595addtask strip before do_sizecheck after do_kernel_link_images
596 596
597# Support checking the kernel size since some kernels need to reside in partitions 597# Support checking the kernel size since some kernels need to reside in partitions
598# with a fixed length or there is a limit in transferring the kernel to memory 598# with a fixed length or there is a limit in transferring the kernel to memory.
599# If more than one image type is enabled, warn on any that don't fit but only fail
600# if none fit.
599do_sizecheck() { 601do_sizecheck() {
600 if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then 602 if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then
601 invalid=`echo ${KERNEL_IMAGE_MAXSIZE} | sed 's/[0-9]//g'` 603 invalid=`echo ${KERNEL_IMAGE_MAXSIZE} | sed 's/[0-9]//g'`
602 if [ -n "$invalid" ]; then 604 if [ -n "$invalid" ]; then
603 die "Invalid KERNEL_IMAGE_MAXSIZE: ${KERNEL_IMAGE_MAXSIZE}, should be an integerx (The unit is Kbytes)" 605 die "Invalid KERNEL_IMAGE_MAXSIZE: ${KERNEL_IMAGE_MAXSIZE}, should be an integer (The unit is Kbytes)"
604 fi 606 fi
607 at_least_one_fits=
605 for type in ${KERNEL_IMAGETYPES} ; do 608 for type in ${KERNEL_IMAGETYPES} ; do
606 size=`du -ks ${B}/${KERNEL_OUTPUT_DIR}/$type | awk '{print $1}'` 609 size=`du -ks ${B}/${KERNEL_OUTPUT_DIR}/$type | awk '{print $1}'`
607 if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then 610 if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then
608 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." 611 bbwarn "This kernel $type (size=$size(K) > ${KERNEL_IMAGE_MAXSIZE}(K)) is too big for your device."
612 else
613 at_least_one_fits=y
609 fi 614 fi
610 done 615 done
616 if [ -z "$at_least_one_fits" ]; then
617 die "All kernel images are too big for your device. Please reduce the size of the kernel by making more of it modular."
618 fi
611 fi 619 fi
612} 620}
613do_sizecheck[dirs] = "${B}" 621do_sizecheck[dirs] = "${B}"