View | Details | Raw Unified | Return to bug 201419
Collapse All | Expand All

(-)release/rc.local (-15 / +34 lines)
Lines 53-77 Link Here
53
export TERM
53
export TERM
54
54
55
if [ -f /etc/installerconfig ]; then
55
if [ -f /etc/installerconfig ]; then
56
	if bsdinstall script /etc/installerconfig; then
56
	choice=$DIALOG_HELP # Select autoinstall
57
		dialog --backtitle "FreeBSD Installer" --title "Complete" --no-cancel --ok-label "Reboot" --pause "Installation of FreeBSD complete! Rebooting in 10 seconds" 10 30 10
57
else
58
		reboot
58
	dialog --backtitle "FreeBSD Installer" --title "Welcome" --extra-button --extra-label "Shell" --ok-label "Install" --cancel-label "Live CD" --help-button --help-label "Autoinstall" --yesno "Welcome to FreeBSD! Would you like to begin an installation or use the live CD?" 0 0
59
	else
59
	choice=$?
60
		dialog --backtitle "FreeBSD Installer" --title "Error" --textbox /tmp/bsdinstall_log 0 0
61
	fi
62
	exit 
63
fi
60
fi
64
61
65
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
62
# If not netbooting, have the installer configure the network
63
dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null`
64
if [ ${dlv:=0} -eq 0 -a ! -f /etc/diskless ]; then
65
	BSDINSTALL_CONFIGCURRENT=yes; export BSDINSTALL_CONFIGCURRENT
66
fi
66
67
67
case $? in
68
case $choice in
68
$DIALOG_OK)	# Install
69
$DIALOG_OK)	# Install
69
	# If not netbooting, have the installer configure the network
70
	dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null`
71
	if [ ${dlv:=0} -eq 0 -a ! -f /etc/diskless ]; then
72
		BSDINSTALL_CONFIGCURRENT=yes; export BSDINSTALL_CONFIGCURRENT
73
	fi
74
75
	trap true SIGINT	# Ignore cntrl-C here
70
	trap true SIGINT	# Ignore cntrl-C here
76
	bsdinstall
71
	bsdinstall
77
	if [ $? -eq 0 ]; then
72
	if [ $? -eq 0 ]; then
Lines 89-93 Link Here
89
	/bin/sh
84
	/bin/sh
90
	. /etc/rc.local
85
	. /etc/rc.local
91
	;;
86
	;;
87
$DIALOG_HELP)	# Autoinstall
88
	if [ -f /etc/installerconfig ]; then
89
		installerconfig=/etc/installerconfig
90
	else
91
		installerconfig=/tmp/installerconfig
92
		bsdinstall netconfig
93
		for leasefile in /var/db/dhclient.leases.*; do
94
			[ -e "$leasefile" ] || { dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox "No DHCP lease found" 0 0 && exit; }
95
			configurl=$(sed -E '/^ *filename "(.*)";$/!d;s//\1/;q' $leasefile) && break
96
		done
97
		if ! ftp -Vo "$installerconfig" "$configurl"; then
98
			dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox "URL '$configurl' could not be downloaded for autoinstall" 0 0
99
			exit
100
		fi
101
102
	fi
103
	if bsdinstall script "$installerconfig"; then
104
		dialog --backtitle "FreeBSD Installer" --title "Complete" --no-cancel --ok-label "Reboot" --pause "Installation of FreeBSD complete! Rebooting in 10 seconds" 10 30 10
105
		reboot
106
	else
107
		dialog --backtitle "FreeBSD Installer" --title "Error" --textbox /tmp/bsdinstall_log 0 0
108
	fi
109
	exit 
110
	;;
92
esac
111
esac
93
112

Return to bug 201419