]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - release/rc.local
Add (somewhat speculative) bootable CD support for PAPR/pSeries-type
[FreeBSD/FreeBSD.git] / release / rc.local
1 #!/bin/sh
2 # $FreeBSD$
3
4 : ${DIALOG_OK=0}
5 : ${DIALOG_CANCEL=1}
6 : ${DIALOG_HELP=2}
7 : ${DIALOG_EXTRA=3}
8 : ${DIALOG_ITEM_HELP=4}
9 : ${DIALOG_ESC=255}
10
11 TERM=xterm; export TERM # XXX: serial consoles
12
13 dialog --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
14
15 case $? in
16 $DIALOG_OK)     # Install
17         BSDINSTALL_CONFIGCURRENT=yes; export BSDINSTALL_CONFIGCURRENT
18         trap true SIGINT        # Ignore cntrl-C here
19         bsdinstall
20         if [ $? -eq 0 ]; then
21                 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
22         else
23                 . /etc/rc.local
24         fi
25         ;;
26 $DIALOG_CANCEL) # Live CD
27         exit 0
28         ;;
29 $DIALOG_EXTRA)  # Shell
30         clear
31         echo "When finished, type 'exit' to return to the installer."
32         /bin/sh
33         . /etc/rc.local
34         ;;
35 esac
36