[systemd-devel] How to set both name and altname of a NIC with a given device_addr

Lennart Poettering lennart at poettering.net
Mon May 27 15:05:52 UTC 2024


On Mo, 27.05.24 16:59, Lars Petter Mostad (larspm at gmail.com) wrote:

> Hi,
>
> Currently I'm using a udev rule to set a known name for a network
> interface connected
> to certain pins on an SoC, then I use a .link file to set altnames for
> that interface.
> The udev rule matches the base address of the memory mapped registers of the MAC
> connected to the given pins (e.g. ATTR{device_addr}=="1af0000"). The .link file
> matches the OriginalName set by the udev rule.

Hmm, what? that's not an "original" name if it's already change by the
udev rule.

Please do the renaming in .link files only, both the main name and the
alternative name. To match the device properly in the .link file,
given your slightly unusual sysattr match, please write a udev rule
that sets some udev property of your choice,
i.e. ENV{VENDORXYZ_MYFANCYDEVICE}=1 and then match against that prop
in the .link file via Property=. And stop matching via OriginalName=.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list