1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-16 03:24:49 +03:00
Sean Anderson 65c2ad985a udev: net_id: Use devicetree aliases when available
Devicetree firmware contains an "aliases" node, containing various
aliases for devices described by the firmware. For ethernet devices,
these are named "ethernet0", "ethernet1", etc. They provide a convenient
means of numbering ethernet devices, especially on systems with no other
stable number other than the address. In particular, U-Boot already uses
these aliases to name its ethernet devices.

Previously, there have been attempts (such as [1]) to add support for
these aliases to Linux. However, these patches have been rejected
because it is the maintainers' view that naming policy be left to
userspace. Well, systemd is userspace, so here we are.

In terms of implementation, apparently there can be multiple device
trees at once. I have decided to dodge this problem for now, and just
use /proc/device-tree. If it is desired to support multiple device trees
later, then the scheme can be modified to include the device tree's
index. For example, /sys/firmware/devicetree/base2/aliases/ethernet3
might be named enb2d3.

For the moment we only support "ethernetX" aliases. Future patches might
want to also handle "canX" and "wifiX".

It is common on boards with only one ethernet device to use an alias of
just "ethernet". In this case, the index is an implicit 0. In case the
author of the firmware made a mistake, we check to ensure that aliases
of "ethernet" and "ethernet0" do not both exist.

[1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/1399390594-1409-1-git-send-email-boris.brezillon@free-electrons.com/

Closes: #17625
2022-08-12 11:15:16 +02:00
..
2022-01-07 17:37:37 +01:00
2022-06-28 13:10:05 +02:00
2021-10-07 22:13:12 +02:00
2022-06-28 16:05:31 +02:00
2022-06-28 13:10:05 +02:00
2022-07-20 13:15:37 +09:00
2022-06-28 13:10:05 +02:00
2021-08-18 13:36:14 +02:00
2022-07-20 13:15:37 +09:00
2022-06-28 13:10:05 +02:00
2022-03-07 15:32:22 +09:00
2020-12-16 17:21:48 +01:00
2021-01-04 11:01:17 +00:00
2021-06-30 23:33:00 +09:00
2021-01-04 11:01:17 +00:00
2022-01-06 22:20:11 +09:00
2021-11-30 13:54:27 +01:00
2022-05-26 14:29:50 +02:00
2022-08-03 18:51:45 +02:00
2022-07-19 10:41:13 +01:00
2021-04-19 23:16:02 +02:00
2022-07-23 11:18:23 +09:00
2022-04-12 11:02:16 +02:00
2022-08-02 02:43:38 +09:00
2022-03-21 20:06:13 +00:00
2022-07-15 10:53:45 +02:00
2022-07-19 10:41:13 +01:00
2020-11-09 13:23:58 +09:00
2022-03-13 18:30:57 +00:00
2020-12-16 17:21:48 +01:00
2022-05-11 19:12:24 +01:00