diff options
author | Mike Crowe <mac@mcrowe.com> | 2017-12-08 13:43:26 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-02 17:24:37 +0000 |
commit | bbef2327f8e006162b7978f696ddc24a9dc74e91 (patch) | |
tree | b4c5a6a18c432861dc8e32d58eaaa5f586d988ac /meta | |
parent | c27f5dc245f4aa4f7df96075222e06d3fd49c835 (diff) | |
download | poky-bbef2327f8e006162b7978f696ddc24a9dc74e91.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: 59f1ee104d1a6c04b0690b7c8ce481449da174d6)
Signed-off-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/kernel.bbclass | 14 |
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}" | |||
596 | addtask strip before do_sizecheck after do_kernel_link_images | 596 | addtask 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. | ||
600 | do_sizecheck() { | 602 | do_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 | } |
614 | do_sizecheck[dirs] = "${B}" | 622 | do_sizecheck[dirs] = "${B}" |