mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-30 02:29:01 +00:00
mediatek: filogic: set wan label in preinit
Implement the functionality of
target/linux/ramips/patches-5.15/700-net-ethernet-mediatek-support-net-labels.patch
in userspace, since the driver patch has been rejected as a generic solution:
https://github.com/openwrt/openwrt/pull/11435
Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit 1dd1ac2c35
)
This commit is contained in:
parent
7764d482d9
commit
1dd9f26183
@ -0,0 +1,15 @@
|
||||
set_netdev_labels() {
|
||||
local dir
|
||||
local label
|
||||
local netdev
|
||||
|
||||
for dir in /sys/class/net/*; do
|
||||
[ -r "$dir/of_node/label" ] || continue
|
||||
label="$(cat "$dir/of_node/label")"
|
||||
netdev="$(basename $dir)"
|
||||
[ "$netdev" = "$label" ] && continue
|
||||
ip link set "$netdev" name "$label"
|
||||
done
|
||||
}
|
||||
|
||||
boot_hook_add preinit_main set_netdev_labels
|
Loading…
Reference in New Issue
Block a user