Index: rc.local =================================================================== diff --git a/head/release/rc.local b/head/release/rc.local --- a/head/release/rc.local (revision 292123) +++ b/head/release/rc.local (working copy) @@ -52,8 +52,24 @@ fi export TERM -if [ -f /etc/installerconfig ]; then - if bsdinstall script /etc/installerconfig; then +INSTALLERCONFIG=`kenv -q bsdinstall.script` +if [ -n "${INSTALLERCONFIG}" -a ! -f "${INSTALLERCONFIG}" ] && kenv -q boot.tftproot.path >/dev/null ; then + # Check if we are booting from network + ether=`kenv -q pxeboot.hwaddr` + for iface in `ifconfig -l`; do + ifconfig $iface | grep -q "$ether" && break + done + dhclient -q $iface 2>/dev/null + tftpip=`kenv -q boot.netif.server` + tftprootpath=`kenv -q boot.tftproot.path` + if ! echo "get $tftprootpath/${INSTALLERCONFIG} /tmp/installerconfig" | tftp $tftpip 2>/tmp/tftperror; then + dialog --backtitle "FreeBSD Installer" --title "Error" --textbox /tmp/tftperror 0 0 + exit + fi + INSTALLERCONFIG=/tmp/installerconfig +fi +if [ -f "${INSTALLERCONFIG}" ]; then + if bsdinstall script ${INSTALLERCONFIG}; then dialog --backtitle "FreeBSD Installer" --title "Complete" --no-cancel --ok-label "Reboot" --pause "Installation of FreeBSD complete! Rebooting in 10 seconds" 10 30 10 reboot else