Commit fff98d41 authored by Anton Midyukov's avatar Anton Midyukov

tar2fs, build-vm: add VM_BOOTSIZE for change size /boot partition

parent 37dce2b2
...@@ -153,15 +153,20 @@ IMG="$2" ...@@ -153,15 +153,20 @@ IMG="$2"
ROOTSIZE="$3" ROOTSIZE="$3"
[ -n "$ROOTSIZE" -a "$ROOTSIZE" != 0 ] || unset ROOTSIZE [ -n "$ROOTSIZE" -a "$ROOTSIZE" != 0 ] || unset ROOTSIZE
BOOTSIZE="$9"
[ -n "$BOOTSIZE" -a "$BOOTSIZE" != 0 ] || unset BOOTSIZE
# image size in bytes # image size in bytes
TARSIZE="$(stat -Lc %s "$TAR")" TARSIZE="$(stat -Lc %s "$TAR")"
# /boot size in that tarball # /boot size in that tarball
BOOTSIZE="$(boot_size "$TAR")" BOOTDEFSIZE="$(boot_size "$TAR")"
DEFSIZE="$(($SIZE_FACTOR * ($TARSIZE - $BOOTSIZE)))" # (exact sizes) DEFSIZE="$(($SIZE_FACTOR * ($TARSIZE - ${BOOTSIZE:-$BOOTDEFSIZE})))" # (exact sizes)
ROOTSIZE="$((${ROOTSIZE:-$DEFSIZE} + $MB - 1))" # for ceil rounding to MB ROOTSIZE="$((${ROOTSIZE:-$DEFSIZE} + $MB - 1))" # for ceil rounding to MB
# image and /boot sizes in megabytes # image and /boot sizes in megabytes
ROOTSIZEM="$(($ROOTSIZE / $MB))" ROOTSIZEM="$(($ROOTSIZE / $MB))"
BOOTSIZEM="$((($SIZE_FACTOR * $BOOT_SIZE_FACTOR * $BOOTSIZE + $MB - 1) / $MB))" BOOTDEFSIZE="$(($SIZE_FACTOR * $BOOT_SIZE_FACTOR * $BOOTDEFSIZE))"
BOOTSIZE="$((${BOOTSIZE:-$BOOTDEFSIZE} + $MB - 1))" # for ceil rounding to MB
BOOTSIZEM="$(($BOOTSIZE / $MB))"
# single root partition hardwired so far, # single root partition hardwired so far,
# add another image for home/data/swap if needed # add another image for home/data/swap if needed
......
...@@ -58,7 +58,7 @@ tar2fs: $(SAVE_TARBALL) check-sudo prepare-tarball-qemu ...@@ -58,7 +58,7 @@ tar2fs: $(SAVE_TARBALL) check-sudo prepare-tarball-qemu
if ! sudo $$TOPDIR/bin/tar2fs \ if ! sudo $$TOPDIR/bin/tar2fs \
"$(VM_TARBALL)" "$(VM_RAWDISK)" "$(VM_SIZE)" "$(VM_FSTYPE)" \ "$(VM_TARBALL)" "$(VM_RAWDISK)" "$(VM_SIZE)" "$(VM_FSTYPE)" \
"$(VM_BOOTLOADER)" "$(ARCH)" "$(VM_PARTTABLE)" \ "$(VM_BOOTLOADER)" "$(ARCH)" "$(VM_PARTTABLE)" \
"$(VM_BOOTTYPE)"; then \ "$(VM_BOOTTYPE)" "$(VM_BOOTSIZE)"; then \
echo "** error: sudo tar2fs failed, see build log" >&2; \ echo "** error: sudo tar2fs failed, see build log" >&2; \
exit 1; \ exit 1; \
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment