Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bsdinstall/scripts/auto
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
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_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="Auto (UFS)" | ||||
msg_auto_ufs_desc="Guided UFS Disk Setup" | 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_ufs_help="Menu options help choose which disk to setup using UFS and standard partitions" | ||||
msg_auto_zfs="Auto (ZFS)" | msg_auto_zfs="Auto (ZFS)" | ||||
msg_auto_zfs_desc="Guided Root-on-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_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="$OSNAME 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_manual="Manual" | msg_manual="Manual" | ||||
msg_manual_desc="Manual Disk Setup (experts)" | msg_manual_desc="Manual Disk Setup (experts)" | ||||
msg_manual_help="Create customized partitions from menu options" | 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="Shell" | ||||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | |||||
export DISTRIBUTIONS="base.txz kernel.txz" | export DISTRIBUTIONS="base.txz kernel.txz" | ||||
if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then | if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then | ||||
DISTMENU=`awk -F'\t' '!/^(kernel\.txz|base\.txz)/{print $1,$5,$6}' $BSDINSTALL_DISTDIR/MANIFEST` | DISTMENU=`awk -F'\t' '!/^(kernel\.txz|base\.txz)/{print $1,$5,$6}' $BSDINSTALL_DISTDIR/MANIFEST` | ||||
DISTMENU="$(echo ${DISTMENU} | sed -E 's/\.txz//g')" | DISTMENU="$(echo ${DISTMENU} | sed -E 's/\.txz//g')" | ||||
if [ -n "$DISTMENU" ]; then | if [ -n "$DISTMENU" ]; then | ||||
exec 3>&1 | exec 3>&1 | ||||
EXTRA_DISTS=$( eval dialog \ | EXTRA_DISTS=$( eval dialog \ | ||||
--backtitle \"FreeBSD Installer\" \ | --backtitle \"$OSNAME Installer\" \ | ||||
--title \"Distribution Select\" --nocancel --separate-output \ | --title \"Distribution Select\" --nocancel --separate-output \ | ||||
--checklist \"Choose optional system components to install:\" \ | --checklist \"Choose optional system components to install:\" \ | ||||
0 0 0 $DISTMENU \ | 0 0 0 $DISTMENU \ | ||||
2>&1 1>&3 ) | 2>&1 1>&3 ) | ||||
for dist in $EXTRA_DISTS; do | for dist in $EXTRA_DISTS; do | ||||
export DISTRIBUTIONS="$DISTRIBUTIONS $dist.txz" | export DISTRIBUTIONS="$DISTRIBUTIONS $dist.txz" | ||||
done | done | ||||
fi | fi | ||||
fi | fi | ||||
FETCH_DISTRIBUTIONS="" | FETCH_DISTRIBUTIONS="" | ||||
for dist in $DISTRIBUTIONS; do | for dist in $DISTRIBUTIONS; do | ||||
if [ ! -f $BSDINSTALL_DISTDIR/$dist ]; then | if [ ! -f $BSDINSTALL_DISTDIR/$dist ]; then | ||||
FETCH_DISTRIBUTIONS="$FETCH_DISTRIBUTIONS $dist" | FETCH_DISTRIBUTIONS="$FETCH_DISTRIBUTIONS $dist" | ||||
fi | fi | ||||
done | done | ||||
if [ -n "$FETCH_DISTRIBUTIONS" -a -n "$BSDINSTALL_CONFIGCURRENT" ]; then | if [ -n "$FETCH_DISTRIBUTIONS" -a -n "$BSDINSTALL_CONFIGCURRENT" ]; then | ||||
dialog --backtitle "FreeBSD Installer" --title "Network Installation" --msgbox "Some installation files were not found on the boot volume. The next few screens will allow you to configure networking so that they can be downloaded from the Internet." 0 0 | dialog --backtitle "$OSNAME Installer" --title "Network Installation" --msgbox "Some installation files were not found on the boot volume. The next few screens will allow you to configure networking so that they can be downloaded from the Internet." 0 0 | ||||
bsdinstall netconfig || error | bsdinstall netconfig || error | ||||
NETCONFIG_DONE=yes | NETCONFIG_DONE=yes | ||||
fi | fi | ||||
rm -f $PATH_FSTAB | rm -f $PATH_FSTAB | ||||
touch $PATH_FSTAB | touch $PATH_FSTAB | ||||
# | # | ||||
▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | PMODES=" | ||||
$PMODES | $PMODES | ||||
" # END-QUOTE | " # END-QUOTE | ||||
;; | ;; | ||||
*) # Booting ZFS Unsupported | *) # 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 "$OSNAME Installer" \ | ||||
--title "Partitioning" \ | --title "Partitioning" \ | ||||
--item-help \ | --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 | ||||
"$msg_auto_zfs") # ZFS | "$msg_auto_zfs") # ZFS | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
trap true SIGINT # This section is optional | trap true SIGINT # This section is optional | ||||
if [ "$NETCONFIG_DONE" != yes ]; then | if [ "$NETCONFIG_DONE" != yes ]; then | ||||
bsdinstall netconfig # Don't check for errors -- the user may cancel | bsdinstall netconfig # Don't check for errors -- the user may cancel | ||||
fi | fi | ||||
bsdinstall time | bsdinstall time | ||||
bsdinstall services | bsdinstall services | ||||
bsdinstall hardening | bsdinstall hardening | ||||
dialog --backtitle "FreeBSD Installer" --title "Add User Accounts" --yesno \ | dialog --backtitle "$OSNAME Installer" --title "Add User Accounts" --yesno \ | ||||
"Would you like to add users to the installed system now?" 0 0 && \ | "Would you like to add users to the installed system now?" 0 0 && \ | ||||
bsdinstall adduser | bsdinstall adduser | ||||
finalconfig() { | finalconfig() { | ||||
exec 3>&1 | exec 3>&1 | ||||
REVISIT=$(dialog --backtitle "FreeBSD Installer" \ | REVISIT=$(dialog --backtitle "$OSNAME Installer" \ | ||||
--title "Final Configuration" --no-cancel --menu \ | --title "Final Configuration" --no-cancel --menu \ | ||||
"Setup of your FreeBSD system is nearly complete. You can now modify your configuration choices. After this screen, you will have an opportunity to make more complex changes using a shell." 0 0 0 \ | "Setup of your $OSNAME system is nearly complete. You can now modify your configuration choices. After this screen, you will have an opportunity to make more complex changes using a shell." 0 0 0 \ | ||||
"Exit" "Apply configuration and exit installer" \ | "Exit" "Apply configuration and exit installer" \ | ||||
"Add User" "Add a user to the system" \ | "Add User" "Add a user to the system" \ | ||||
"Root Password" "Change root password" \ | "Root Password" "Change root password" \ | ||||
"Hostname" "Set system hostname" \ | "Hostname" "Set system hostname" \ | ||||
"Network" "Networking configuration" \ | "Network" "Networking configuration" \ | ||||
"Services" "Set daemons to run on startup" \ | "Services" "Set daemons to run on startup" \ | ||||
"System Hardening" "Set security options" \ | "System Hardening" "Set security options" \ | ||||
"Time Zone" "Set system timezone" \ | "Time Zone" "Set system timezone" \ | ||||
"Handbook" "Install FreeBSD Handbook (requires network)" 2>&1 1>&3) | "Handbook" "Install $OSNAME Handbook (requires network)" 2>&1 1>&3) | ||||
exec 3>&- | exec 3>&- | ||||
case "$REVISIT" in | case "$REVISIT" in | ||||
"Add User") | "Add User") | ||||
bsdinstall adduser | bsdinstall adduser | ||||
finalconfig | finalconfig | ||||
;; | ;; | ||||
"Root Password") | "Root Password") | ||||
Show All 32 Lines | |||||
trap error SIGINT # SIGINT is bad again | trap error SIGINT # SIGINT is bad again | ||||
bsdinstall config || error "Failed to save config" | bsdinstall config || error "Failed to save config" | ||||
if [ ! -z "$BSDINSTALL_FETCHDEST" ]; then | if [ ! -z "$BSDINSTALL_FETCHDEST" ]; then | ||||
rm -rf "$BSDINSTALL_FETCHDEST" | rm -rf "$BSDINSTALL_FETCHDEST" | ||||
fi | fi | ||||
dialog --backtitle "FreeBSD Installer" --title "Manual Configuration" \ | dialog --backtitle "$OSNAME Installer" --title "Manual Configuration" \ | ||||
--default-button no --yesno \ | --default-button no --yesno \ | ||||
"The installation is now finished. Before exiting the installer, would you like to open a shell in the new system to make any final manual modifications?" 0 0 | "The installation is now finished. Before exiting the installer, would you like to open a shell in the new system to make any final manual modifications?" 0 0 | ||||
if [ $? -eq 0 ]; then | if [ $? -eq 0 ]; then | ||||
clear | clear | ||||
echo This shell is operating in a chroot in the new system. \ | echo This shell is operating in a chroot in the new system. \ | ||||
When finished making configuration changes, type \"exit\". | When finished making configuration changes, type \"exit\". | ||||
chroot "$BSDINSTALL_CHROOT" /bin/sh 2>&1 | chroot "$BSDINSTALL_CHROOT" /bin/sh 2>&1 | ||||
fi | fi | ||||
Show All 9 Lines |