summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Pau Monné <royger@FreeBSD.org>2017-05-22 11:38:39 +0000
committerRoger Pau Monné <royger@FreeBSD.org>2017-05-22 11:38:39 +0000
commit2f34d6c344eecdeb7932e95c84d129f042c85f12 (patch)
treea1af84b15c1928ae69d5bc6536abd2fa6d84da9d
parent477a40c74f51fb733dd1de9023151e94e85808f1 (diff)
Notes
-rwxr-xr-xusr.sbin/bsdinstall/scripts/script22
1 files changed, 18 insertions, 4 deletions
diff --git a/usr.sbin/bsdinstall/scripts/script b/usr.sbin/bsdinstall/scripts/script
index bb48873263e1..1145b201ed19 100755
--- a/usr.sbin/bsdinstall/scripts/script
+++ b/usr.sbin/bsdinstall/scripts/script
@@ -42,6 +42,11 @@ f_include $BSDCFG_SHARE/variable.subr
# DISTRIBUTIONS
# BSDINSTALL_DISTDIR
+#
+# Default name of the ZFS boot-pool
+#
+: ${ZFSBOOT_POOL_NAME:=zroot}
+
############################################################ GLOBALS
#
@@ -53,8 +58,6 @@ msg_installation_error="Installation Error!"
error()
{
- [ -f "$PATH_FSTAB" ] && bsdinstall umount
-
local file
f_getvar "$VAR_DEBUG_FILE#+" file
if [ "$file" ]; then
@@ -63,6 +66,13 @@ error()
# No need to restore title, pining for the fjords
fi
+ [ -f "$PATH_FSTAB" ] || exit
+ if [ "$ZFSBOOT_DISKS" ]; then
+ zpool export $ZFSBOOT_POOL_NAME
+ else
+ bsdinstall umount
+ fi
+
exit 1
}
@@ -99,8 +109,8 @@ if [ "$ZFSBOOT_DISKS" ]; then
bsdinstall zfsboot
else
bsdinstall scriptedpart "$PARTITIONS"
+ bsdinstall mount
fi
-bsdinstall mount
# Unpack distributions
bsdinstall checksum
@@ -125,7 +135,11 @@ if [ -f /tmp/bsdinstall-installscript-ab ]; then
fi
bsdinstall entropy
-bsdinstall umount
+if [ "$ZFSBOOT_DISKS" ]; then
+ zpool export $ZFSBOOT_POOL_NAME
+else
+ bsdinstall umount
+fi
f_dprintf "Installation Completed at %s" "$( date )"