Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # $FreeBSD: release/10.2.0/release/rc.local 272309 2014-09-30 16:36:50Z emaste $
- BSDBOX="/usr/share/bsdbox-2.0/bbinst"
- PATH_FSTAB="/tmp/bsdinstall_etc/fstab" # FStab file to make partedit work
- MACHINE=`uname -m`
- # resolv.conf from DHCP ends up in here, so make sure the directory exists
- mkdir /tmp/bsdinstall_etc
- kbdcontrol -d >/dev/null 2>&1
- if [ $? -eq 0 ]; then
- # Syscons: use xterm, start interesting things on other VTYs
- if [ ${MACHINE} = "pc98" ]; then
- TERM=cons25w
- else
- TERM=xterm
- fi
- # Don't send ESC on function-key 62/63 (left/right command key)
- kbdcontrol -f 62 '' > /dev/null 2>&1
- kbdcontrol -f 63 '' > /dev/null 2>&1
- if [ -z "$EXTERNAL_VTY_STARTED" ]; then
- # Init will clean these processes up if/when the system
- # goes multiuser
- touch /tmp/bsdinstall_log
- tail -f /tmp/bsdinstall_log > /dev/ttyv2 &
- /usr/libexec/getty autologin ttyv3 &
- EXTERNAL_VTY_STARTED=1
- fi
- else
- # Serial or other console
- echo
- echo "Welcome to `uname`!"
- echo
- echo "Please choose the appropriate terminal type for your system."
- echo "Common console types are:"
- echo " ansi Standard ANSI terminal"
- echo " vt100 VT100 or compatible terminal"
- echo " xterm xterm terminal emulator (or compatible)"
- echo " cons25w cons25w terminal"
- echo
- echo -n "Console type [vt100]: "
- read TERM
- TERM=${TERM:-vt100}
- fi
- export TERM
- while true
- do
- echo
- echo
- echo "Welcome to BSDBox Install"
- echo
- echo "You have these choices to choose from"
- echo
- echo "1. Install FreeBSD-10.3-RELEASE."
- echo "2. Install BSDBox 2.0"
- echo "3. Live filesystem"
- echo
- echo "4. Reboot"
- echo "5. Halt"
- echo
- echo
- echo -n "Press 1 - 5 to select an option: "
- read Options
- case $Options in
- 1)
- # if not netbooting, have the installer configure the network
- # This will make DHCP work
- 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 # trap control+c
- bsdinstall
- ;;
- 2)
- echo "entering the BSDBox installer"
- echo "Exit to return"
- echo
- $BSDBOX
- ;;
- 3)
- echo "Continuing to Live filesystem"
- exit
- ;;
- 4)
- echo "Rebooting"
- sleep 2
- reboot
- ;;
- 5)
- echo "Halting"
- sleep 2
- halt
- ;;
- esac
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement