This must be set to the same value if the buildroot is re-used.
--vmdisk-autosetup
- --vmdisk-rootsize <size in GB>
- --vmdisk-swapsize <size in GB>
+ --vmdisk-rootsize <size in GB>
+ --vmdisk-swapsize <size in GB>
+ --vmdisk-filesystem <ext3|ext4>
--vmdisk-force [forces (re-)setup]
Enable automatic setup of VM root/swap files
+
--debug
enable creation of a debuginfo package
*-vmdisk-force)
VMDISK_FORCE=true
;;
+ *-vmdisk-filesystem)
+ VMDISK_FILESYSTEM="$ARG"
+ shift
+ ;;
*-rpmlist)
RPMLIST="--rpmlist $ARG"
BUILD_RPMS=
cleanup_and_exit $ERR
fi
+if test "ext4" = "$VMDISK_FILESYSTEM"; then
+ vm_img_mkfs='mkfs.ext4 -m 0 -q -F'
+ #$vm_img_tunefs
+fi
if test -z "$RUNNING_IN_VM" ; then
if test -n "$VM_IMAGE" ; then
if test "$VM_IMAGE" = 1 ; then
VM_IMAGE="$BUILD_ROOT.img"
fi
- if test -n "$VMDISK_AUTOSETUP"; then
- if test -n "$VMDISK_ROOTSIZE" -a -n "$VMDISK_SWAPSIZE" ; then
- if test -e "$VM_IMAGE" -a -e "$VM_SWAP" -a ! "$VMDISK_FORCE"; then
- echo "$BUILD_ROOT and $VM_SWAP present, skipping autosetup without --vmdisk-force being set."
- else
- # assuming GB for size ! thus root=4 swap=1
- # setup VM_IMAGE
- dd if=/dev/zero of="$VM_IMAGE" bs=1 count=1 seek=$(( ${VMDISK_ROOTSIZE} * 1024 * 1024 * 1024 )) || cleanup_and_exit 3
- $vm_img_mkfs $VM_IMAGE || cleanup_and_exit 3
- if test -n "$vm_img_tunefs" ; then
- $vm_img_tunefs $VM_IMAGE || cleanup_and_exit 3
- fi
- # setup VM_SWAP
- dd if=/dev/zero of="$VM_SWAP" bs=1 count=1 seek=$(( ${VMDISK_SWAPSIZE} * 1024 * 1024 * 1024 )) || cleanup_and_exit 3
- mkswap "$VM_SWAP" || cleanup_and_exit 3
- fi
+ if test -n "$VMDISK_AUTOSETUP"; then
+ if test -n "$VMDISK_ROOTSIZE" -a -n "$VMDISK_SWAPSIZE" ; then
+ if test -e "$VM_IMAGE" -a -e "$VM_SWAP" -a ! "$VMDISK_FORCE"; then
+ echo "$BUILD_ROOT and $VM_SWAP present, skipping autosetup without --vmdisk-force being set."
else
- echo "--vmdisk-autosetup used, but either --vmdisk-rootsize or --vmdisk-swapsize not set."
- cleanup_and_exit 3
- # error, bad build(-host) setup
+ # assuming GB for size ! thus root=4 swap=1
+ # setup VM_IMAGE
+ dd if=/dev/zero of="$VM_IMAGE" bs=1 count=1 seek=$(( ${VMDISK_ROOTSIZE} * 1024 * 1024 * 1024 )) || cleanup_and_exit 3
+ $vm_img_mkfs $VM_IMAGE || cleanup_and_exit 3
+ if test -n "$vm_img_tunefs" ; then
+ $vm_img_tunefs $VM_IMAGE || cleanup_and_exit 3
+ fi
+ # setup VM_SWAP
+ dd if=/dev/zero of="$VM_SWAP" bs=1 count=1 seek=$(( ${VMDISK_SWAPSIZE} * 1024 * 1024 * 1024 )) || cleanup_and_exit 3
+ mkswap "$VM_SWAP" || cleanup_and_exit 3
fi
+ else
+ echo "--vmdisk-autosetup used, but either --vmdisk-rootsize or --vmdisk-swapsize not set."
+ cleanup_and_exit 3
+ # error, bad build(-host) setup
fi
+ fi
if test ! -e "$VM_IMAGE" ; then
echo "you need to create a file system on $VM_IMAGE first"
cleanup_and_exit 3
echo "Creating filesystem on $VM_IMAGE"
$vm_img_mkfs $VM_IMAGE || cleanup_and_exit 3
if test -n "$vm_img_tunefs" ; then
- $vm_img_tunefs $VM_IMAGE || cleanup_and_exit 3
+ $vm_img_tunefs $VM_IMAGE || cleanup_and_exit 3
fi
fi
mkdir_build_root