]> xenbits.xensource.com Git - osstest.git/commit
preseed_base: Use "keep" NIC NamePolicy when "force-mac-address"
authorAnthony PERARD <anthony.perard@vates.tech>
Fri, 14 Jun 2024 11:28:30 +0000 (11:28 +0000)
committerAnthony PERARD <anthony@xenproject.org>
Wed, 31 Jul 2024 14:04:23 +0000 (16:04 +0200)
commit3ed6e92c6e8d51a06b9010da794d4eda53ff543e
treec452bb2652dcb86864d24e34e90aafed1ca77316
parentf3e1a3abe2ef3d2c7385f2a4114e7174dc92a81c
preseed_base: Use "keep" NIC NamePolicy when "force-mac-address"

We have a few machine (arndale-*) that have a nic without mac address,
so the kernel assign a random one. For those there's a flags
"force-mac-address" which tells osstest to make it so that the machine
changes the mac address to a predefined one at boot. This normally
tells systemd rules to not use the mac address to rename the network
interface as it a temporary mac, but that doesn't always work.
(Machine installed by osstest should use the mac namepolicy otherwise,
since 367166c32329 ("preseed_base, ts-host-install: Change NIC
NamePolicy to "mac"")).

Often, on the branch "linux-linus", so with more recent version of
Linux, the network interface gets renamed sometime with the "mac"
namepolicy which break networking. These are the kernel messages when
the rename happen:

> usb 1-3.2.4: new high-speed USB device number 4 using exynos-ehci
> asix 1-3.2.4:1.0 (unnamed net_device) (uninitialized): invalid hw address, using random
> asix 1-3.2.4:1.0 (unnamed net_device) (uninitialized): PHY [usb-001:004:10] driver [Asix Electronics AX88772A] (irq=POLL)
> asix 1-3.2.4:1.0 eth0: register 'asix' at usb-12110000.usb-3.2.4, ASIX AX88772 USB 2.0 Ethernet, 06:85:e5:95:f0:7c
> usbcore: registered new device driver onboard-usb-dev
> usb 1-3.2.4: USB disconnect, device number 4
> asix 1-3.2.4:1.0 eth0: unregister 'asix' usb-12110000.usb-3.2.4, ASIX AX88772 USB 2.0 Ethernet
> hub 1-3.2:1.0: USB hub found
> hub 1-3.2:1.0: 4 ports detected
> hub 1-3.2:1.0: USB hub found
> hub 1-3.2:1.0: 4 ports detected
> usb 1-3.2.4: new high-speed USB device number 5 using exynos-ehci
> asix 1-3.2.4:1.0 (unnamed net_device) (uninitialized): PHY [usb-001:005:10] driver [Asix Electronics AX88772A] (irq=POLL)
> Asix Electronics AX88772A usb-001:005:10: attached PHY driver (mii_bus:phy_addr=usb-001:005:10, irq=POLL)
> asix 1-3.2.4:1.0 eth0: register 'asix' at usb-12110000.usb-3.2.4, ASIX AX88772 USB 2.0 Ethernet, 06:85:e5:95:f0:7c
> asix 1-3.2.4:1.0 enx0685e595f07c: renamed from eth0

The "xenbr0" bridge is setup to use "eth0", because that was the name
of the nic during setup, so with a new name for the main interface the
bridge doesn't work.

In order to avoid the issue, we will use the NamePolicy "keep" when
there is a flag "force-mac-address", which keep the original name of
the interface (eth0). That flags only works if there's a single
network interface, so we can expect "eth0" to always be the same
interface.

Even if the problem so far exhibit only at runtime after rebooting
under Xen (which is fixed by a change in preseed_base()), we will also
add the policy change to the installer (change in ts-host-install), to
be future proof.

(The filename of the policy is to have it apply before
"73-usb-net-by-mac.link" that is installed on the system.)

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Osstest/Debian.pm
ts-host-install