Lines Matching +full:user +full:- +full:selected

2 #-
3 # Copyright (c) 2013-2016 Allan Jude
4 # Copyright (c) 2013-2018 Devin Teske
42 # Default name of the boot-pool
54 : ${ZFSBOOT_POOL_CREATE_OPTIONS:=-O compress=lz4 -O atime=off}
174 " # END-QUOTE
177 # If interactive and the user has not explicitly chosen a vdev type or disks,
178 # make the user confirm scripted/default choices when proceeding to install.
197 GELI_ATTACH='geli attach -j - -k "%s" "%s"'
198 GELI_ATTACH_NOKEY='geli attach -j - "%s"'
199 GELI_DETACH_F='geli detach -f "%s"'
200 GELI_PASSWORD_INIT='geli init -b -B "%s" -e %s -J - -K "%s" -l 256 -s 4096 "%s"'
201 GELI_PASSWORD_GELIBOOT_INIT='geli init -bg -e %s -J - -l 256 -s 4096 "%s"'
202 GPART_ADD_ALIGN='gpart add %s -t %s "%s"'
203 GPART_ADD_ALIGN_INDEX='gpart add %s -i %s -t %s "%s"'
204 GPART_ADD_ALIGN_INDEX_WITH_SIZE='gpart add %s -i %s -t %s -s %s "%s"'
205 GPART_ADD_ALIGN_LABEL='gpart add %s -l %s -t %s "%s"'
206 GPART_ADD_ALIGN_LABEL_WITH_SIZE='gpart add %s -l %s -t %s -s %s "%s"'
207 GPART_BOOTCODE='gpart bootcode -b "%s" "%s"'
208 GPART_BOOTCODE_PART='gpart bootcode -b "%s" -p "%s" -i %s "%s"'
209 GPART_BOOTCODE_PARTONLY='gpart bootcode -p "%s" -i %s "%s"'
210 GPART_CREATE='gpart create -s %s "%s"'
211 GPART_DESTROY_F='gpart destroy -F "%s"'
212 GPART_SET_ACTIVE='gpart set -a active -i %s "%s"'
213 GPART_SET_LENOVOFIX='gpart set -a lenovofix "%s"'
214 GPART_SET_PMBR_ACTIVE='gpart set -a active "%s"'
217 LN_SF='ln -sf "%s" "%s"'
218 MKDIR_P='mkdir -p "%s"'
219 MOUNT_TYPE='mount -t %s "%s" "%s"'
234 ZPOOL_EXPORT_F='zpool export -f "%s"'
236 ZPOOL_LABELCLEAR_F='zpool labelclear -f "%s"'
262 msg_geli_setup="Initializing encryption on selected disks,\n this will take several seconds per dis…
274 msg_mirror_desc="Mirror - n-Way Mirroring"
280 msg_no_disks_selected="No disks selected."
281 msg_not_enough_disks_selected="Not enough disks selected. (%u < %u minimum)"
285 msg_odd_disk_selected="An even number of disks must be selected to create a RAID 1+0. (%u selected)"
290 msg_please_enter_amount_of_swap_space="Please enter amount of swap space (SI-Unit suffixes\nrecomme…
298 msg_raid10_desc="RAID 1+0 - n x 2-Way Mirrors"
300 msg_raidz1_desc="RAID-Z1 - Single Redundant RAID"
302 msg_raidz2_desc="RAID-Z2 - Double Redundant RAID"
304 msg_raidz3_desc="RAID-Z3 - Triple Redundant RAID"
311 msg_stripe_desc="Stripe - No Redundancy"
315 msg_swap_invalid="The selected swap size (%s) is invalid. Enter a number optionally followed by uni…
319 msg_swap_size_help="Customize how much swap space is allocated to each selected disk"
320 msg_swap_toosmall="The selected swap size (%s) is too small. Please enter a value greater than 100M…
321 …s) partitions, which would\ntake 100%% or more of each of the following selected disks:\n\n %s\n\…
324 msg_user_cancelled="User Cancelled."
332 # Display the dialog(1)-based application main menu.
349 { [ $n -eq 1 ] && disks_grammar=$msg_disk_singular; } ||
357 '- $msg_rescan_devices' '*'
359 '- $msg_disk_info' '*'
377 " # END-QUOTE
385 # Obtain default-item from previously stored selection
390 --title \"\$title\" \
391 --backtitle \"\$btitle\" \
392 --hline \"\$hline\" \
393 --item-help \
394 --ok-label \"\$msg_select\" \
395 --cancel-label \"\$msg_cancel\" \
396 --default-item \"\$defaultitem\" \
397 --menu \"\$prompt\" \
399 ${USE_DIALOG:+--} $menu_list \
406 # Only update default-item on success
407 [ $retval -eq $DIALOG_OK ] && f_dialog_default_store "$menu_choice"
414 # Display a list of the disks that the user is about to destroy. The default
415 # action is to return error status unless the user explicitly (non-default)
427 local max_width=$(( $width - 3 - $plen ))
431 yes=ok no=cancel defaultno=default-no
432 extra_args="--wrap --left"
436 extra_args="--colors --cr-wrap"
449 if [ $line_width -gt $max_width ]; then
457 # Append the left-overs
469 --title "$title" \
470 --backtitle "$btitle" \
471 --hline "$hline" \
472 --$defaultno \
473 --$yes-label "$msg_yes" \
474 --$no-label "$msg_no" \
476 --yesno "$prompt" $height $width
481 # Configure Virtual Device type and disks to use for the ZFS boot pool. User
498 " # END-QUOTE
503 # Warn the user if vdev type is not valid
529 md[0-9]*) f_mounted -b "/dev/$name" && continue ;;
540 [ $? -eq 0 ] && avail_disks="$avail_disks $disk"
560 # Lets sort the disks array to be more user friendly
565 # disks are selected to satisfy the chosen vdev type or user wants to
566 # back-up to the previous menu.
572 # Confirm the vdev type that was selected
576 --title \"\$title\" \
577 --backtitle \"\$btitle\" \
578 --hline \"\$vdev_hline\" \
579 --ok-label \"\$msg_ok\" \
580 --cancel-label \"\$msg_cancel\" \
581 --item-help \
582 --default-item \"\$ZFSBOOT_VDEV_TYPE\" \
583 --menu \"\$vdev_prompt\" \
588 # Exit if user pressed ESC or chose Cancel/No
608 # Warn the user if any scripted disks are invalid
612 if debug= f_device_find -1 \
626 f_dprintf "No disks selected."
635 # Short-circuit if we're running non-interactively
639 [ $ndisks -ge $want_disks ] && break # to success
641 # Not enough disks selected
644 "Not enough disks selected." \
654 # Confirm the disks that were selected
655 # Loop until the user cancels or selects enough disks
664 # Loop over list of selected disks and create temporary
665 # locals to map statuses onto up-to-date list of disks
667 debug= f_device_find -1 \
681 f_getvar _${disk}_status:-off onoff
691 --title \"\$DIALOG_TITLE\" \
692 --backtitle \"\$DIALOG_BACKTITLE\" \
693 --separate-output \
694 --hline \"\$hline\" \
695 --ok-label \"\$msg_ok\" \
696 --cancel-label \"\$msg_back\" \
697 --checklist \"\$prompt\" \
702 # Loop if user pressed ESC or chose Cancel/No
712 [ $(( $ndisks % 2 )) -ne 0 ]; then
725 [ $ndisks -ge $want_disks ] &&
728 # Not enough disks selected
731 "Not enough disks selected." \
801 # NOTE: `-F' required to destroy if partitions still exist.
805 zpool list -Ho name | while read z_name; do
806 f_eval_catch -d $funcname zpool "$ZPOOL_EXPORT_F" $z_name
809 geli status | tail -n +2 | while read g_name g_status g_component; do
810 f_eval_catch -d $funcname geli "$GELI_DETACH_F" $g_name
813 f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" $disk
814 f_eval_catch -d $funcname graid "$GRAID_DELETE" $disk
815 f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" /dev/$disk
817 # Make doubly-sure backup GPT is destroyed
818 f_eval_catch -d $funcname gpart "$GPART_CREATE" gpt $disk
819 f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" $disk
826 # If user has requested 4 K alignment, add these params to the
834 align_small="-a 4k"
835 align_big="-a 1m"
847 # Apply workarounds if requested by the user
858 # 2. Add small freebsd-boot and/or efi partition
860 if [ "$ZFSBOOT_BOOT_TYPE" = "UEFI" -o \
863 f_eval_catch -k justaddedpart $funcname gpart \
869 if [ -z "$efibootpart" ]; then
884 if [ "$ZFSBOOT_BOOT_TYPE" = "BIOS" -o \
890 freebsd-boot 512k $disk || return $FAILURE
908 [ ${swapsize:-0} -gt 0 ] && targetpart=p5
912 [ ${swapsize:-0} -gt 0 ] && targetpart=p4
917 [ ${swapsize:-0} -gt 0 ] && targetpart=p4
921 [ ${swapsize:-0} -gt 0 ] && targetpart=p3
931 "$align_big" boot$index freebsd-zfs \
934 f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \
938 f_eval_catch -d $funcname geli \
945 # 3. Add freebsd-swap partition labeled `swap#'
947 if [ ${swapsize:-0} -gt 0 ]; then
950 "$align_big" swap$index freebsd-swap \
953 f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \
958 # 4. Add freebsd-zfs partition labeled `zfs#' for zroot
962 "$align_big" zfs$index freebsd-zfs $ZFSBOOT_POOL_SIZE $disk ||
966 "$align_big" zfs$index freebsd-zfs $disk ||
969 f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \
994 f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \
997 f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" ${disk}s1
1015 "" 1 freebsd-zfs ${bootsize}b ${disk}s1 ||
1018 f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \
1022 f_eval_catch -d $funcname geli \
1028 # 4. Add freebsd-swap partition
1030 if [ ${swapsize:-0} -gt 0 ]; then
1033 "$align_small" 2 freebsd-swap \
1036 f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \
1041 # 5. Add freebsd-zfs partition for zroot
1045 "$align_small" $mbrindex freebsd-zfs $ZFSBOOT_POOL_SIZE ${disk}s1 || return $FAILURE
1048 "$align_small" $mbrindex freebsd-zfs ${disk}s1 || return $FAILURE
1050 f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \
1064 elif [ ${swapsize:-0} -eq 0 ]; then
1066 elif [ "$ZFSBOOT_SWAP_ENCRYPTION" -a "$ZFSBOOT_SWAP_MIRROR" ]; then
1118 if [ $# -lt 1 ]; then
1171 # Destroy the pool in-case this is our second time 'round (case of
1178 f_eval_catch -d $funcname zpool "$ZPOOL_DESTROY" "$zroot_name"
1223 f_eval_catch -d $funcname umount "$UMOUNT" "$BSDINSTALL_CHROOT"
1230 [ $nvdevs -gt 1 ] && bootpool_vdevtype=mirror
1233 bootpool_options="-o altroot=$BSDINSTALL_CHROOT"
1235 bootpool_options="$bootpool_options -m \"/$bootpool_name\" -f"
1250 go-wrx "$bootpool/$zroot_key" ||
1261 # Load the AES-NI kernel module to accelerate encryption
1263 f_eval_catch -d $funcname kldload "$KLDLOAD" "aesni"
1264 # Prompt user for password (twice)
1268 f_dprintf "$funcname: User cancelled"
1281 AES-XTS "$bootpool/$zroot_key" \
1302 AES-XTS $disk$targetpart
1326 f_eval_catch -d $funcname umount "$UMOUNT" "$BSDINSTALL_CHROOT"
1332 if [ ${swapsize:-0} -gt 0 -a "$ZFSBOOT_SWAP_MIRROR" ]; then
1349 if [ $(( $nvdev % 3 )) -eq 0 ]; then
1355 "-o altroot=$BSDINSTALL_CHROOT $create_options -m none -f" \
1359 "-o altroot=$BSDINSTALL_CHROOT $create_options -m none -f" \
1381 # Replace both commas and spaces with ` -o '
1382 f_replaceall "$options" "[ ,]" " -o " options
1385 "${options:+-o $options}" "$zroot_name$dataset" ||
1414 # MBR boot loader touch-up
1434 # Re-import the ZFS pool(s)
1435 f_dprintf "$funcname: Re-importing ZFS pool(s)..."
1437 "-o altroot=\"$BSDINSTALL_CHROOT\"" \
1443 "-o altroot=\"$BSDINSTALL_CHROOT\" -N" \
1473 # not get mounted if a different BE is selected from the beastie menu
1518 # Configure geli(8)-based encryption
1546 # Set cachefile for boot pool so it auto-imports at system start
1568 # Prompt the user to select a disk and then provide detailed info on it.
1575 # Break from loop when user cancels disk selection
1605 --title "$DIALOG_TITLE" \
1606 --backtitle "$DIALOG_BACKTITLE" \
1607 --hline "$hline" \
1608 --ok-label "Ok" \
1609 --no-cancel \
1610 --inputbox "$prompt" \
1623 # User may have specifically requested ZFS-related operations be interactive
1646 case $(uname -m) in
1654 bootmethod=$( sysctl -n machdep.bootmethod )
1680 [ $retval -eq $DIALOG_OK ] || f_die
1685 # First, validate the user's selections
1695 # Validate vdev type against number of disks selected/scripted
1697 # NB: dialog_menu_layout supports running non-interactively
1713 debug= f_device_find -1 \
1716 [ ${disksize:-0} -ge 0 ] || disksize=0
1717 [ $disksize -lt $minsize ] &&
1755 echo "$ZFSBOOT_DISKS" > ${TMPDIR:-"/tmp"}/bsdinstall-zfsboot
1762 # User has poked settings, disable later confirmation
1765 "- $msg_rescan_devices") f_device_rescan ;;
1766 "- $msg_disk_info") dialog_menu_diskinfo ;;
1768 # Prompt the user to input/change the name for the new pool
1793 if [ "$ZFSBOOT_PARTITION_SCHEME" = "GPT" -a \
1798 elif [ "$ZFSBOOT_PARTITION_SCHEME" = "GPT" -a \
1818 # Prompt the user to input/change the swap size for each disk
1823 ZFSBOOT_SWAP_SIZE="${input:-0}"
1826 if [ $swapsize -ne 0 -a $swapsize -lt 104857600 ]; then