socsvn commit: r272573 - in soc2014/kczekirda/pxe-fai-head: head/usr.sbin/bsdinstall/scripts others

kczekirda at FreeBSD.org kczekirda at FreeBSD.org
Sun Aug 17 21:36:18 UTC 2014


Author: kczekirda
Date: Sun Aug 17 21:36:17 2014
New Revision: 272573
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=272573

Log:
  zfsboot orderly

Modified:
  soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/script
  soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/zfsboot
  soc2014/kczekirda/pxe-fai-head/others/template.input

Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/script
==============================================================================
--- soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/script	Sun Aug 17 21:36:10 2014	(r272572)
+++ soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/script	Sun Aug 17 21:36:17 2014	(r272573)
@@ -189,7 +189,7 @@
 rm -f $PATH_FSTAB
 touch $PATH_FSTAB
 if [ "$ZFSBOOT" = "YES" ]; then
-	bsdinstall zfsboot "$SCRIPT"
+	bsdinstall zfsboot /tmp/bsdinstall-installscript-aa 
 else
 	bsdinstall scriptedpart "$PARTITIONS"
 fi

Modified: soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/zfsboot
==============================================================================
--- soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/zfsboot	Sun Aug 17 21:36:10 2014	(r272572)
+++ soc2014/kczekirda/pxe-fai-head/head/usr.sbin/bsdinstall/scripts/zfsboot	Sun Aug 17 21:36:17 2014	(r272573)
@@ -169,9 +169,15 @@
 #
 : ${ZFSBOOT_CONFIRM_LAYOUT:=1}
 
-############################################################ PRESSED
+############################################################ PRESEED
 
