[oe-commits] Robert Yang : kernel.bbclass: update KERNEL_IMAGE_MAXSIZE

git at git.openembedded.org git at git.openembedded.org
Thu Jul 10 16:40:09 UTC 2014


Module: openembedded-core.git
Branch: master
Commit: 7384d2831c713ac5999aca83c312154dc15cec56
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=7384d2831c713ac5999aca83c312154dc15cec56

Author: Robert Yang <liezhi.yang at windriver.com>
Date:   Mon Jul  7 02:33:59 2014 -0700

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]

Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
Signed-off-by: Saul Wold <sgw at linux.intel.com>

---

 meta/classes/kernel.bbclass | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index f5d7258..b2e9d4c 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
 # with a fixed length or there is a limit in transferring the kernel to memory
 do_sizecheck() {
 	if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then
-		cd ${B}
-		size=`ls -lL ${KERNEL_OUTPUT} | awk '{ print $5}'`
+		invalid=`echo ${KERNEL_IMAGE_MAXSIZE} | sed 's/[0-9]//g'`
+		if [ -n "$invalid" ]; then
+			die "Invalid KERNEL_IMAGE_MAXSIZE: ${KERNEL_IMAGE_MAXSIZE}, should be an integerx (The unit is Kbytes)"
+		fi
+		size=`du -ks ${B}/${KERNEL_OUTPUT} | awk '{ print $1}'`
 		if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then
-			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."
+			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."
 		fi
 	fi
 }



More information about the Openembedded-commits mailing list