Skip to content

Commit

Permalink
Move wipe_build_environement into main script
Browse files Browse the repository at this point in the history
Cause it contains no vm code.
  • Loading branch information
mlschroe committed Oct 31, 2016
1 parent fb4fc4d commit 44a9f6f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
19 changes: 18 additions & 1 deletion build
Expand Up @@ -89,7 +89,7 @@ REASON=
NOROOTFORBUILD=
LOGFILE=
KILL=
DO_WIPE=false
DO_WIPE=
CHANGELOG=
BUILD_DEBUG=
INCARNATION=
Expand Down Expand Up @@ -697,6 +697,23 @@ run_rsync() {
fi
}

wipe_build_environement() {
if test -n "$VM_TYPE"; then
vm_cleanup
else
echo "Wiping build root: '$BUILD_ROOT'"

# unmount all mounts still in the build root path
for m in $(cat /proc/mounts | grep "$BUILD_ROOT" | awk '{ print $2 }'); do
if ! umount -n "$m" 2>/dev/null ; then
echo "Failed to umount "$m", cannot wipe buildroot"
exit 1
fi
done
rm -rf "$BUILD_ROOT"
fi
}

#### main ####

trap fail_exit EXIT
Expand Down
18 changes: 0 additions & 18 deletions build-vm
Expand Up @@ -363,24 +363,6 @@ vm_img_mkfs() {
fi
}

wipe_build_environement() {
if test -n "$VM_TYPE"; then
vm_cleanup_$VM_TYPE "$@"
else
echo "Wiping build root: '$BUILD_ROOT'"

# unmount all mounts still in the build root path
for m in $(cat /proc/mounts | grep "$BUILD_ROOT" | awk '{ print $2 }'); do
if ! umount -n "$m" 2>/dev/null ; then
echo "Failed to umount "$m", cannot wipe buildroot"
exit 1
fi
done

rm -rf $BUILD_ROOT
fi
}

background_monitor_process() {
max_disk=0
max_mem=0
Expand Down

0 comments on commit 44a9f6f

Please sign in to comment.