diff options
Diffstat (limited to 'bin/debvm-create')
-rwxr-xr-x | bin/debvm-create | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/bin/debvm-create b/bin/debvm-create index 8c86eca..4651e00 100755 --- a/bin/debvm-create +++ b/bin/debvm-create @@ -15,7 +15,7 @@ B<debvm-create> [B<-a> I<architecture>] [B<-h> I<hostname>] [B<-k> F<sshkey>] [B =head1 DESCRIPTION -B<debvm-create> is essentially a thin wrapper around B<mmdebstrap> for creating a raw ext4 filesystem image for booting with B<debvm-run>. +B<debvm-create> is essentially a thin wrapper around B<mmdebstrap> for creating a raw ext4 or tar filesystem image for booting with B<debvm-run>. The purpose of these images primarily is testing the different releases and architectures without access to a physical machine of that architecture. Beyond essential packages, the image will contain B<apt>, an init system and a suitable kernel package. Notably absent is a bootloader and a partition table. @@ -229,11 +229,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 +299,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" |