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