I think this is the bits the installer needs.  I might adjust
/etc/netstart to use this glob or this to use *:*, still thinking on it.

It's a bit simpler because I figured the installer could be quieter
so I could just return instead of printing errors first.

I haven't tested this yet.  We'll see how my time is today with the US
holiday, but too much further work will probably be pushed to the
weekend.

With the discussion otherwhere in the thread, I assume that `ifconfig
-M` is going to start filtering dynamic interfaces so we're safe
starting by lladdr early instead of mapping it to a name and putting it
into the appropriate dynamic interface list.

Index: distrib/miniroot/install.sub
===================================================================
RCS file: /cvs/src/distrib/miniroot/install.sub,v
retrieving revision 1.1214
diff -u -p -r1.1214 install.sub
--- distrib/miniroot/install.sub        6 Nov 2022 21:32:54 -0000       1.1214
+++ distrib/miniroot/install.sub        24 Nov 2022 18:49:30 -0000
@@ -2431,6 +2431,12 @@ ifstart() {
        local _if=$1 _hn=/mnt/etc/hostname.$1 _cmds _i=0 _line
        set -A _cmds
 
+       if [[ $_if = ??:??:??:??:??:?? ]]; then
+               _if=$(ifconfig -M $_if)
+               [[ -z $_if ]]                   && return # invalid interface
+               [[ -e /mnt/etc/hostname.$_if ]] && return # duplicate config
+       fi
+
        # Create interface if it does not yet exist.
        { ifconfig $_if || ifconfig $_if create; } >/dev/null 2>&1 || return
 
@@ -2472,6 +2478,9 @@ enable_ifs() {
                        svlan)  _svlans="$_svlans $_if";;
                        vlan)   _vlans="$_vlans $_if";;
                        esac
+               elif [[ $_if = ??:??:??:??:??:?? ]]; then
+                       # start by lladdr
+                       ifstart $_if
                else
                        # 'Real' interfaces (if available) are done now.
                        ifconfig $_if >/dev/null 2>&1 && ifstart $_if

Reply via email to