Re: Updating network file during boot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 15 Aug 2024 at 14:46, Silvio Knizek <killermoehre@xxxxxxx> wrote:
Am Donnerstag, dem 15.08.2024 um 14:07 +0100 schrieb Henti Smith:
> Hello again.
>
> I've tried multiple ways of matching and none seem to be working. 
>
> I removed all the configuration in /etc/systemd/network, run update-initramfs and rebooted.
>
> The resulting network configuration for the marvell devices was:
> root@av20-mvc-01:~# udevadm info /sys/class/net/eno2
> P: /devices/pci0000:00/0000:00:10.0/0000:05:00.0/net/eno2
> L: 0
> E: DEVPATH=/devices/pci0000:00/0000:00:10.0/0000:05:00.0/net/eno2
> E: INTERFACE=eno2
> E: IFINDEX=4
> E: SUBSYSTEM=net
> E: USEC_INITIALIZED=9048059
> E: ID_NET_NAMING_SCHEME=v245
> E: ID_NET_NAME_MAC=enx02000000000b
> E: ID_NET_NAME_ONBOARD=eno2
> E: ID_NET_LABEL_ONBOARD=Onboard ETHERNET Controller
> E: ID_NET_NAME_PATH=enp5s0
> E: ID_BUS=pci
> E: ID_VENDOR_ID=0x11ab
> E: ID_MODEL_ID=0x0f13
> E: ID_PCI_CLASS_FROM_DATABASE=Network controller
> E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
> E: ID_VENDOR_FROM_DATABASE=Marvell Technology Group Ltd.
> E: ID_PATH=pci-0000:05:00.0
> E: ID_PATH_TAG=pci-0000_05_00_0
> E: ID_NET_DRIVER=oak
> E: ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
> E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/eno2
> E: TAGS=:systemd:
>
> and:
> root@av20-mvc-01:~# udevadm info /sys/class/net/enp6s0
> P: /devices/pci0000:00/0000:00:11.0/0000:06:00.0/net/enp6s0
> L: 0
> E: DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:06:00.0/net/enp6s0
> E: INTERFACE=enp6s0
> E: IFINDEX=5
> E: SUBSYSTEM=net
> E: USEC_INITIALIZED=9004147
> E: ID_NET_NAMING_SCHEME=v245
> E: ID_NET_NAME_MAC=enx02000000000c
> E: ID_NET_NAME_PATH=enp6s0
> E: ID_BUS=pci
> E: ID_VENDOR_ID=0x11ab
> E: ID_MODEL_ID=0x0f13
> E: ID_PCI_CLASS_FROM_DATABASE=Network controller
> E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
> E: ID_VENDOR_FROM_DATABASE=Marvell Technology Group Ltd.
> E: ID_PATH=pci-0000:06:00.0
> E: ID_PATH_TAG=pci-0000_06_00_0
> E: ID_NET_DRIVER=oak
> E: ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
> E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/enp6s0
> E: TAGS=:systemd:
>
> As you can see it's generated by /usr/lib/systemd/network/99-default.link which uses OriginalName=*.
>
> Reading the man page the only options that can take glob matching are Path (ID_PATH), Driver (ID_NET_DRIVER), Type (DEVTYPE) and OriginalName (INTERFACE). 
>
> ID_PATH changes when the board is connected and not, it's not usable. 
> ID_NET_DRIVER is the same for both.
> DEVTYPE is not presented on these devices
>
> This only leaves INTERFACE, however the man page again states:
> This cannot be used to match on names that have already been changed from userspace. Caution is advised when matching on kernel-assigned names, as they are known to be unstable between reboots.
>
> Which seems to mean I'm back to square one.
>
> I was really hoping that I could use DEVPATH to glob match on, but this seems to not be possible. the only way to match on DEVPATH is using Property. however there is no glob matching with that option.
>
> Having said that, I'm thinking that since you can have multiple options using Property thata ll need to match, I can possbly create four link files with the two sets of PCI and Drives matching to ensure that with or without the board two interface will match.
>
> I will attempt this and feed back.
>
> Kind regards
> Henti

Hi Henti,

why can't you [Match] onto `Property="ID_NET_LABEL_ONBOARD=Onboard ETHERNET Controller"`? Is your systemd older than 243? Than you should really update.

BR
Silvio

Hi Silvio, 

I'm on systemd 245 (Ubuntu focal) and I can likely match on Property="ID_NET_LABEL_ONBOARD=Onboard ETHERNET Controller". I'll give that a test as well.

My existing config is using Path=pci-0000:05:00.0 and that works, but when I try to match on Property=Path=pci-0000:05:00.0 Driver=oak,it doesn't. this doesn't make sense to me.

I was hoping that I can have specific matches for hte PCI addresses and Drivers that I can use to match both sets of configuration with and without the hotplug board.

Henti

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux