aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/bsdinstall
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2014-08-19 06:50:54 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2014-08-19 06:50:54 +0000
commitee7b0571c2c18bdec848ed2044223cc88db29bd8 (patch)
treeb04f4bd7cd887f50e7d98af35f46b9834ff86c80 /usr.sbin/bsdinstall
parentffda191e301f128a62c152fde92b692548367fca (diff)
parent15fc2873832ea5b9b639e701bbbf2e73af8b6a88 (diff)
downloadsrc-ee7b0571c2c18bdec848ed2044223cc88db29bd8.tar.gz
src-ee7b0571c2c18bdec848ed2044223cc88db29bd8.zip
Merge head from 7/28
Notes
Notes: svn path=/projects/bmake/; revision=270164
Diffstat (limited to 'usr.sbin/bsdinstall')
-rw-r--r--usr.sbin/bsdinstall/bsdinstall.83
-rw-r--r--usr.sbin/bsdinstall/distextract/Makefile14
-rw-r--r--usr.sbin/bsdinstall/distfetch/Makefile14
-rw-r--r--usr.sbin/bsdinstall/partedit/Makefile14
-rw-r--r--usr.sbin/bsdinstall/partedit/partedit_powerpc.c25
-rw-r--r--usr.sbin/bsdinstall/partedit/partedit_x86.c2
-rw-r--r--usr.sbin/bsdinstall/partedit/sade.85
-rwxr-xr-xusr.sbin/bsdinstall/scripts/mirrorselect1
-rwxr-xr-xusr.sbin/bsdinstall/scripts/zfsboot160
9 files changed, 157 insertions, 81 deletions
diff --git a/usr.sbin/bsdinstall/bsdinstall.8 b/usr.sbin/bsdinstall/bsdinstall.8
index b841c36df815..98bab0a52bad 100644
--- a/usr.sbin/bsdinstall/bsdinstall.8
+++ b/usr.sbin/bsdinstall/bsdinstall.8
@@ -367,5 +367,4 @@ This version of
first appeared in
.Fx 9.0 .
.Sh AUTHORS
-.An -nosplit
-.An Nathan Whitehorn Aq nwhitehorn@FreeBSD.org
+.An Nathan Whitehorn Aq Mt nwhitehorn@FreeBSD.org
diff --git a/usr.sbin/bsdinstall/distextract/Makefile b/usr.sbin/bsdinstall/distextract/Makefile
index e359bba590e5..f84c4d744a37 100644
--- a/usr.sbin/bsdinstall/distextract/Makefile
+++ b/usr.sbin/bsdinstall/distextract/Makefile
@@ -2,20 +2,10 @@
BINDIR= /usr/libexec/bsdinstall
PROG= distextract
-DPADD= ${LIBARCHIVE} ${LIBDIALOG} ${LIBM}
-LDADD= -larchive -ldialog -lm
+DPADD= ${LIBARCHIVE} ${LIBNCURSESW} ${LIBDIALOG} ${LIBM}
+LDADD= -larchive -lncursesw -ldialog -lm
WARNS?= 6
MAN=
-.include <src.opts.mk>
-
-.if ${MK_NCURSESW} == "no"
-DPADD+= ${LIBNCURSES}
-LDADD+= -lncurses
-.else
-DPADD+= ${LIBNCURSESW}
-LDADD+= -lncursesw
-.endif
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdinstall/distfetch/Makefile b/usr.sbin/bsdinstall/distfetch/Makefile
index 2ac9eb611b73..ed1f5996ec58 100644
--- a/usr.sbin/bsdinstall/distfetch/Makefile
+++ b/usr.sbin/bsdinstall/distfetch/Makefile
@@ -2,20 +2,10 @@
BINDIR= /usr/libexec/bsdinstall
PROG= distfetch
-DPADD= ${LIBFETCH} ${LIBDIALOG} ${LIBM}
-LDADD= -lfetch -ldialog -lm
+DPADD= ${LIBFETCH} ${LIBNCURSESW} ${LIBDIALOG} ${LIBM}
+LDADD= -lfetch -lncursesw -ldialog -lm
WARNS?= 6
MAN=
-.include <src.opts.mk>
-
-.if ${MK_NCURSESW} == "no"
-DPADD+= ${LIBNCURSES}
-LDADD+= -lncurses
-.else
-DPADD+= ${LIBNCURSESW}
-LDADD+= -lncursesw
-.endif
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdinstall/partedit/Makefile b/usr.sbin/bsdinstall/partedit/Makefile
index 328259c1ec11..fb758884a572 100644
--- a/usr.sbin/bsdinstall/partedit/Makefile
+++ b/usr.sbin/bsdinstall/partedit/Makefile
@@ -5,8 +5,8 @@ PROG= partedit
LINKS= ${BINDIR}/partedit ${BINDIR}/autopart \
${BINDIR}/partedit ${BINDIR}/scriptedpart
SYMLINKS= ${BINDIR}/partedit /usr/sbin/sade
-DPADD= ${LIBGEOM} ${LIBUTIL} ${LIBDIALOG} ${LIBM}
-LDADD= -lgeom -lutil -ldialog -lm
+DPADD= ${LIBGEOM} ${LIBNCURSESW} ${LIBUTIL} ${LIBDIALOG} ${LIBM}
+LDADD= -lgeom -lncursesw -lutil -ldialog -lm
PARTEDIT_ARCH= ${MACHINE}
.if ${MACHINE} == "i386" || ${MACHINE} == "amd64"
@@ -22,14 +22,4 @@ SRCS= diskeditor.c partedit.c gpart_ops.c partedit_${PARTEDIT_ARCH}.c \
WARNS?= 3
MAN= sade.8
-.include <src.opts.mk>
-
-.if ${MK_NCURSESW} == "no"
-DPADD+= ${LIBNCURSES}
-LDADD+= -lncurses
-.else
-DPADD+= ${LIBNCURSESW}
-LDADD+= -lncursesw
-.endif
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdinstall/partedit/partedit_powerpc.c b/usr.sbin/bsdinstall/partedit/partedit_powerpc.c
index 4fa2e0530e28..77c682a6b94d 100644
--- a/usr.sbin/bsdinstall/partedit/partedit_powerpc.c
+++ b/usr.sbin/bsdinstall/partedit/partedit_powerpc.c
@@ -60,7 +60,8 @@ is_scheme_bootable(const char *part_type) {
if (strcmp(platform, "ps3") == 0 && strcmp(part_type, "GPT") == 0)
return (1);
if (strcmp(platform, "chrp") == 0 &&
- (strcmp(part_type, "MBR") == 0 || strcmp(part_type, "BSD") == 0))
+ (strcmp(part_type, "MBR") == 0 || strcmp(part_type, "BSD") == 0 ||
+ strcmp(part_type, "GPT") == 0))
return (1);
return (0);
@@ -68,13 +69,28 @@ is_scheme_bootable(const char *part_type) {
size_t
bootpart_size(const char *part_type) {
+ size_t platlen = sizeof(platform);
+ if (strlen(platform) == 0)
+ sysctlbyname("hw.platform", platform, &platlen, NULL, -1);
+
if (strcmp(part_type, "APM") == 0 || strcmp(part_type, "MBR") == 0)
return (800*1024);
+ if (strcmp(platform, "chrp") == 0 && strcmp(part_type, "GPT") == 0)
+ return (800*1024);
return (0);
}
const char *
bootpart_type(const char *scheme) {
+ size_t platlen = sizeof(platform);
+ if (strlen(platform) == 0)
+ sysctlbyname("hw.platform", platform, &platlen, NULL, -1);
+
+ if (strcmp(platform, "chrp") == 0)
+ return ("prep-boot");
+ if (strcmp(platform, "powermac") == 0)
+ return ("apple-boot");
+
return ("freebsd-boot");
}
@@ -85,9 +101,14 @@ bootcode_path(const char *part_type) {
const char *
partcode_path(const char *part_type) {
+ size_t platlen = sizeof(platform);
+ if (strlen(platform) == 0)
+ sysctlbyname("hw.platform", platform, &platlen, NULL, -1);
+
if (strcmp(part_type, "APM") == 0)
return ("/boot/boot1.hfs");
- if (strcmp(part_type, "MBR") == 0)
+ if (strcmp(part_type, "MBR") == 0 ||
+ (strcmp(platform, "chrp") == 0 && strcmp(part_type, "GPT") == 0))
return ("/boot/boot1.elf");
return (NULL);
}
diff --git a/usr.sbin/bsdinstall/partedit/partedit_x86.c b/usr.sbin/bsdinstall/partedit/partedit_x86.c
index 156674bda0d4..b458475fe6c6 100644
--- a/usr.sbin/bsdinstall/partedit/partedit_x86.c
+++ b/usr.sbin/bsdinstall/partedit/partedit_x86.c
@@ -69,7 +69,7 @@ bootpart_size(const char *scheme) {
return (0);
if (strcmp(platform, "BIOS") == 0)
- return (64*1024);
+ return (512*1024);
else
return (800*1024);
diff --git a/usr.sbin/bsdinstall/partedit/sade.8 b/usr.sbin/bsdinstall/partedit/sade.8
index 441ddc02ab90..79df079e371b 100644
--- a/usr.sbin/bsdinstall/partedit/sade.8
+++ b/usr.sbin/bsdinstall/partedit/sade.8
@@ -64,12 +64,11 @@ installer. It was replaced in
with the equivalent part of
.Xr bsdinstall 8 .
.Sh AUTHORS
-.An Nathan Whitehorn Aq nwhitehorn@FreeBSD.org
+.An Nathan Whitehorn Aq Mt nwhitehorn@FreeBSD.org
.Sh BUGS
The utility misses a lot of nice features, such as tools for
manipulating
.Xr gmirror 8
or
-.Xr zfs 8
-.
+.Xr zfs 8 .
These will be added later.
diff --git a/usr.sbin/bsdinstall/scripts/mirrorselect b/usr.sbin/bsdinstall/scripts/mirrorselect
index ef17cfe61a2c..af87f443653b 100755
--- a/usr.sbin/bsdinstall/scripts/mirrorselect
+++ b/usr.sbin/bsdinstall/scripts/mirrorselect
@@ -158,6 +158,7 @@ MIRROR_BUTTON=$?
exec 3>&-
_UNAME_R=`uname -r`
+_UNAME_R=${_UNAME_R%-p*}
case ${_UNAME_R} in
*-CURRENT|*-STABLE|*-PRERELEASE)
diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot
index f5656550027a..9f1abb8b2f2c 100755
--- a/usr.sbin/bsdinstall/scripts/zfsboot
+++ b/usr.sbin/bsdinstall/scripts/zfsboot
@@ -45,6 +45,11 @@ f_include $BSDCFG_SHARE/variable.subr
: ${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}
@@ -82,6 +87,11 @@ f_include $BSDCFG_SHARE/variable.subr
: ${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}
@@ -108,6 +118,16 @@ f_include $BSDCFG_SHARE/variable.subr
: ${ZFSBOOT_SWAP_SIZE:=2g}
#
+# Should we use geli(8) to encrypt the swap?
+#
+: ${ZFSBOOT_SWAP_ENCRYPTION=}
+
+#
+# Should we use gmirror(8) to mirror the swap?
+#
+: ${ZFSBOOT_SWAP_MIRROR=}
+
+#
# Default ZFS datasets for root zpool
#
# NOTE: Requires /tmp, /var/tmp, /$ZFSBOOT_BOOTFS_NAME/$ZFSBOOT_BOOTFS_NAME
@@ -121,7 +141,7 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATASETS="
/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME mountpoint=/
# Compress /tmp, allow exec but not setuid
- /tmp mountpoint=/tmp,compression=lz4,exec=on,setuid=off
+ /tmp mountpoint=/tmp,exec=on,setuid=off
# Don't mount /usr so that 'base' files go to the BEROOT
/usr mountpoint=/usr,canmount=off
@@ -130,17 +150,17 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATASETS="
/usr/home # NB: /home is a symlink to /usr/home
# Ports tree
- /usr/ports compression=lz4,setuid=off
+ /usr/ports setuid=off
# Source tree (compressed)
- /usr/src compression=lz4,exec=off,setuid=off
+ /usr/src
# Create /var and friends
/var mountpoint=/var
- /var/crash compression=lz4,exec=off,setuid=off
- /var/log compression=lz4,exec=off,setuid=off
- /var/mail compression=lz4,atime=on
- /var/tmp compression=lz4,exec=on,setuid=off
+ /var/crash exec=off,setuid=off
+ /var/log exec=off,setuid=off
+ /var/mail atime=on
+ /var/tmp setuid=off
" # END-QUOTE
#
@@ -184,6 +204,7 @@ MOUNT_TYPE='mount -t %s "%s" "%s"'
PRINTF_CONF="printf '%s=\"%%s\"\\\n' %s >> \"%s\""
PRINTF_FSTAB='printf "$FSTAB_FMT" "%s" "%s" "%s" "%s" "%s" "%s" >> "%s"'
SHELL_TRUNCATE=':> "%s"'
+SWAP_GMIRROR_LABEL='gmirror label swap %s'
UMOUNT='umount "%s"'
ZFS_CREATE_WITH_OPTIONS='zfs create %s "%s"'
ZFS_SET='zfs set "%s" "%s"'
@@ -209,6 +230,8 @@ msg_configure_options="Configure Options:"
msg_detailed_disk_info="gpart(8) show %s:\n%s\n\ncamcontrol(8) inquiry %s:\n%s\n\n\ncamcontrol(8) identify %s:\n%s\n"
msg_disk_info="Disk Info"
msg_disk_info_help="Get detailed information on disk device(s)"
+msg_disk_singular="disk"
+msg_disk_plural="disks"
msg_encrypt_disks="Encrypt Disks?"
msg_encrypt_disks_help="Use geli(8) to encrypt all data partitions"
msg_error="Error"
@@ -263,6 +286,10 @@ msg_select_a_disk_device="Select a disk device"
msg_select_virtual_device_type="Select Virtual Device type:"
msg_stripe_desc="Stripe - No Redundancy"
msg_stripe_help="[1+ Disks] Striping provides maximum storage but no redundancy"
+msg_swap_encrypt="Encrypt Swap?"
+msg_swap_encrypt_help="Encrypt swap partitions with temporary keys, discarded on reboot"
+msg_swap_mirror="Mirror Swap?"
+msg_swap_mirror_help="Mirror swap partitions for redundancy, breaks crash dumps"
msg_swap_size="Swap Size"
msg_swap_size_help="Customize how much swap space is allocated to each selected disk"
msg_these_disks_are_too_small="These disks are too small given the amount of requested\nswap (%s) and/or geli(8) (%s) partitions, which would\ntake 50%% or more of each of the following selected disk\ndevices (not recommended):\n\n %s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of devices."
@@ -285,15 +312,20 @@ dialog_menu_main()
local prompt="$msg_configure_options"
local force4k="$msg_no"
local usegeli="$msg_no"
+ local swapgeli="$msg_no"
+ local swapmirror="$msg_no"
[ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ] && force4k="$msg_yes"
[ "$ZFSBOOT_GELI_ENCRYPTION" ] && usegeli="$msg_yes"
- local disks n
+ [ "$ZFSBOOT_SWAP_ENCRYPTION" ] && swapgeli="$msg_yes"
+ [ "$ZFSBOOT_SWAP_MIRROR" ] && swapmirror="$msg_yes"
+ local disks n disks_grammar
f_count n $ZFSBOOT_DISKS
- { [ $n -eq 1 ] && disks=disk; } || disks=disks # grammar
+ { [ $n -eq 1 ] && disks_grammar=$msg_disk_singular; } ||
+ disks_grammar=$msg_disk_plural # grammar
local menu_list="
'>>> $msg_install' '$msg_install_desc'
'$msg_install_help'
- 'T $msg_pool_type_disks' '$ZFSBOOT_VDEV_TYPE: $n $disks'
+ 'T $msg_pool_type_disks' '$ZFSBOOT_VDEV_TYPE: $n $disks_grammar'
'$msg_pool_type_disks_help'
'- $msg_rescan_devices' '*'
'$msg_rescan_devices_help'
@@ -309,6 +341,10 @@ dialog_menu_main()
'$msg_partition_scheme_help'
'S $msg_swap_size' '$ZFSBOOT_SWAP_SIZE'
'$msg_swap_size_help'
+ 'M $msg_swap_mirror' '$swapmirror'
+ '$msg_swap_mirror_help'
+ 'W $msg_swap_encrypt' '$swapgeli'
+ '$msg_swap_encrypt_help'
" # END-QUOTE
local defaultitem= # Calculated below
local hline="$hline_alnum_arrows_punc_tab_enter"
@@ -747,14 +783,14 @@ zfs_create_diskpart()
return $FAILURE
# NB: zpool will use the `zfs#' GPT labels
- bootpart=p2 targetpart=p2
+ bootpart=p2 swappart=p2 targetpart=p2
[ ${swapsize:-0} -gt 0 ] && targetpart=p3
#
# Prepare boot pool if enabled (e.g., for geli(8))
#
if [ "$ZFSBOOT_BOOT_POOL" ]; then
- bootpart=p2 targetpart=p3
+ bootpart=p2 swappart=p3 targetpart=p3
[ ${swapsize:-0} -gt 0 ] && targetpart=p4
f_eval_catch $funcname gpart \
"$GPART_ADD_LABEL_WITH_SIZE" boot$index \
@@ -781,12 +817,7 @@ zfs_create_diskpart()
return $FAILURE
# Pedantically nuke any old labels on the swap
f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \
- /dev/gpt/swap$index
- # Update fstab(5)
- f_eval_catch $funcname printf "$PRINTF_FSTAB" \
- /dev/gpt/swap$index none swap sw 0 0 \
- $BSDINSTALL_TMPETC/fstab ||
- return $FAILURE
+ /dev/$disk$swappart
fi
#
@@ -827,7 +858,7 @@ zfs_create_diskpart()
return $FAILURE
# NB: zpool will use s1a (no labels)
- bootpart=s1a targetpart=s1d mbrindex=4
+ bootpart=s1a swappart=s1b targetpart=s1d mbrindex=4
#
# Always prepare a boot pool on MBR
@@ -858,11 +889,6 @@ zfs_create_diskpart()
# Pedantically nuke any old labels on the swap
f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \
/dev/${disk}s1b
- # Update fstab(5)
- f_eval_catch $funcname printf "$PRINTF_FSTAB" \
- /dev/${disk}s1b none swap sw 0 0 \
- $BSDINSTALL_TMPETC/fstab ||
- return $FAILURE
fi
#
@@ -879,6 +905,33 @@ zfs_create_diskpart()
esac # $ZFSBOOT_PARTITION_SCHEME
+ # Update fstab(5)
+ if [ "$isswapmirror" ]; then
+ # This is not the first disk in the mirror, do nothing
+ elif [ "$ZFSBOOT_SWAP_ENCRYPTION" -a "$ZFSBOOT_SWAP_MIRROR" ]; then
+ f_eval_catch $funcname printf "$PRINTF_FSTAB" \
+ /dev/mirror/swap.eli none swap sw 0 0 \
+ $BSDINSTALL_TMPETC/fstab ||
+ return $FAILURE
+ isswapmirror=1
+ elif [ "$ZFSBOOT_SWAP_MIRROR" ]; then
+ f_eval_catch $funcname printf "$PRINTF_FSTAB" \
+ /dev/mirror/swap none swap sw 0 0 \
+ $BSDINSTALL_TMPETC/fstab ||
+ return $FAILURE
+ isswapmirror=1
+ elif [ "$ZFSBOOT_SWAP_ENCRYPTION" ]; then
+ f_eval_catch $funcname printf "$PRINTF_FSTAB" \
+ /dev/$disk${swappart}.eli none swap sw 0 0 \
+ $BSDINSTALL_TMPETC/fstab ||
+ return $FAILURE
+ else
+ f_eval_catch $funcname printf "$PRINTF_FSTAB" \
+ /dev/$disk$swappart none swap sw 0 0 \
+ $BSDINSTALL_TMPETC/fstab ||
+ return $FAILURE
+ fi
+
return $SUCCESS
}
@@ -893,10 +946,13 @@ zfs_create_boot()
local zroot_name="$1"
local zroot_vdevtype="$2"
local zroot_vdevs= # Calculated below
+ local swap_devs= # Calculated below
local boot_vdevs= # Used for geli(8) and/or MBR layouts
shift 2 # poolname vdev_type
local disks="$*" disk
- local bootpart targetpart # Set by zfs_create_diskpart() below
+ local isswapmirror
+ local bootpart targetpart swappart # Set by zfs_create_diskpart() below
+ local create_options
#
# Pedantic checks; should never be seen
@@ -968,7 +1024,8 @@ zfs_create_boot()
local n=0
for disk in $disks; do
zfs_create_diskpart $disk $n || return $FAILURE
- # Now $bootpart and $targetpart are set (suffix for $disk)
+ # Now $bootpart, $targetpart, and $swappart are set (suffix
+ # for $disk)
# Forced 4k alignment support using Geom NOP (see gnop(8))
if [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ]; then
@@ -1020,7 +1077,9 @@ zfs_create_boot()
f_count nvdevs $boot_vdevs
[ $nvdevs -gt 1 ] && bootpool_vdevtype=mirror
+ create_options="$ZFSBOOT_BOOT_POOL_CREATE_OPTIONS"
bootpool_options="-o altroot=$BSDINSTALL_CHROOT"
+ bootpool_options="$bootpool_options $create_options"
bootpool_options="$bootpool_options -m \"/$bootpool_name\" -f"
f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \
"$bootpool_options" "$bootpool_name" \
@@ -1087,23 +1146,26 @@ zfs_create_boot()
return $FAILURE
f_eval_catch -d $funcname umount "$UMOUNT" /mnt # tmpfs
fi
+ #
+ # Create the gmirror(8) GEOMS for swap
+ #
+ if [ "$ZFSBOOT_SWAP_MIRROR" ]; then
+ for disk in $disks; do
+ swap_devs="$swap_devs $disk$swappart"
+ done
+ f_eval_catch $funcname gmirror "$SWAP_GMIRROR_LABEL" \
+ "$swap_devs" || return $FAILURE
+ fi
#
# Create the ZFS root pool with desired type and disk devices
#
f_dprintf "$funcname: Creating root pool..."
+ create_options="$ZFSBOOT_POOL_CREATE_OPTIONS"
f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \
- "-o altroot=$BSDINSTALL_CHROOT -m none -f" \
- "$zroot_name" "$zroot_vdevtype" "$zroot_vdevs" ||
- return $FAILURE
-
- # Customize the zroot a bit...
- local option
- f_dprintf "$funcname: Setting miscellaneous options on root pool..."
- for option in atime=off; do
- f_eval_catch $funcname zfs "$ZFS_SET" $option "$zroot_name" ||
- return $FAILURE
- done
+ "-o altroot=$BSDINSTALL_CHROOT $create_options -m none -f" \
+ "$zroot_name" "$zroot_vdevtype" "$zroot_vdevs" ||
+ return $FAILURE
#
# Create ZFS dataset layout within the new root pool
@@ -1215,6 +1277,14 @@ zfs_create_boot()
f_eval_catch $funcname echo "$ECHO_APPEND" \
'kern.geom.label.disk_ident.enable=\"0\"' \
$BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE
+ f_eval_catch $funcname echo "$ECHO_APPEND" \
+ 'kern.geom.label.gptid.enable=\"0\"' \
+ $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE
+
+ if [ "$ZFSBOOT_SWAP_MIRROR" ]; then
+ f_eval_catch $funcname echo "$ECHO_APPEND" 'geom_mirror_load=\"YES\"' \
+ $BSDINSTALL_TMPBOOT/loader.conf.gmirror || return $FAILURE
+ fi
# We're all done unless we should go on for boot pool
[ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS
@@ -1448,6 +1518,22 @@ while :; do
"$ZFSBOOT_SWAP_SIZE" &&
ZFSBOOT_SWAP_SIZE="${input:-0}"
;;
+ ?" $msg_swap_mirror")
+ # Toggle the variable referenced both by the menu and later
+ if [ "$ZFSBOOT_SWAP_MIRROR" ]; then
+ ZFSBOOT_SWAP_MIRROR=
+ else
+ ZFSBOOT_SWAP_MIRROR=1
+ fi
+ ;;
+ ?" $msg_swap_encrypt")
+ # Toggle the variable referenced both by the menu and later
+ if [ "$ZFSBOOT_SWAP_ENCRYPTION" ]; then
+ ZFSBOOT_SWAP_ENCRYPTION=
+ else
+ ZFSBOOT_SWAP_ENCRYPTION=1
+ fi
+ ;;
esac
done