aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/bsdinstall/scripts/auto
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2017-02-08 17:03:52 +0000
committerRenato Botelho <garga@FreeBSD.org>2017-02-08 17:03:52 +0000
commit371ce0ebc28f8c3fa424c34cd72cf44a55642785 (patch)
tree08aea0036a80971e537da189614f3139e5e80bc2 /usr.sbin/bsdinstall/scripts/auto
parent19d4720b1e6b0d0c9124874a731953433e0ff714 (diff)
downloadsrc-371ce0ebc28f8c3fa424c34cd72cf44a55642785.tar.gz
src-371ce0ebc28f8c3fa424c34cd72cf44a55642785.zip
bsdinstall: Make sure chroot filesystems are umounted after use
* DISTDIR_IS_UNIONFS is set every time BSDINSTALL_DISTDIR is mounted inside BSDINSTALL_CHROOT. Use this flag to decide if it needs to be umounted * BSDINSTALL_CHROOT/dev is mounted when 'bsdinstall mount' is called, there is no need to mount it again when user goes to shell after installation Reviewed by: allanjude Obtained from: pfSense MFC after: 1 week Sponsored by: Rubicon Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D8573
Notes
Notes: svn path=/head/; revision=313448
Diffstat (limited to 'usr.sbin/bsdinstall/scripts/auto')
-rwxr-xr-xusr.sbin/bsdinstall/scripts/auto7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto
index 61b2193b43f4..254daa23280e 100755
--- a/usr.sbin/bsdinstall/scripts/auto
+++ b/usr.sbin/bsdinstall/scripts/auto
@@ -449,9 +449,11 @@ finalconfig
trap error SIGINT # SIGINT is bad again
bsdinstall config || error "Failed to save config"
+if [ -n "$DISTDIR_IS_UNIONFS" ]; then
+ umount -f $BSDINSTALL_DISTDIR
+fi
+
if [ ! -z "$BSDINSTALL_FETCHDEST" ]; then
- [ "$BSDINSTALL_FETCHDEST" != "$BSDINSTALL_DISTDIR" ] && \
- umount "$BSDINSTALL_DISTDIR"
rm -rf "$BSDINSTALL_FETCHDEST"
fi
@@ -460,7 +462,6 @@ dialog --backtitle "FreeBSD Installer" --title "Manual Configuration" \
"The installation is now finished. Before exiting the installer, would you like to open a shell in the new system to make any final manual modifications?" 0 0
if [ $? -eq 0 ]; then
clear
- mount -t devfs devfs "$BSDINSTALL_CHROOT/dev"
echo This shell is operating in a chroot in the new system. \
When finished making configuration changes, type \"exit\".
chroot "$BSDINSTALL_CHROOT" /bin/sh 2>&1