svn commit: r319124 - stable/11/usr.sbin/bsdinstall/scripts

Roger Pau Monné royger at FreeBSD.org
Mon May 29 11:37:10 UTC 2017


Author: royger
Date: Mon May 29 11:37:08 2017
New Revision: 319124
URL: https://svnweb.freebsd.org/changeset/base/319124

Log:
  MFC r318632, r318633:
  
  bsdinstall: mount is not needed for the ZFS install case
  bsdinstall: do not use distextract in scripted mode

Modified:
  stable/11/usr.sbin/bsdinstall/scripts/script
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/bsdinstall/scripts/script
==============================================================================
--- stable/11/usr.sbin/bsdinstall/scripts/script	Mon May 29 11:16:59 2017	(r319123)
+++ stable/11/usr.sbin/bsdinstall/scripts/script	Mon May 29 11:37:08 2017	(r319124)
@@ -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 Err
 
 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
 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 )"
 


More information about the svn-src-stable mailing list