-[ -f "$1"] && . "$1"
+[ -f "$1" ] && . "$1"
+
+[ "$ZFSBOOT_GELI_ENCRYPTION" = "NO" ] && ZFSBOOT_GELI_ENCRYPTION=
+[ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" = "NO" ] && ZFSBOOT_GNOP_4K_FORCE_ALIGN=
+[ "$ZFSBOOT_SWAP_ENCRYPTION" = "NO" ] && ZFSBOOT_SWAP_ENCRYPTION=
+[ "$ZFSBOOT_SWAP_MIRROR" = "NO" ] && ZFSBOOT_SWAP_MIRROR=
+[ "$ZFSBOOT_BOOT_POOL" = "NO" ] && ZFSBOOT_BOOT_POOL=
 
 ############################################################ GLOBALS
 
@@ -1111,14 +1117,19 @@
 	# Create the geli(8) GEOMS
 	#
 	if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then
-		# Prompt user for password (twice)
-		if ! msg_enter_new_password="$msg_geli_password" \
-			f_dialog_input_password
-		then
-			f_dprintf "$funcname: User cancelled"
-			f_show_err "$msg_user_cancelled"
-			return $FAILURE
-		fi
+
+        if [ -z "$ZFSBOOT" ]; then
+		    # Prompt user for password (twice)
+		    if ! msg_enter_new_password="$msg_geli_password" \
+			    f_dialog_input_password
+		    then
+			    f_dprintf "$funcname: User cancelled"
+			    f_show_err "$msg_user_cancelled"
+			    return $FAILURE
+		    fi
+        else
+            pw_password=$ZFSBOOT_GELI_PW_PASSWORD
+        fi
 
 		# Initialize geli(8) on each of the target partitions
 		for disk in $disks; do
@@ -1393,7 +1404,7 @@
 # Loop over the main menu until we've accomplished what we came here to do
 #
 while :; do
-	if ! f_interactive || [ "$ZFSBOOT_PRESSED_CONFIRM" = "YES" ]; then
+	if ! f_interactive || [ "$ZFSBOOT_PRESEED_CONFIRM" = "YES" ]; then
 		retval=$DIALOG_OK
 		mtag=">>> $msg_install"
 	else
@@ -1457,7 +1468,7 @@
 		#
 		# Last Chance!
 		#
-		if f_interactive && [ ! $ZFSBOOT_PRESSED_CONFIRM ] ; then
+		if f_interactive && [ ! $ZFSBOOT_PRESEED_CONFIRM ] ; then
 			dialog_last_chance $ZFSBOOT_DISKS || continue
 		fi
 

Modified: soc2014/kczekirda/pxe-fai-head/others/template.input
==============================================================================
--- soc2014/kczekirda/pxe-fai-head/others/template.input	Sun Aug 17 21:36:10 2014	(r272572)
+++ soc2014/kczekirda/pxe-fai-head/others/template.input	Sun Aug 17 21:36:17 2014	(r272573)
@@ -10,12 +10,12 @@
 DISTRIBUTIONS="kernel.txz base.txz"
 INTERFACE="em0"
 IPV4="YES"
-DHCP="NO"
-ADDRESSV4="192.168.1.254"
-NETMASK="255.255.255.0"
-GWV4="192.168.1.1"
-IPV6="NO"
-SLAAC="YES"
+DHCP="YES"
+#ADDRESSV4="192.168.1.254"
+#NETMASK="255.255.255.0"
+#GWV4="192.168.1.1"
+#IPV6="NO"
+#SLAAC="YES"
 
 #ADDRESSV6="2001:db8:4672:6565:2026:5043:2d42:5344"
 #PREFIXV6="64"
@@ -27,115 +27,117 @@
 #DNS1V6="2001:4860:4860::8888"
 #DNS2V6="2001:4860:4860::8844"
 
-PARTITIONS="ada1 { auto freebsd-ufs /}"
-#ROOTPWHASH='$6$Qb2inVrU65.r4Dx5$DaHdU2P1ipFMLZ8J5xJk8DDtC88rE87qo7du6CBvNgyit8RezQ2qkPe83X4KgTCTEtXGrMaMKZ1.W4xg1yz0z/'
+#PARTITIONS="ada1 { auto freebsd-ufs /}"
+ROOTPWHASH='$6$Qb2inVrU65.r4Dx5$DaHdU2P1ipFMLZ8J5xJk8DDtC88rE87qo7du6CBvNgyit8RezQ2qkPe83X4KgTCTEtXGrMaMKZ1.W4xg1yz0z/'
 #USERS="/etc/usersconfig"
 
 ZFSBOOT="YES"
 
-# Default name of the boot-pool
-#
-#ZFSBOOT_POOL_NAME="zroot"
-#
-# Default options to use when creating zroot pool
-#
-#ZFSBOOT_POOL_CREATE_OPTIONS="-O compress=lz4 -O atime=off"
-#
-# Default name for the boot environment parent dataset
-#
-#ZFSBOOT_BEROOT_NAME="ROOT"
-#
-# Default name for the primany boot environment
-#
-#ZFSBOOT_BOOTFS_NAME="default"
-#
-# Default Virtual Device (vdev) type to create
+######################## ZFSPRESEED START
+
+# Virtual Device (vdev) type to create, possible options:
+# stripe - no redundancy, 
+# mirror - n-Way Mirroring, 
+# raidz1, raidz2, raidz3 - single, double, triple redundant RAID
 #
 ZFSBOOT_VDEV_TYPE="stripe"
 #
-# Should we use gnop(8) to configure a transparent mapping to 4K sectors?
+# disks to use 
 #
-#ZFSBOOT_GNOP_4K_FORCE_ALIGN="1"
+ZFSBOOT_DISKS="ada1"
 #
-# Should we use geli(8) to encrypt the drives?
-# NB: Automatically enables ZFSBOOT_BOOT_POOL
+
+########################  Options behind are defaults. 
+########################  Don't touch if you don't need
+
+# Pool name
+#                                                                                                                                       
+#ZFSBOOT_POOL_NAME="zroot"
+
+# Force 4K sectors? (YES or NO)
+#                                                                                                                                       
+#ZFSBOOT_GNOP_4K_FORCE_ALIGN="YES"
+
+# Encrypt Disks? (YES or NO)
 #
 #ZFSBOOT_GELI_ENCRYPTION=""
-#
-# Default path to the geli(8) keyfile used in drive encryption
-#
-#ZFSBOOT_GELI_KEY_FILE="/boot/encryption.key"
-#
-# Create a separate boot pool?
-# NB: Automatically set when using geli(8) or MBR
-#
-#ZFSBOOT_BOOT_POOL=""
-#
-# Options to use when creating separate boot pool (if any)
-#
-#ZFSBOOT_BOOT_POOL_CREATE_OPTIONS=""
-#
-# Default name for boot pool when enabled (e.g., geli(8) or MBR)
-#
-#ZFSBOOT_BOOT_POOL_NAME="bootpool"
-#
-# Default size for boot pool when enabled (e.g., geli(8) or MBR)
-#
-#ZFSBOOT_BOOT_POOL_SIZE="1g"
-#
-# Default disks to use (always empty unless being scripted)
-#
-ZFSBOOT_DISKS="ada1"
-#
-# Default partitioning scheme to use on disks
+
+# Partition scheme (GPT or MBR)
 #
 #ZFSBOOT_PARTITION_SCHEME="GPT"
+
+#  Swap size. Value passed to gpart(8); which supports SI unit suffixes.
 #
-# How much swap to put on each block device in the boot zpool
-# NOTE: Value passed to gpart(8); which supports SI unit suffixes.
-#
-#ZFSBOOT_SWAP_SIZE="0g"
-#
-# Should we use geli(8) to encrypt the swap?
+#ZFSBOOT_SWAP_SIZE="2g"
+
+# Encrypt the swap? (YES or NO)
 #
 #ZFSBOOT_SWAP_ENCRYPTION=""
+
+# Mirror the swap? (YES or NO)
 #
-# Should we use gmirror(8) to mirror the swap?
+#ZFSBOOT_SWAP_MIRROR="NO"
+
+######################## OTHERS
+
+# Options to use when creating zroot pool
 #
-#ZFSBOOT_SWAP_MIRROR=""
-# Default ZFS datasets for root zpool
+#ZFSBOOT_POOL_CREATE_OPTIONS="-O compress=lz4 -O atime=off"
+
+# Name for the boot environment parent dataset                                                                                  
 #
-# NOTE: Requires /tmp, /var/tmp, /$ZFSBOOT_BOOTFS_NAME/$ZFSBOOT_BOOTFS_NAME
-# NOTE: Anything after pound/hash character [#] is ignored as a comment.
+#ZFSBOOT_BEROOT_NAME="ROOT"
+
+# Name for the primany boot environment
+#
+#ZFSBOOT_BOOTFS_NAME="default"
+
+# ZFS datasets for root zpool                                                                                                           
 #
 #ZFSBOOT_DATASETS="
-#    # DATASET>--OPTIONS (comma or space separated; or both)
-#    # Boot Environment [BE] root and default boot dataset
 #    /$ZFSBOOT_BEROOT_NAME                mountpoint=none
 #    /$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME      mountpoint=/
-#    # Compress /tmp, allow exec but not setuid
 #    /tmp        mountpoint=/tmp,exec=on,setuid=off
-#    # Don't mount /usr so that 'base' files go to the BEROOT
 #    /usr    mountpoint=/usr,canmount=off
-#    # Home directories separated so they are common to all BEs
 #    /usr/home   # NB: /home is a symlink to /usr/home
-#    # Ports tree
 #    /usr/ports  setuid=off
-#    # Source tree (compressed)
 #    /usr/src
-#    # Create /var and friends
 #    /var    mountpoint=/var
 #    /var/crash  exec=off,setuid=off
 #    /var/log    exec=off,setuid=off
 #    /var/mail   atime=on
 #    /var/tmp    setuid=off
 #"
+
+# Path to the geli(8) keyfile used in drive encryption
+#
+#ZFSBOOT_GELI_KEY_FILE="/boot/encryption.key"
+
+# Create a separate boot pool? (YES or NO)
+# NB: Automatically set when using geli(8) or MBR
+#
+#ZFSBOOT_BOOT_POOL=""
+
+# Options to use when creating separate boot pool (if any)
+#
+#ZFSBOOT_BOOT_POOL_CREATE_OPTIONS=""
+
+# Default name for boot pool when enabled (e.g., geli(8) or MBR)
+#
+#ZFSBOOT_BOOT_POOL_NAME="bootpool"
+
+# Passphrase used to protect encryption keys !! SENSITIVE INFO !!
+# 
+# ZFSBOOT_GELI_PW_PASSWORD=""
+
 # If interactive and the user has not explicitly chosen a vdev type or disks,
 # make the user confirm scripted/default choices when proceeding to install.
 #
 ZFSBOOT_CONFIRM_LAYOUT=""
 
-ZFSBOOT_PRESSED_CONFIRM="YES"
+ZFSBOOT_PRESEED_CONFIRM="YES"
+
+######################## END ZFSPRESEED
 
 #!/bin/sh
 echo "Installation complete, running in host system"


More information about the svn-soc-all mailing list