summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdinstall
diff options
context:
space:
mode:
authorroyger <royger@FreeBSD.org>2017-05-29 11:37:08 +0000
committerroyger <royger@FreeBSD.org>2017-05-29 11:37:08 +0000
commitc11bd573da4a63058beea47d7ae227e6c9e39cb6 (patch)
tree8cec05ee241f69dfd09b4772697e256c7b3d4cd9 /usr.sbin/bsdinstall
parent596e393e206fc34af6280cabd17ea693c40f1eeb (diff)
downloadFreeBSD-src-c11bd573da4a63058beea47d7ae227e6c9e39cb6.zip
FreeBSD-src-c11bd573da4a63058beea47d7ae227e6c9e39cb6.tar.gz
MFC r318632, r318633:
bsdinstall: mount is not needed for the ZFS install case bsdinstall: do not use distextract in scripted mode
Diffstat (limited to 'usr.sbin/bsdinstall')
-rwxr-xr-xusr.sbin/bsdinstall/scripts/script27
1 files changed, 22 insertions, 5 deletions
diff --git a/usr.sbin/bsdinstall/scripts/script b/usr.sbin/bsdinstall/scripts/script
index bb48873..bb295b4 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,12 +109,15 @@ if [ "$ZFSBOOT_DISKS" ]; then
bsdinstall zfsboot
else
bsdinstall scriptedpart "$PARTITIONS"
+ bsdinstall mount
fi
-bsdinstall mount
# Unpack distributions
bsdinstall checksum
-bsdinstall distextract
+for set in $DISTRIBUTIONS; do
+ f_dprintf "Extracting $BSDINSTALL_DISTDIR/$set"
+ tar -xf "$BSDINSTALL_DISTDIR/$set" -C $BSDINSTALL_CHROOT
+done
# Finalize install
bsdinstall config
@@ -125,7 +138,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 )"
OpenPOWER on IntegriCloud