mkdir -p $APTCACHE
execute "mount -o bind $CACHEDIR $APTCACHE"
+do_on_exit umount -l $APTCACHE
+do_on_exit umount -l $LOOPDIR
+
log_action "Running debootstrap ($ROOTFSSUITE, $ROOTFSARCH)"
execute "debootstrap --arch=$ROOTFSARCH --include=$PACKAGES $ROOTFSSUITE $LOOPDIR $ROOTFSMIRROR"
log_action "Disabling service $service"
execute_chroot "update-rc.d -f $service remove"
done
-
-execute "umount -l $APTCACHE" 0
-execute "umount -l $LOOPDIR" 0
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`
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
log_action "Removing /etc/resolv.conf"
execute "rm -f $LOOPDIR/etc/resolv.conf"
-
-execute "umount $LOOPDIR/proc" 0
-execute "umount $LOOPDIR" 0