diff options
-rw-r--r-- | distrib/miniroot/install.sub | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 3125ba3a3ef..a592032de17 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,4 +1,4 @@ -# $OpenBSD: install.sub,v 1.705 2013/11/28 22:56:05 rpe Exp $ +# $OpenBSD: install.sub,v 1.706 2013/11/29 02:02:47 rpe Exp $ # $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $ # # Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback @@ -2111,45 +2111,45 @@ done # Fetch a response file from the "netboot" interface. get_responsefile() { - local _bootdev _f _mac _mode _server + local _f _ifdev _mac _mode _server # Fetching the response file requires DHCP, even if the # machine was booted via RARP and TFTP. [[ -x /sbin/dhclient ]] || return # Select network interface for initial dhcp request - _bootdev=$(get_ifdevs netboot) - if [[ -z $_bootdev ]]; then + _ifdev=$(get_ifdevs netboot) + if [[ -z $_ifdev ]]; then set -- $(get_ifdevs) (($#)) || return if (($# == 1)); then - _bootdev=$1 + _ifdev=$1 else while :; do ask_which "network interface" \ "should be used for the initial DHCP request" \ "$*" - isin "$resp" $* && _bootdev=$resp && break + isin "$resp" $* && _ifdev=$resp && break done fi fi - [[ -n $_bootdev ]] || return + [[ -n $_ifdev ]] || return # Take interface down killing a dhclient from a previous attempt # and so free up the only bpf which exists in this installstage. - ifconfig $_bootdev down + ifconfig $_ifdev down # Try to get a DHCP lease. This whole process is done in the # background, so it doesn't matter how long the timeout is. - dhclient $_bootdev + dhclient $_ifdev # Extract next-server IP and the installer mode from attributes # in the dhcp lease file. Use this together with the MAC from the # netboot interface to assemble the URL. _server=$(sed "/next-server/s/^.* \([^ ]*\);$/\1/p;d" \ - /var/db/dhclient.leases.$_bootdev 2>/dev/null) + /var/db/dhclient.leases.$_ifdev 2>/dev/null) _mode=$(sed -E '/filename/s/^.*auto_(install|upgrade).*$/\1/p;d' \ - /var/db/dhclient.leases.$_bootdev 2>/dev/null) - _mac=$(ifconfig $_bootdev | sed 's/.*lladdr \(.*\)/\1/p;d') + /var/db/dhclient.leases.$_ifdev 2>/dev/null) + _mac=$(ifconfig $_ifdev | sed 's/.*lladdr \(.*\)/\1/p;d') for _f in $_mac-$_mode $_mode; do ftp -o "/$_mode.conf" "http://$_server/$_f.conf" @@ -2162,7 +2162,7 @@ if $auto && [[ -z $RESPONSEFILE ]]; then action= get_responsefile if [[ -z $action ]]; then - echo "No response file found; automatic installation aborted." + echo "No response file found; non-interactive mode aborted." exit 1 fi rm -f /ai.done |