Re: Updating network file during boot

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

 



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

On Thu, 15 Aug 2024 at 13:00, Henti Smith <henti@xxxxxxxxxxxxxxxxx> wrote:
This does not seem to work, and reading the man page, "Path" matches against the udev property ID_PATH, which in this case is will be the changing addresses for example "pci-0000:05:00.0"

I'll play some more and see what other options I have.

Kind regards
Henti


On Thu, 15 Aug 2024 at 12:46, Andrei Borzenkov <arvidjaar@xxxxxxxxx> wrote:
On Thu, Aug 15, 2024 at 2:37 PM Henti Smith <henti@xxxxxxxxxxxxxxxxx> wrote:
>
>
> They do stay the same:
>
> Without the Board:
> DEVPATH=/devices/pci0000:00/0000:00:10.0/0000:04:00.0/net/eno2
> DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:05:00.0/net/mvc-sw1
>
> With the Board:
> DEVPATH=/devices/pci0000:00/0000:00:10.0/0000:05:00.0/net/mvc-sw2
> DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:06:00.0/net/enp6s0
>
> I'm assuming I can use this to match using glob ?
>
> If so, do I use the existing Path= or do I switch to DEVPATH ?
>

I have not tried it myself, but according to the manual page Path should do.

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

  Powered by Linux