]> code.ossystems Code Review - openembedded-core.git/commitdiff
kernel.bbclass: fix do_sizecheck() comparison
authorAndrea Adami <andrea.adami@gmail.com>
Sat, 12 Jun 2021 22:14:03 +0000 (00:14 +0200)
committerSteve Sakoman <steve@sakoman.com>
Tue, 15 Jun 2021 16:37:17 +0000 (06:37 -1000)
The routine do_sizecheck() was historically needed by legacy
devices with limited flash memory.
The lowest extreme is probably with Zaurus collie having exactly
1024*1024 = 1048576 bytes for the kernel partition.

In the years the KERNEL_IMAGE_MAXSIZE has been converted to kilobytes
thus rounded so we have now KERNEL_IMAGE_MAXSIZE_collie = "1024".

The effect is that now the check fails because we hit curiously this
 | WARNING: This kernel zImage (size=1024(K) > 1024(K)) is too big for...
even though zImage is 1047288 bytes (kernel + kexecboot-klibc-initramfs).

Fix this case using test -gt (greater) instead of -ge (greater or equal).

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 254ca956d63b4ce6aa294213b60bb943f9f3a9e6)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/classes/kernel.bbclass

index 518aaef72433bd365862a93916923879521c4b71..85c6594c275d6c11d1e652cf20c6945803ae65ca 100644 (file)
@@ -680,7 +680,7 @@ do_sizecheck() {
                at_least_one_fits=
                for imageType in ${KERNEL_IMAGETYPES} ; do
                        size=`du -ks ${B}/${KERNEL_OUTPUT_DIR}/$imageType | awk '{print $1}'`
-                       if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then
+                       if [ $size -gt ${KERNEL_IMAGE_MAXSIZE} ]; then
                                bbwarn "This kernel $imageType (size=$size(K) > ${KERNEL_IMAGE_MAXSIZE}(K)) is too big for your device."
                        else
                                at_least_one_fits=y