diff options
author | Chris Lamb <chris@chris-lamb.co.uk> | 2008-09-07 15:39:29 +0100 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 19:03:41 +0100 |
commit | 8d373e005b776d56a327385d1569883758d5af21 (patch) | |
tree | 34682190cb8fced49bea0d40739a1c65d13e6845 /helpers | |
parent | cf20a5b7b7208e503a39386d26961b4bfe457db4 (diff) | |
download | vyos-live-build-8d373e005b776d56a327385d1569883758d5af21.tar.gz vyos-live-build-8d373e005b776d56a327385d1569883758d5af21.zip |
Refactor partition size calculation, ensuring a uniform increase for ext partitions.
Diffstat (limited to 'helpers')
-rwxr-xr-x | helpers/lh_binary_rootfs | 3 | ||||
-rwxr-xr-x | helpers/lh_binary_usb-hdd | 2 | ||||
-rwxr-xr-x | helpers/lh_source_usb-hdd | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/helpers/lh_binary_rootfs b/helpers/lh_binary_rootfs index 718f79fd3..85cccb910 100755 --- a/helpers/lh_binary_rootfs +++ b/helpers/lh_binary_rootfs @@ -137,7 +137,8 @@ case "${LH_CHROOT_FILESYSTEM}" in fi DU_DIM="$(du -ks chroot/chroot | cut -f1)" - REAL_DIM="$(expr ${DU_DIM} + ${DU_DIM} / 20)" # Just 5% more to be sure, need something more sophistcated here... + REAL_DIM="$(Calculate_partition_size ${DU_DIM} ${LH_CHROOT_FILESYSTEM})" + if [ "${LH_DISTRIBUTION}" = "etch" ] then RESERVED_PERCENTAGE="--reserved-blocks" diff --git a/helpers/lh_binary_usb-hdd b/helpers/lh_binary_usb-hdd index 0b4663d8d..77be5396f 100755 --- a/helpers/lh_binary_usb-hdd +++ b/helpers/lh_binary_usb-hdd @@ -91,7 +91,7 @@ fi # Everything which comes here needs to be cleaned up, DU_DIM="$(du -ms binary | cut -f1)" -REAL_DIM="$(expr ${DU_DIM} + ${DU_DIM} / 50 + 1)" # Just 2% more to be sure, need something more sophistcated here... +REAL_DIM="$(Calculate_partition_size ${DU_DIM} ${LH_BINARY_FILESYSTEM})" dd if=/dev/zero of=chroot/binary.img bs=1024k count=0 seek=${REAL_DIM} FREELO="$(${LH_LOSETUP} -f)" if [ ! -b chroot/${FREELO} ] diff --git a/helpers/lh_source_usb-hdd b/helpers/lh_source_usb-hdd index 128366790..73949e34b 100755 --- a/helpers/lh_source_usb-hdd +++ b/helpers/lh_source_usb-hdd @@ -67,7 +67,7 @@ fi # Everything which comes here needs to be cleaned up, DU_DIM="$(du -ms source | cut -f1)" -REAL_DIM="$(expr ${DU_DIM} + ${DU_DIM} / 50 + 1)" # Just 2% more to be sure, need something more sophistcated here... +REAL_DIM="$(Calculate_partition_size ${DU_DIM} ${LH_BINARY_FILESYSTEM})" dd if=/dev/zero of=source.img bs=1024k count=0 seek=${REAL_DIM} FREELO="$(${LH_LOSETUP} -f)" if [ ! -b chroot/${FREELO} ] |