rc.local revision 230997
1219181Snwhitehorn#!/bin/sh 2219181Snwhitehorn# $FreeBSD: head/release/rc.local 230997 2012-02-04 23:00:27Z nwhitehorn $ 3219181Snwhitehorn 4219181Snwhitehorn: ${DIALOG_OK=0} 5219181Snwhitehorn: ${DIALOG_CANCEL=1} 6219181Snwhitehorn: ${DIALOG_HELP=2} 7219181Snwhitehorn: ${DIALOG_EXTRA=3} 8219181Snwhitehorn: ${DIALOG_ITEM_HELP=4} 9219181Snwhitehorn: ${DIALOG_ESC=255} 10219181Snwhitehorn 11225637Snwhitehornkbdcontrol -d >/dev/null 2>&1 12225637Snwhitehornif [ $? -eq 0 ]; then 13230482Snwhitehorn # Syscons: use xterm, start interesting things on other VTYs 14225637Snwhitehorn TERM=xterm 15230482Snwhitehorn 16230483Snwhitehorn if [ -z "$EXTERNAL_VTY_STARTED" ]; then 17230482Snwhitehorn # Init will clean these processes up if/when the system 18230482Snwhitehorn # goes multiuser 19230482Snwhitehorn touch /tmp/bsdinstall_log 20230482Snwhitehorn tail -f /tmp/bsdinstall_log > /dev/ttyv2 & 21230997Snwhitehorn /usr/libexec/getty autologin ttyv3 & 22230482Snwhitehorn EXTERNAL_VTY_STARTED=1 23230482Snwhitehorn fi 24225637Snwhitehornelse 25225637Snwhitehorn # Serial or other console 26225637Snwhitehorn echo 27225637Snwhitehorn echo "Welcome to FreeBSD!" 28225637Snwhitehorn echo 29225637Snwhitehorn echo "Please choose the appropriate terminal type for your system." 30225637Snwhitehorn echo "Common console types are:" 31225637Snwhitehorn echo " ansi Standard ANSI terminal" 32225637Snwhitehorn echo " vt100 VT100 or compatible terminal" 33225637Snwhitehorn echo " xterm xterm terminal emulator (or compatible)" 34225637Snwhitehorn echo 35225637Snwhitehorn echo -n "Console type [vt100]: " 36225637Snwhitehorn read TERM 37225637Snwhitehorn TERM=${TERM:-vt100} 38225637Snwhitehornfi 39225637Snwhitehornexport TERM 40219181Snwhitehorn 41219181Snwhitehorndialog --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 42219181Snwhitehorn 43219181Snwhitehorncase $? in 44219181Snwhitehorn$DIALOG_OK) # Install 45225637Snwhitehorn # If not netbooting, have the installer configure the network 46225637Snwhitehorn dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` 47225637Snwhitehorn if [ ${dlv:=0} -eq 0 -a ! -f /etc/diskless ]; then 48225637Snwhitehorn BSDINSTALL_CONFIGCURRENT=yes; export BSDINSTALL_CONFIGCURRENT 49225637Snwhitehorn fi 50225637Snwhitehorn 51219181Snwhitehorn trap true SIGINT # Ignore cntrl-C here 52219181Snwhitehorn bsdinstall 53220500Snwhitehorn if [ $? -eq 0 ]; then 54220500Snwhitehorn dialog --backtitle "FreeBSD Installer" --title "Complete" --yes-label "Reboot" --no-label "Live CD" --yesno "Installation of FreeBSD complete! Would you like to reboot into the installed system now?" 0 0 && reboot 55220500Snwhitehorn else 56220500Snwhitehorn . /etc/rc.local 57220500Snwhitehorn fi 58219181Snwhitehorn ;; 59219181Snwhitehorn$DIALOG_CANCEL) # Live CD 60219181Snwhitehorn exit 0 61219181Snwhitehorn ;; 62219181Snwhitehorn$DIALOG_EXTRA) # Shell 63219181Snwhitehorn clear 64219181Snwhitehorn echo "When finished, type 'exit' to return to the installer." 65219181Snwhitehorn /bin/sh 66219181Snwhitehorn . /etc/rc.local 67219181Snwhitehorn ;; 68219181Snwhitehornesac 69219181Snwhitehorn 70