From 983222605ce6fabb036fbbd5797b6689ed082136 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 30 May 2024 14:38:56 +0100 Subject: [PATCH] mediatek: filogic: avoid sub-shell invovation in netdev rename loop Rename network devices to their label set in DT without invocation of a sub-shell. Signed-off-by: Daniel Golle --- .../filogic/base-files/lib/preinit/04_set_netdev_label | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/04_set_netdev_label b/target/linux/mediatek/filogic/base-files/lib/preinit/04_set_netdev_label index f8b6f155de..110e023b96 100644 --- a/target/linux/mediatek/filogic/base-files/lib/preinit/04_set_netdev_label +++ b/target/linux/mediatek/filogic/base-files/lib/preinit/04_set_netdev_label @@ -5,8 +5,8 @@ set_netdev_labels() { for dir in /sys/class/net/*; do [ -r "$dir/of_node/label" ] || continue - label="$(cat "$dir/of_node/label")" - netdev="$(basename $dir)" + read -r label < "$dir/of_node/label" + netdev="${dir##*/}" [ "$netdev" = "$label" ] && continue ip link set "$netdev" name "$label" done -- 2.30.2