diff options
-rw-r--r-- | distrib/miniroot/install.sub | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 4402432ab06..77e4489efed 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,4 +1,4 @@ -# $OpenBSD: install.sub,v 1.691 2013/11/09 22:37:53 rpe Exp $ +# $OpenBSD: install.sub,v 1.692 2013/11/12 13:20: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 @@ -2099,25 +2099,27 @@ done get_responsefile() { # Fetching the response file requires DHCP, even if the # machine was booted via RARP and TFTP. - [ -x /sbin/dhclient ] || return + [[ -x /sbin/dhclient ]] || return # Did we do a netboot? BOOTDEV=$(get_ifdevs netboot) [[ -n $BOOTDEV ]] || 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 + # 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 - [ -s /var/db/dhclient.leases.$BOOTDEV ] || return # Get the "next-server" address? SERVER=$(sed "/next-server/s/^.* \([^ ]*\);$/\1/p;d" \ - /var/db/dhclient.leases.$BOOTDEV) + /var/db/dhclient.leases.$BOOTDEV 2>/dev/null) [[ -n $SERVER ]] || return - URL="http://$SERVER/install.conf" - ftp -o "$1" "$URL" - [ -s "$1" ] || return + ftp -o "$1" "http://$SERVER/install.conf" + [[ -s $1 ]] } # Fully automatic installation? |