Patchwork [CONSOLIDATED,PULL,15/28] image_types: Fix rootfs size calcuation

login
register
mail settings
Submitter Saul Wold
Date Jan. 5, 2012, 6:30 a.m.
Message ID <c3691c8dc3ecbc7be8235b45d7f85595a2c0296a.1325744640.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/18371/
State New
Headers show

Comments

Saul Wold - Jan. 5, 2012, 6:30 a.m.
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>
---
 meta/classes/image_types.bbclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index ebff0ba..3010549 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -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}