diff options
-rwxr-xr-x | bin/debvm-create | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/bin/debvm-create b/bin/debvm-create index 8c86eca..41a6139 100755 --- a/bin/debvm-create +++ b/bin/debvm-create @@ -69,6 +69,12 @@ Skips adding a the customize-autologin.sh to B<mmdebstrap> that configures automatic root login on a serial console and also parses the C<TERM> kernel cmdline and passes it as C<TERM> to B<agetty>. +=item B<ext4> + +Internally, B<mmdebstrap> creates a tar archive first and converts that to ext2, which is then upgraded to ext4. +This option causes the conversion to ext2 and further steps to be skipped and the output image will be a tar archive instead. +Such a tar archive is not suitable for being booted by B<debvm-run>. + =item B<kernel> skips installing a linux kernel image. @@ -229,11 +235,17 @@ if ! check_skip kernel; then set -- "--customize-hook=$SHARE_DIR/customize-kernel.sh" "$@" fi +MMFORMAT=ext2 +# output a tarball if the ext4 step is skipped +if check_skip ext4; then + MMFORMAT=tar +fi + # construct mmdebstrap options as $@: set -- \ --verbose \ --variant=apt \ - --format=ext2 \ + "--format=$MMFORMAT" \ --include=init \ "--architecture=$ARCHITECTURE" \ '--customize-hook=echo "LABEL=debvm / ext4 defaults 0 1" >"$1/etc/fstab"' \ @@ -293,6 +305,11 @@ set -ex mmdebstrap "$@" +{ set +x; } 2>/dev/null +check_skip ext4 && exit + +set -x + truncate -s ">$SIZE" "$IMAGE" /sbin/tune2fs -L debvm -c 0 -i 0 -O dir_index,dir_nlink,extents,extra_isize,flex_bg,has_journal,huge_file "$IMAGE" /sbin/resize2fs -b "$IMAGE" |