]> code.ossystems Code Review - openembedded-core.git/commitdiff
image_types: Fix rootfs size calcuation
authorSaul Wold <sgw@linux.intel.com>
Thu, 5 Jan 2012 00:46:25 +0000 (16:46 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 5 Jan 2012 11:14:39 +0000 (11:14 +0000)
The ROOTFS_SIZE calculation was not correctly taking into account
the IMAGE_ROOTFS_EXTRA_SPACE variable, it would only be applied if
the size as determined by the ((du * overhead) + extra space) was
greater than the IMAGE_ROOTFS_SIZE, so if the du * overhead was smaller

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/image_types.bbclass

index ebff0ba60ab6c3fae0104f1d2553479c7fd101d6..30105498078023bd794e099e5e1aef6694011ae3 100644 (file)
@@ -23,7 +23,7 @@ def get_imagecmds(d):
 
 runimagecmd () {
        # Image generation code for image type ${type}
-       ROOTFS_SIZE=`du -ks ${IMAGE_ROOTFS}|awk '{size = $1 * ${IMAGE_OVERHEAD_FACTOR} + ${IMAGE_ROOTFS_EXTRA_SPACE}; OFMT = "%.0f" ; print (size > ${IMAGE_ROOTFS_SIZE} ? size : ${IMAGE_ROOTFS_SIZE}) }'`
+       ROOTFS_SIZE=`du -ks ${IMAGE_ROOTFS}|awk '{base_size = ($1 * ${IMAGE_OVERHEAD_FACTOR});  OFMT = "%.0f" ; print ((base_size > ${IMAGE_ROOTFS_SIZE} ? base_size : ${IMAGE_ROOTFS_SIZE}) + ${IMAGE_ROOTFS_EXTRA_SPACE}) }'`
        ${cmd}
        cd ${DEPLOY_DIR_IMAGE}/
        rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.${type}