From 3dfdd9b2c93360d7de643014595e024c319dde71 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Mon, 29 Mar 2010 16:31:08 +0200 Subject: [PATCH] automatically create disk images for vm always --- build | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/build b/build index 5eb327e..0ed8395 100755 --- a/build +++ b/build @@ -55,10 +55,8 @@ VM_IMAGE= VM_SWAP= VM_KERNEL= VM_INITRD= -VMDISK_AUTOSETUP= VMDISK_ROOTSIZE=4096 VMDISK_SWAPSIZE=1024 -VMDISK_FORCE= VMDISK_FILESYSTEM=ext3 MEMSIZE= RUNNING_IN_VM= @@ -200,12 +198,10 @@ Known Parameters: This is useful if you are hacking in the buildroot. This must be set to the same value if the buildroot is re-used. - --vmdisk-autosetup --vmdisk-rootsize --vmdisk-swapsize --vmdisk-filesystem - --vmdisk-force [forces (re-)setup] - Enable automatic setup of VM root/swap files + Defaults for automatic setup of VM root/swap files --vm-kernel --vm-initrd @@ -729,10 +725,6 @@ while test -n "$1"; do VM_INITRD="$ARG" shift ;; - # vmdisk - *-vmdisk-autosetup) - VMDISK_AUTOSETUP=true - ;; *-vmdisk-rootsize) VMDISK_ROOTSIZE="$ARG" shift @@ -741,9 +733,6 @@ while test -n "$1"; do VMDISK_SWAPSIZE="$ARG" shift ;; - *-vmdisk-force) - VMDISK_FORCE=true - ;; *-vmdisk-filesystem) VMDISK_FILESYSTEM="$ARG" shift @@ -1000,20 +989,18 @@ if test -z "$RUNNING_IN_VM" ; then echo "using $VM_SWAP as vm swap" fi fi - if test -n "$VMDISK_AUTOSETUP"; then - if test ! -e "$VM_IMAGE" -o -n "$VMDISK_FORCE"; then - echo "Creating $VM_IMAGE (${VMDISK_ROOTSIZE}M)" - dd if=/dev/zero of="$VM_IMAGE" bs=1 count=1 seek=$(( ${VMDISK_ROOTSIZE} * 1024 * 1024 )) || cleanup_and_exit 3 - if test -z "$CLEAN_BUILD" ; then - vm_img_mkfs "$VMDISK_FILESYSTEM" "$VM_IMAGE" || cleanup_and_exit 3 - fi - fi - if test ! -e "$VM_SWAP" -o -n "$VMDISK_FORCE"; then - # setup VM_SWAP - echo "Creating $VM_SWAP (${VMDISK_SWAPSIZE}M)" - dd if=/dev/zero of="$VM_SWAP" bs=1 count=1 seek=$(( ${VMDISK_SWAPSIZE} * 1024 * 1024 )) || cleanup_and_exit 3 + if test ! -e "$VM_IMAGE"; then + echo "Creating $VM_IMAGE (${VMDISK_ROOTSIZE}M)" + dd if=/dev/zero of="$VM_IMAGE" bs=1 count=1 seek=$(( ${VMDISK_ROOTSIZE} * 1024 * 1024 )) || cleanup_and_exit 3 + if test -z "$CLEAN_BUILD" ; then + vm_img_mkfs "$VMDISK_FILESYSTEM" "$VM_IMAGE" || cleanup_and_exit 3 fi fi + if test ! -e "$VM_SWAP"; then + # setup VM_SWAP + echo "Creating $VM_SWAP (${VMDISK_SWAPSIZE}M)" + dd if=/dev/zero of="$VM_SWAP" bs=1 count=1 seek=$(( ${VMDISK_SWAPSIZE} * 1024 * 1024 )) || cleanup_and_exit 3 + fi if test ! -e "$VM_IMAGE" ; then echo "you need to create $VM_IMAGE first" cleanup_and_exit 3 -- 2.7.4