aboutsummaryrefslogtreecommitdiffstats
path: root/testing/scripts/build-umlrootfs
diff options
context:
space:
mode:
authorReto Buerki <reet@codelabs.ch>2012-12-06 19:26:48 +0100
committerTobias Brunner <tobias@strongswan.org>2013-01-17 15:22:11 +0100
commit0cc40637997984029dbcc47234b47c5da8ea0cd2 (patch)
tree7f6c34994634538d9cd0aa1c65fa6e17c09d297c /testing/scripts/build-umlrootfs
parent9a045eef8e003b46fb93369a7888d65b01730a1d (diff)
downloadstrongswan-0cc40637997984029dbcc47234b47c5da8ea0cd2.tar.bz2
strongswan-0cc40637997984029dbcc47234b47c5da8ea0cd2.tar.xz
Use do_on_exit() in build scripts for cleanup
Diffstat (limited to 'testing/scripts/build-umlrootfs')
-rwxr-xr-xtesting/scripts/build-umlrootfs9
1 files changed, 4 insertions, 5 deletions
diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs
index 6c67a2534..a93adac4c 100755
--- a/testing/scripts/build-umlrootfs
+++ b/testing/scripts/build-umlrootfs
@@ -41,6 +41,10 @@ mkdir -p $LOOPDIR/root/compile
log_action "Mounting $ROOTFSCOMPILEDIR as /root/compile"
execute "mount -o bind $ROOTFSCOMPILEDIR $LOOPDIR/root/compile"
+do_on_exit umount $LOOPDIR/root/compile
+do_on_exit umount $LOOPDIR/proc
+do_on_exit umount $LOOPDIR
+
echo "Installing software from source"
RECPDIR=$UMLTESTDIR/testing/scripts/recipes
RECIPES=`ls $RECPDIR/*.mk | xargs -n1 basename`
@@ -52,8 +56,6 @@ do
execute_chroot "make SWANVERSION=$SWANVERSION -C /root/compile -f $r"
done
-umount $LOOPDIR/root/compile
-
log_action "Setting up shared build tree at /root/compile"
echo "" >> $LOOPDIR/etc/fstab
echo "none /root/compile hostfs $ROOTFSCOMPILEDIR" >> $LOOPDIR/etc/fstab
@@ -61,6 +63,3 @@ log_status 0
log_action "Removing /etc/resolv.conf"
execute "rm -f $LOOPDIR/etc/resolv.conf"
-
-execute "umount $LOOPDIR/proc" 0
-execute "umount $LOOPDIR" 0