Changeset View
Standalone View
usr.sbin/bsdinstall/scripts/auto
Show All 35 Lines | |||||
############################################################ GLOBALS | ############################################################ GLOBALS | ||||
# | # | ||||
# Strings that should be moved to an i18n file and loaded with f_include_lang() | # Strings that should be moved to an i18n file and loaded with f_include_lang() | ||||
# | # | ||||
hline_arrows_tab_enter="Press arrows, TAB or ENTER" | hline_arrows_tab_enter="Press arrows, TAB or ENTER" | ||||
hline_arrows_tab_space_enter="Press arrows, TAB, SPACE or ENTER" | hline_arrows_tab_space_enter="Press arrows, TAB, SPACE or ENTER" | ||||
msg_abort="Abort" | msg_abort="Abort" | ||||
msg_an_installation_step_has_been_aborted="An installation step has been aborted. Would you like\nto restart the installation or exit the installer?" | |||||
msg_auto_ufs="Auto (UFS)" | |||||
msg_auto_ufs_desc="Guided UFS Disk Setup" | |||||
msg_auto_ufs_help="Menu options help choose which disk to setup using UFS and standard partitions" | |||||
msg_auto_zfs="Auto (ZFS)" | |||||
msg_auto_zfs_desc="Guided Root-on-ZFS" | |||||
msg_auto_zfs_help="To use ZFS with less than 8GB RAM, see https://wiki.freebsd.org/ZFSTuningGuide" | |||||
msg_exit="Exit" | msg_exit="Exit" | ||||
msg_freebsd_installer="FreeBSD Installer" | msg_freebsd_installer="FreeBSD Installer" | ||||
msg_gpt_active_fix="Your hardware is known to have issues booting in CSM/Legacy/BIOS mode from GPT partitions that are not set active. Would you like the installer to apply this workaround for you?" | msg_gpt_active_fix="Your hardware is known to have issues booting in CSM/Legacy/BIOS mode from GPT partitions that are not set active. Would you like the installer to apply this workaround for you?" | ||||
msg_lenovo_fix="Your model of Lenovo is known to have a BIOS bug that prevents it booting from GPT partitions without UEFI. Would you like the installer to apply a workaround for you?" | msg_lenovo_fix="Your model of Lenovo is known to have a BIOS bug that prevents it booting from GPT partitions without UEFI. Would you like the installer to apply a workaround for you?" | ||||
msg_an_installation_step_has_been_aborted="An installation step has been aborted. Would you like\nto restart the installation or exit the installer?" | msg_manual="Manual" | ||||
msg_manual_desc="Manual Disk Setup (experts)" | |||||
msg_manual_help="Create customized partitions from menu options" | |||||
msg_no="NO" | msg_no="NO" | ||||
msg_restart="Restart" | msg_restart="Restart" | ||||
msg_shell="Shell" | |||||
msg_shell_desc="Open a shell and partition by hand" | |||||
msg_shell_help="Create customized partitions using command-line utilities" | |||||
msg_yes="YES" | msg_yes="YES" | ||||
############################################################ FUNCTIONS | ############################################################ FUNCTIONS | ||||
# error [$msg] | # error [$msg] | ||||
# | # | ||||
rgrimes: To be more uniform could this be "Guided UFS Disk Setup" as the zfs desc above explicity… | |||||
# Display generic error message when a script fails. An optional message | # Display generic error message when a script fails. An optional message | ||||
# argument can preceed the generic message. User is given the choice of | # argument can preceed the generic message. User is given the choice of | ||||
# restarting the installer or exiting. | # restarting the installer or exiting. | ||||
# | # | ||||
error() | error() | ||||
{ | { | ||||
local title="$msg_abort" | local title="$msg_abort" | ||||
Done Inline ActionsThe variable names here need to be adjusted. msg_partititoning_zfs="Auto (ZFS)" For example should be: msg_auto_zfs="Auto (ZFS)" So that when used in code, the code reads like the text. Also, when searching the code, one can prepend "msg_", change to lower-case, and replace non-printable characters and spaces into underscore to find uses of the text. Also, should the text be re-usable elsewhere, it is not tied to the partitioning menu. This is so that when someone performs international translation, fewer translations have to be made. For example, there is no reason to have: msg_partitioning_shell="Shell" When the following will do: msg_shell="Shell" Which makes any singular occurrence of the word "Shell" accessible under the "msg_shell" variable. Unnecessarily localizing individual words and phrases to a particular dialog, function, or module creates duplication and extra work for translators. dteske: The variable names here need to be adjusted.
```
msg_partititoning_zfs="Auto (ZFS)"
```
For… | |||||
local btitle="$msg_freebsd_installer" | local btitle="$msg_freebsd_installer" | ||||
local prompt="${1:+$1\n\n}$msg_an_installation_step_has_been_aborted" | local prompt="${1:+$1\n\n}$msg_an_installation_step_has_been_aborted" | ||||
local hline="$hline_arrows_tab_space_enter" | local hline="$hline_arrows_tab_space_enter" | ||||
[ "$DISTDIR_IS_UNIONFS" ] && umount -f "$BSDINSTALL_DISTDIR" | [ "$DISTDIR_IS_UNIONFS" ] && umount -f "$BSDINSTALL_DISTDIR" | ||||
[ -f "$PATH_FSTAB" ] && bsdinstall umount | [ -f "$PATH_FSTAB" ] && bsdinstall umount | ||||
local height width | local height width | ||||
▲ Show 20 Lines • Show All 204 Lines • ▼ Show 20 Lines | "Veriton M6630G") | ||||
export WORKAROUND_GPTACTIVE=1 | export WORKAROUND_GPTACTIVE=1 | ||||
fi | fi | ||||
;; | ;; | ||||
esac | esac | ||||
;; | ;; | ||||
esac | esac | ||||
fi | fi | ||||
PMODES="\ | PMODES=" | ||||
\"Auto (UFS)\" \"Guided Disk Setup\" \ | '$msg_auto_ufs' '$msg_auto_ufs_desc' '$msg_auto_ufs_help' | ||||
Manual \"Manual Disk Setup (experts)\" \ | '$msg_manual' '$msg_manual_desc' '$msg_manual_help' | ||||
Shell \"Open a shell and partition by hand\"" | '$msg_shell' '$msg_shell_desc' '$msg_shell_help' | ||||
" # END-QUOTE | |||||
CURARCH=$( uname -m ) | CURARCH=$( uname -m ) | ||||
case $CURARCH in | case $CURARCH in | ||||
amd64|arm64|i386) # Booting ZFS Supported | amd64|arm64|i386) # Booting ZFS Supported | ||||
PMODES="\"Auto (ZFS)\" \"Guided Root-on-ZFS\" $PMODES" | PMODES=" | ||||
'$msg_auto_zfs' '$msg_auto_zfs_desc' '$msg_auto_zfs_help' | |||||
$PMODES | |||||
" # END-QUOTE | |||||
;; | ;; | ||||
*) # Booting ZFS Unspported | *) # Booting ZFS Unsupported | ||||
;; | ;; | ||||
esac | esac | ||||
exec 3>&1 | exec 3>&1 | ||||
PARTMODE=`echo $PMODES | xargs dialog --backtitle "FreeBSD Installer" \ | PARTMODE=`echo $PMODES | xargs dialog --backtitle "FreeBSD Installer" \ | ||||
--title "Partitioning" \ | --title "Partitioning" \ | ||||
--item-help \ | |||||
--menu "How would you like to partition your disk?" \ | --menu "How would you like to partition your disk?" \ | ||||
0 0 0 2>&1 1>&3` || exit 1 | 0 0 0 2>&1 1>&3` || exit 1 | ||||
exec 3>&- | exec 3>&- | ||||
case "$PARTMODE" in | case "$PARTMODE" in | ||||
"Auto (ZFS)") # ZFS | "$msg_auto_zfs") # ZFS | ||||
bsdinstall zfsboot || error "ZFS setup failed" | bsdinstall zfsboot || error "ZFS setup failed" | ||||
bsdinstall mount || error "Failed to mount filesystem" | bsdinstall mount || error "Failed to mount filesystem" | ||||
;; | ;; | ||||
"Auto (UFS)") # Guided | "$msg_auto_ufs") # Guided UFS | ||||
bsdinstall autopart || error "Partitioning error" | bsdinstall autopart || error "Partitioning error" | ||||
bsdinstall mount || error "Failed to mount filesystem" | bsdinstall mount || error "Failed to mount filesystem" | ||||
;; | ;; | ||||
"Shell") # Shell | "$msg_shell") # Shell | ||||
clear | clear | ||||
echo "Use this shell to set up partitions for the new system. When finished, mount the system at $BSDINSTALL_CHROOT and place an fstab file for the new system at $PATH_FSTAB. Then type 'exit'. You can also enter the partition editor at any time by entering 'bsdinstall partedit'." | echo "Use this shell to set up partitions for the new system. When finished, mount the system at $BSDINSTALL_CHROOT and place an fstab file for the new system at $PATH_FSTAB. Then type 'exit'. You can also enter the partition editor at any time by entering 'bsdinstall partedit'." | ||||
sh 2>&1 | sh 2>&1 | ||||
;; | ;; | ||||
"Manual") # Manual | "$msg_manual") # Manual | ||||
if f_isset debugFile; then | if f_isset debugFile; then | ||||
# Give partedit the path to our logfile so it can append | # Give partedit the path to our logfile so it can append | ||||
BSDINSTALL_LOG="${debugFile#+}" bsdinstall partedit || error "Partitioning error" | BSDINSTALL_LOG="${debugFile#+}" bsdinstall partedit || error "Partitioning error" | ||||
else | else | ||||
bsdinstall partedit || error "Partitioning error" | bsdinstall partedit || error "Partitioning error" | ||||
fi | fi | ||||
bsdinstall mount || error "Failed to mount filesystem" | bsdinstall mount || error "Failed to mount filesystem" | ||||
;; | ;; | ||||
▲ Show 20 Lines • Show All 182 Lines • Show Last 20 Lines |
To be more uniform could this be "Guided UFS Disk Setup" as the zfs desc above explicity mentions ZFS too.