Skip to content

Commit

Permalink
- rename vmdisk-cleanup to vmdisk-clean (cleanup sounds like it is do…
Browse files Browse the repository at this point in the history
…ne after the build). Also remove the swap image and be careful to not remove device nodes
  • Loading branch information
mlschroe committed Aug 9, 2012
1 parent d5e4317 commit b33c687
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ VMDISK_SWAPSIZE=1024
VMDISK_FILESYSTEM=ext3
# settings are for speed and not data safety, we format anyway on next run
VMDISK_MOUNT_OPTIONS=__default
VMDISK_ROOT_CLEAN=no
VMDISK_CLEAN=
HUGETLBFSPATH=
MEMSIZE=
RUNNING_IN_VM=
Expand Down Expand Up @@ -980,10 +980,9 @@ while test -n "$1"; do
VMDISK_MOUNT_OPTIONS=$(echo $ARG | sed 's/^\"\(.*\)\"$/\1/g')
shift
;;
*-vmdisk-cleanup)
needarg
VMDISK_ROOT_CLEAN="$ARG"
shift
*-vmdisk-clean)
# delete old root/swap to get rid of the old blocks
VMDISK_CLEAN=true
;;
*-rpmlist)
needarg
Expand Down Expand Up @@ -1317,10 +1316,16 @@ if test -z "$RUNNING_IN_VM" ; then
XENID="${XENID#root_}"
xm destroy "build_$XENID" >/dev/null 2>&1
fi
if [ "$VMDISK_ROOT_CLEAN" = "yes" ]; then
#delete VM image so later we can recreate a new one
echo "Deleting $VM_IMAGE"
rm -rf "$VM_IMAGE"
if test -n "$VMDISK_CLEAN" ; then
# delete old root/swap to get rid of the old blocks
if test -f "$VM_IMAGE" ; then
echo "Deleting old $VM_IMAGE"
rm -rf "$VM_IMAGE"
fi
if test -n "$VM_SWAP" -a -f "$VM_SWAP" ; then
echo "Deleting old $VM_SWAP"
rm -rf "$VM_SWAP"
fi
fi
if test ! -e "$VM_IMAGE"; then
echo "Creating $VM_IMAGE (${VMDISK_ROOTSIZE}M)"
Expand Down

0 comments on commit b33c687

Please sign in to comment.