mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-01 13:23:01 +02:00
board/common: nameif: Make switch port marking more robust
Let's operate on JSON data, so that we're less vulnerable to output changes in devlink.
This commit is contained in:
committed by
Joachim Wiberg
parent
c5eed505fe
commit
7d1580ca21
@@ -30,7 +30,9 @@ for netif in /sys/class/net/*; do
|
||||
done
|
||||
|
||||
# Find and mark all switch ports
|
||||
ports=$(devlink port 2>/dev/null | awk '/flavour physical/{print $5}')
|
||||
ports=$(devlink -j port | jq -r '.port[]
|
||||
| select(.flavour == "physical")
|
||||
| .netdev')
|
||||
for iface in $ports; do
|
||||
ip link set "$iface" group port
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user