4 : ${BSDDIALOG_CANCEL=1}
8 : ${BSDDIALOG_ERROR=255}
10 kbdcontrol -d >/dev/null 2>&1
12 # Syscons: use xterm, start interesting things on other VTYs
15 # Don't send ESC on function-key 62/63 (left/right command key)
16 kbdcontrol -f 62 '' > /dev/null 2>&1
17 kbdcontrol -f 63 '' > /dev/null 2>&1
19 if [ -z "$EXTERNAL_VTY_STARTED" ]; then
20 # Init will clean these processes up if/when the system
22 touch /tmp/bsdinstall_log
23 tail -f /tmp/bsdinstall_log > /dev/ttyv2 &
24 /usr/libexec/getty autologin ttyv3 &
25 EXTERNAL_VTY_STARTED=1
28 # Serial or other console
30 echo "Welcome to FreeBSD!"
32 echo "Please choose the appropriate terminal type for your system."
33 echo "Common console types are:"
34 echo " ansi Standard ANSI terminal"
35 echo " vt100 VT100 or compatible terminal"
36 echo " xterm xterm terminal emulator (or compatible)"
38 echo -n "Console type [vt100]: "
44 # Query terminal size; useful for serial lines.
47 if [ -f /etc/installerconfig ]; then
48 if [ "$1" != "primary" ]; then
49 bsddialog --backtitle "FreeBSD Installer" --title "Installing" --msgbox "FreeBSD is being installed from a script; please use the primary console." 0 0
51 elif bsdinstall script /etc/installerconfig; then
52 bsddialog --backtitle "FreeBSD Installer" --title "Complete" --no-cancel --ok-label "Reboot" --pause "Installation of FreeBSD complete! Rebooting in 10 seconds" 10 30 10
55 bsddialog --backtitle "FreeBSD Installer" --title "Error" --textbox /tmp/bsdinstall_log 0 0
60 bsddialog --backtitle "FreeBSD Installer" --title "Welcome" --extra-button --extra-label "Shell" --ok-label "Install" --cancel-label "Live CD" --yesno "Welcome to FreeBSD! Would you like to begin an installation or use the live CD?" 0 0
63 $BSDDIALOG_OK) # Install
64 # If not netbooting, have the installer configure the network
65 dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null`
66 if [ ${dlv:=0} -eq 0 -a ! -f /etc/diskless ]; then
67 BSDINSTALL_CONFIGCURRENT=yes; export BSDINSTALL_CONFIGCURRENT
70 trap true SIGINT # Ignore cntrl-C here
73 bsddialog --backtitle "FreeBSD Installer" --title "Complete" --ok-label "Reboot" --extra-button --extra-label "Shutdown" --cancel-label "Live CD" --yesno "Installation of FreeBSD complete! Would you like to reboot into the installed system now?" 0 0
76 $BSDDIALOG_OK) # Reboot
79 $BSDDIALOG_EXTRA) # Shutdown
81 # shutdown(8) daemonizes, with the actual signal to
82 # init(8) happening in the child, but if we exit the
83 # script then runconsoles will clean up its children
84 # thinking we're trying to go multiuser (and if the
85 # user has disabled multiple console support we'll
86 # still start trying to go multi-user, which gives
87 # confusing output on the console if the daemon is slow
88 # to run). Thus we spin while the daemon runs.
93 $BSDDIALOG_CANCEL) # Live CD
101 $BSDDIALOG_CANCEL) # Live CD
104 $BSDDIALOG_EXTRA) # Shell
106 echo "When finished, type 'exit' to return to the installer."