Index: release/rc.local =================================================================== --- release/rc.local +++ release/rc.local @@ -55,35 +55,59 @@ else dialog --backtitle "FreeBSD Installer" --title "Error" --textbox /tmp/bsdinstall_log 0 0 fi - exit + exit fi -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 - -case $? in -$DIALOG_OK) # Install - # If not netbooting, have the installer configure the network - dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` - if [ ${dlv:=0} -eq 0 -a ! -f /etc/diskless ]; then - BSDINSTALL_CONFIGCURRENT=yes; export BSDINSTALL_CONFIGCURRENT - fi - - trap true SIGINT # Ignore cntrl-C here - bsdinstall - if [ $? -eq 0 ]; then - 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 - else - . /etc/rc.local - fi - ;; -$DIALOG_CANCEL) # Live CD - exit 0 - ;; -$DIALOG_EXTRA) # Shell - clear - echo "When finished, type 'exit' to return to the installer." - /bin/sh - . /etc/rc.local - ;; -esac +while [ 1 ] +do + exec 3>&1 + selection=$(dialog \ + --backtitle "FreeBSD Installer" \ + --title "Welcome" \ + --clear \ + --cancel-label "Reboot" \ + --nocancel \ + --menu "Welcome to FreeBSD! Would you like to begin an installation, restore a system or use the live CD?" \ + 0 0 4 \ + "1" "Install" \ + "2" "Shell" \ + "3" "Live CD" \ + "4" "Reboot" \ + 2>&1 1>&3) + exit_status=$? + exec 3>&- + case $exit_status in + $DIALOG_OK) # Install + ;; + $DIALOG_ESC) + clear + continue + ;; + esac + case $selection in + 1) # Install + # If not netbooting, have the installer configure the network + dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` + if [ ${dlv:=0} -eq 0 -a ! -f /etc/diskless ]; then + BSDINSTALL_CONFIGCURRENT=yes; export BSDINSTALL_CONFIGCURRENT + fi + trap true SIGINT # Ignore cntrl-C here + bsdinstall + if [ $? -eq 0 ]; then + 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 + fi + ;; + 2) # Shell + clear + echo "When finished, type 'exit' to return to the main menu." + /bin/sh + ;; + 3) # Live cd + exit 0 + ;; + 4) # Reboot + reboot + ;; + esac +done