summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel.bbclass
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2014-07-07 02:33:59 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-07-10 17:38:32 +0100
commit7e6eeeefdd0a92df5203d54a9b574957ed2a25ce (patch)
tree53aa0e003a8b2ae048aa737a72176ec0d6d873b5 /meta/classes/kernel.bbclass
parent0903a6b53203bf61a6c24db05f916bf333958387 (diff)
downloadpoky-7e6eeeefdd0a92df5203d54a9b574957ed2a25ce.tar.gz
kernel.bbclass: update KERNEL_IMAGE_MAXSIZE
* Make KERNEL_IMAGE_MAXSIZE and IMAGE_ROOTFS_SIZE have the same algorithm: - Use Kbytes as the unit since we use this in other codes. - Use "du" rather than "ls" to figure out the size since we use this in image.py. [YOCTO #2610] (From OE-Core rev: 7384d2831c713ac5999aca83c312154dc15cec56) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel.bbclass')
-rw-r--r--meta/classes/kernel.bbclass9
1 files changed, 6 insertions, 3 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index f5d725878f..b2e9d4cb36 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -422,10 +422,13 @@ addtask do_strip before do_sizecheck after do_kernel_link_vmlinux
422# with a fixed length or there is a limit in transferring the kernel to memory 422# with a fixed length or there is a limit in transferring the kernel to memory
423do_sizecheck() { 423do_sizecheck() {
424 if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then 424 if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then
425 cd ${B} 425 invalid=`echo ${KERNEL_IMAGE_MAXSIZE} | sed 's/[0-9]//g'`
426 size=`ls -lL ${KERNEL_OUTPUT} | awk '{ print $5}'` 426 if [ -n "$invalid" ]; then
427 die "Invalid KERNEL_IMAGE_MAXSIZE: ${KERNEL_IMAGE_MAXSIZE}, should be an integerx (The unit is Kbytes)"
428 fi
429 size=`du -ks ${B}/${KERNEL_OUTPUT} | awk '{ print $1}'`
427 if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then 430 if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then
428 die "This kernel (size=$size > ${KERNEL_IMAGE_MAXSIZE}) is too big for your device. Please reduce the size of the kernel by making more of it modular." 431 die "This kernel (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."
429 fi 432 fi
430 fi 433 fi
431} 434}