From d2cb979ddf47498f52f61fbefb8de8939fcf7059 Mon Sep 17 00:00:00 2001 From: Clint Byrum Date: Sat, 11 Jan 2014 13:44:53 -0800 Subject: [PATCH] Increase padding to allow for smaller images With smaller base images, such as Debian, the padding value used to size the root filesystem does not leave enough room for grub which is installed after the filesystem is created. Change-Id: Ic2ab9e2efc9bf1b02f802ee47a36e3fff9c3512e --- bin/disk-image-create | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/disk-image-create b/bin/disk-image-create index 6a57fb97..3b3d3f3f 100755 --- a/bin/disk-image-create +++ b/bin/disk-image-create @@ -144,11 +144,11 @@ MKFS_OPTS="" if [ -n "$DIB_IMAGE_SIZE" ]; then truncate -s${DIB_IMAGE_SIZE}G $TMP_IMAGE_PATH else - # in kb*0.70 - underreport to get a slightly bigger device + # in kb*0.60 - underreport to get a slightly bigger device # Rounding down size so that is is a multiple of 64, works around a bug in # qemu-img that may occur when compressing raw images that aren't a multiple # of 64k. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1180021 - _NEEDED_SIZE=$(sudo du --block-size=700 -x -s ${TMP_BUILD_DIR}/built | \ + _NEEDED_SIZE=$(sudo du --block-size=600 -x -s ${TMP_BUILD_DIR}/built | \ awk ' { print $1 - ( $1 % 64) } ') truncate -s${_NEEDED_SIZE}K $TMP_IMAGE_PATH if [ "$FS_TYPE" = "ext4" ] ; then