aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/realtek
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2021-11-29 14:18:14 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2021-12-05 18:49:14 +0100
commitafeda4a3d37cf3f9a2001a67e24d0cdbbdbc4cde (patch)
treec88554071984b4db2ffa23905772358f36a73c73 /target/linux/realtek
parent4304799b4abc31e37ed91f6270322de79133dd88 (diff)
downloadupstream-afeda4a3d37cf3f9a2001a67e24d0cdbbdbc4cde.tar.gz
upstream-afeda4a3d37cf3f9a2001a67e24d0cdbbdbc4cde.tar.bz2
upstream-afeda4a3d37cf3f9a2001a67e24d0cdbbdbc4cde.zip
realtek: sort the port list numerically
Mac adresses are assigned in the order given by the port list. The interfaces are also brought up in this order. This target supports devices with up to 52 ports. Sorting these alphabetically is very confusing, and assigning mac addresses in alphabetic order does not match stock firmware behaviour. Suggested-by: Sander Vanheule <sander@svanheule.net> Signed-off-by: Bjørn Mork <bjorn@mork.no>
Diffstat (limited to 'target/linux/realtek')
-rw-r--r--target/linux/realtek/base-files/etc/board.d/02_network5
1 files changed, 1 insertions, 4 deletions
diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network
index 93d6d4bd1e..e8e3f6035d 100644
--- a/target/linux/realtek/base-files/etc/board.d/02_network
+++ b/target/linux/realtek/base-files/etc/board.d/02_network
@@ -17,10 +17,7 @@ ucidef_set_poe() {
board=$(board_name)
board_config_update
-lan_list=""
-for lan in /sys/class/net/lan*; do
- lan_list="$lan_list $(basename $lan)"
-done
+lan_list=$(ls -1 -v -d /sys/class/net/lan* | xargs -n1 basename | xargs)
ucidef_set_bridge_device switch
ucidef_set_interface_lan "$lan_list"