From 1f65837e7875774a754dda2447cc3b6687c8bc3a Mon Sep 17 00:00:00 2001 From: Saul Wold Date: Wed, 8 Sep 2010 16:25:25 -0700 Subject: image.bbclass: change IMAGE_EXTRA_SPACE to IMAGE_OVERHEAD_FACTOR This change allows the IMAGE_OVERHEAD_FACTOR (default to 1.2) to adjust dynamicly how much space to add for each image, thus there is 20% overhead space by default. Signed-off-by: Saul Wold --- meta/classes/image.bbclass | 2 +- meta/conf/bitbake.conf | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 9f076a68e7..1b34ac423b 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -128,7 +128,7 @@ fakeroot do_rootfs () { ${IMAGE_PREPROCESS_COMMAND} - ROOTFS_SIZE=`du -ks ${IMAGE_ROOTFS}|awk '{size = ${IMAGE_EXTRA_SPACE} + $1; print (size > ${IMAGE_ROOTFS_SIZE} ? size : ${IMAGE_ROOTFS_SIZE}) }'` + ROOTFS_SIZE=`du -ks ${IMAGE_ROOTFS}|awk '{size = $1 * ${IMAGE_OVERHEAD_FACTOR}; print (size > ${IMAGE_ROOTFS_SIZE} ? size : ${IMAGE_ROOTFS_SIZE}) }'` ${@get_imagecmds(d)} ${IMAGE_POSTPROCESS_COMMAND} diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index d54aa35b82..f6eee7d2af 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -317,7 +317,11 @@ IMAGE_ROOTFS = "${WORKDIR}/rootfs" IMAGE_BASENAME = "${PN}" IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DATETIME}" IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}" -IMAGE_EXTRA_SPACE ?= 81920 + +# This option allows for a precentage overage of the actaul image size rather than a +# fixed extra space +IMAGE_OVERHEAD_FACTOR ?= 1.2 + # Comment this option if you want default genext2fs behavior (i.e. create minimal inode number) IMAGE_EXTRA_OPTION ?= "-i 8192" -- cgit v1.2.3