Fix automatic upgrade after fetching response file with dhcp.
authorbluhm <bluhm@openbsd.org>
Tue, 24 Aug 2021 21:50:09 +0000 (21:50 +0000)
committerbluhm <bluhm@openbsd.org>
Tue, 24 Aug 2021 21:50:09 +0000 (21:50 +0000)
When the auto upgrader tried to fetch the sets, sometimes ftp did
not find any.  The interface was down and had no address.  As
autoconf was not cleared, the upgrade's static netstart and dhcpleased
both tried to configure the interface, which cannot work.

Disable dhcp with "ifconfig inet -autoconf" in get_responsefile()
after it is not used anymore.

OK florian@

distrib/miniroot/install.sub

index d09093b..dfd396c 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/ksh
-#      $OpenBSD: install.sub,v 1.1172 2021/08/09 13:56:17 sthen Exp $
+#      $OpenBSD: install.sub,v 1.1173 2021/08/24 21:50:09 bluhm Exp $
 #
 # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback
 # Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org>
@@ -656,7 +656,8 @@ get_responsefile() {
                        echo "Fetching $_url"
                        if unpriv ftp -Vo - "$_url" \
                                >"/tmp/ai/ai.$AI_MODE.conf" 2>/dev/null; then
-                               ifconfig $_if delete down 2>/dev/null
+                               ifconfig $_if inet -autoconf delete down \
+                                   2>/dev/null
                                rm /var/db/dhcpleased/$_if
                                return 0
                        fi
@@ -685,7 +686,7 @@ get_responsefile() {
        echo "Fetching $_rf"
        [[ -f $_rf ]] && _rf="file://$_rf"
        if unpriv ftp -Vo - "$_rf" >"/tmp/ai/ai.$AI_MODE.conf" 2>/dev/null; then
-               ifconfig $_if delete down 2>/dev/null
+               ifconfig $_if inet -autoconf delete down 2>/dev/null
                return 0
        fi
        return 1