Lines 45-50
Link Here
|
45 |
: ${ZFSBOOT_POOL_NAME:=zroot} |
45 |
: ${ZFSBOOT_POOL_NAME:=zroot} |
46 |
|
46 |
|
47 |
# |
47 |
# |
|
|
48 |
# How much space to allocate for the zroot partition |
49 |
# MAX means use all the leftover space |
50 |
# NOTE: Value passed to gpart(8); which supports SI unit suffixes. |
51 |
# |
52 |
: ${ZFSBOOT_ZROOT_POOL_SIZE:=MAX} |
53 |
|
54 |
# |
48 |
# Default options to use when creating zroot pool |
55 |
# Default options to use when creating zroot pool |
49 |
# |
56 |
# |
50 |
: ${ZFSBOOT_POOL_CREATE_OPTIONS:=-O compress=lz4 -O atime=off} |
57 |
: ${ZFSBOOT_POOL_CREATE_OPTIONS:=-O compress=lz4 -O atime=off} |
Lines 262-267
Link Here
|
262 |
msg_invalid_disk_argument="Invalid disk argument \`%s'" |
269 |
msg_invalid_disk_argument="Invalid disk argument \`%s'" |
263 |
msg_invalid_index_argument="Invalid index argument \`%s'" |
270 |
msg_invalid_index_argument="Invalid index argument \`%s'" |
264 |
msg_invalid_swap_size="Invalid swap size \`%s'" |
271 |
msg_invalid_swap_size="Invalid swap size \`%s'" |
|
|
272 |
msg_invalid_zroot_pool_size="Invalid zroot pool size \`%s'" |
265 |
msg_invalid_virtual_device_type="Invalid Virtual Device type \`%s'" |
273 |
msg_invalid_virtual_device_type="Invalid Virtual Device type \`%s'" |
266 |
msg_last_chance_are_you_sure="Last Chance! Are you sure you want to destroy\nthe current contents of the following disks:\n\n %s" |
274 |
msg_last_chance_are_you_sure="Last Chance! Are you sure you want to destroy\nthe current contents of the following disks:\n\n %s" |
267 |
msg_last_chance_are_you_sure_color='\\ZrLast Chance!\\ZR Are you \\Z1sure\\Zn you want to \\Zr\\Z1destroy\\Zn\nthe current contents of the following disks:\n\n %s' |
275 |
msg_last_chance_are_you_sure_color='\\ZrLast Chance!\\ZR Are you \\Z1sure\\Zn you want to \\Zr\\Z1destroy\\Zn\nthe current contents of the following disks:\n\n %s' |
Lines 281-291
Link Here
|
281 |
msg_partition_scheme="Partition Scheme" |
289 |
msg_partition_scheme="Partition Scheme" |
282 |
msg_partition_scheme_help="Select partitioning scheme. GPT is recommended." |
290 |
msg_partition_scheme_help="Select partitioning scheme. GPT is recommended." |
283 |
msg_please_enter_a_name_for_your_zpool="Please enter a name for your zpool:" |
291 |
msg_please_enter_a_name_for_your_zpool="Please enter a name for your zpool:" |
|
|
292 |
msg_please_enter_amount_of_zroot_pool_space="Please enter amount of zroot pool space (SI-Unit suffixes\nrecommended; e.g., \`2g' for 2 Gigabytes):" |
284 |
msg_please_enter_amount_of_swap_space="Please enter amount of swap space (SI-Unit suffixes\nrecommended; e.g., \`2g' for 2 Gigabytes):" |
293 |
msg_please_enter_amount_of_swap_space="Please enter amount of swap space (SI-Unit suffixes\nrecommended; e.g., \`2g' for 2 Gigabytes):" |
285 |
msg_please_select_one_or_more_disks="Please select one or more disks to create a zpool:" |
294 |
msg_please_select_one_or_more_disks="Please select one or more disks to create a zpool:" |
286 |
msg_pool_name="Pool Name" |
295 |
msg_pool_name="Pool Name" |
287 |
msg_pool_name_cannot_be_empty="Pool name cannot be empty." |
296 |
msg_pool_name_cannot_be_empty="Pool name cannot be empty." |
288 |
msg_pool_name_help="Customize the name of the zpool to be created (Required)" |
297 |
msg_pool_name_help="Customize the name of the zpool to be created (Required)" |
|
|
298 |
msg_zroot_pool_size="ZROOT pool Size" |
299 |
msg_zroot_pool_size_help="Customize how much space is allocated for the zroot pool" |
300 |
msg_zroot_pool_toosmall="The selected pool size (%s) is to small. Please enter a value greater than 100MB or enter MAX for using full remainder" |
289 |
msg_pool_type_disks="Pool Type/Disks:" |
301 |
msg_pool_type_disks="Pool Type/Disks:" |
290 |
msg_pool_type_disks_help="Choose type of ZFS Virtual Device and disks to use (Required)" |
302 |
msg_pool_type_disks_help="Choose type of ZFS Virtual Device and disks to use (Required)" |
291 |
msg_processing_selection="Processing selection..." |
303 |
msg_processing_selection="Processing selection..." |
Lines 354-359
Link Here
|
354 |
'$msg_disk_info_help' |
366 |
'$msg_disk_info_help' |
355 |
'N $msg_pool_name' '$ZFSBOOT_POOL_NAME' |
367 |
'N $msg_pool_name' '$ZFSBOOT_POOL_NAME' |
356 |
'$msg_pool_name_help' |
368 |
'$msg_pool_name_help' |
|
|
369 |
'Z $msg_zroot_pool_size' |
370 |
'$ZFSBOOT_ZROOT_POOL_SIZE' |
371 |
'$msg_zroot_pool_size_help' |
357 |
'4 $msg_force_4k_sectors' |
372 |
'4 $msg_force_4k_sectors' |
358 |
'$force4k' |
373 |
'$force4k' |
359 |
'$msg_force_4k_sectors_help' |
374 |
'$msg_force_4k_sectors_help' |
Lines 734-740
Link Here
|
734 |
# so we can have some real swap. This also provides wiggle room incase your |
749 |
# so we can have some real swap. This also provides wiggle room incase your |
735 |
# replacement drivers do not have the exact same sector counts. |
750 |
# replacement drivers do not have the exact same sector counts. |
736 |
# |
751 |
# |
737 |
# NOTE: $swapsize and $bootsize should be defined by the calling function. |
752 |
# NOTE: $swapsize and $zrootsize, $bootsize should be defined by the calling |
|
|
753 |
# function. |
738 |
# NOTE: Sets $bootpart and $targetpart for the calling function. |
754 |
# NOTE: Sets $bootpart and $targetpart for the calling function. |
739 |
# |
755 |
# |
740 |
zfs_create_diskpart() |
756 |
zfs_create_diskpart() |
Lines 929-940
Link Here
|
929 |
# |
945 |
# |
930 |
# 4. Add freebsd-zfs partition labeled `zfs#' for zroot |
946 |
# 4. Add freebsd-zfs partition labeled `zfs#' for zroot |
931 |
# |
947 |
# |
932 |
f_eval_catch $funcname gpart "$GPART_ADD_ALIGN_LABEL" \ |
948 |
if [ x"$zrootsize"x = xx -o x"$zrootsize"x = x"MAX"x]; then |
933 |
"$align_big" zfs$index freebsd-zfs $disk || |
949 |
f_eval_catch $funcname gpart "$GPART_ADD_ALIGN_LABEL" \ |
934 |
return $FAILURE |
950 |
"$align_big" zfstest$index freebsd-zfs $disk || |
|
|
951 |
return $FAILURE |
952 |
else |
953 |
f_eval_catch $funcname gpart \ |
954 |
"$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \ |
955 |
"$align_big" zfstest$index freebsd-zfs \ |
956 |
${zrootsize}b $disk || |
957 |
return $FAILURE |
958 |
fi |
935 |
f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ |
959 |
f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ |
936 |
/dev/$disk$targetpart |
960 |
/dev/$disk$targetpart |
937 |
;; |
961 |
;; # END GPT |
938 |
|
962 |
|
939 |
MBR) f_dprintf "$funcname: Creating MBR layout..." |
963 |
MBR) f_dprintf "$funcname: Creating MBR layout..." |
940 |
# |
964 |
# |
Lines 1014-1020
Link Here
|
1014 |
f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ |
1038 |
f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ |
1015 |
/boot/zfsboot /dev/${disk}s1 count=1 || |
1039 |
/boot/zfsboot /dev/${disk}s1 count=1 || |
1016 |
return $FAILURE |
1040 |
return $FAILURE |
1017 |
;; |
1041 |
;; # END MBR |
1018 |
|
1042 |
|
1019 |
esac # $ZFSBOOT_PARTITION_SCHEME |
1043 |
esac # $ZFSBOOT_PARTITION_SCHEME |
1020 |
|
1044 |
|
Lines 1676-1681
Link Here
|
1676 |
"$ZFSBOOT_POOL_NAME" && |
1700 |
"$ZFSBOOT_POOL_NAME" && |
1677 |
ZFSBOOT_POOL_NAME="$input" |
1701 |
ZFSBOOT_POOL_NAME="$input" |
1678 |
;; |
1702 |
;; |
|
|
1703 |
?" $msg_zroot_pool_size") |
1704 |
# Prompt the user to input/change the zroot pool size |
1705 |
while :; do |
1706 |
f_dialog_input input \ |
1707 |
"$msg_please_enter_amount_of_zroot_space" \ |
1708 |
"$ZFSBOOT_ZROOT_POOL_SIZE" && |
1709 |
ZFSBOOT_ZROOT_POOL_SIZE="$input" |
1710 |
if [ $ZFSBOOT_ZROOT_POOL_SIZE = "MAX" ]; then |
1711 |
zrootsize = "MAX" |
1712 |
break; |
1713 |
fi |
1714 |
if f_expand_number "$ZFSBOOT_ZROOT_POOL_SIZE" zrootsize |
1715 |
then |
1716 |
if [ $zrootsize -ne 0 -a $zrootsize -lt 104857600 ]; then |
1717 |
f_show_err "$msg_zroot_pool_toosmall" \ |
1718 |
"$ZFSBOOT_ZROOT_POOL_SIZE" |
1719 |
continue; |
1720 |
else |
1721 |
break; |
1722 |
fi |
1723 |
else |
1724 |
f_show_err "$msg_zroot_pool_invalid" \ |
1725 |
"$ZFSBOOT_ZROOT_POOL_SIZE" |
1726 |
continue; |
1727 |
fi |
1728 |
done |
1729 |
;; |
1679 |
?" $msg_force_4k_sectors") |
1730 |
?" $msg_force_4k_sectors") |
1680 |
# Toggle the variable referenced both by the menu and later |
1731 |
# Toggle the variable referenced both by the menu and later |
1681 |
if [ "$ZFSBOOT_FORCE_4K_SECTORS" ]; then |
1732 |
if [ "$ZFSBOOT_FORCE_4K_SECTORS" ]; then |