Add support in filogic subtarget for our own custom property
`openwrt,netdev-name` in the device tree instead of `label` for
renaming interfaces. This was suggested upstream to avoid potential
conflicts [1].
[1] https://lore.kernel.org/netdev/
20240709124503.pubki5nwjfbedhhy@skbuf/
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
[ "$netdev" = "$label" ] && continue
ip link set "$netdev" name "$label"
done
+
+ for dir in /sys/class/net/*; do
+ [ -r "$dir/of_node/openwrt,netdev-name" ] || continue
+ read -r label < "$dir/of_node/openwrt,netdev-name"
+ netdev="${dir##*/}"
+ [ "$netdev" = "$label" ] && continue
+ ip link set "$netdev" name "$label"
+ done
}
boot_hook_add preinit_main set_netdev_labels