From 41b41682907f5d599de75e4d372dc4dfa1af45f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= Date: Wed, 23 Mar 2022 22:39:10 +0100 Subject: [PATCH] fff-network: Do not configure switch for ONE and TWO_PORT devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In a previous change all static configuration has been moved from configurenetwork to a static uci-defaults script. As the configuration of the switch is completely static, while port assignment for ONE and TWO_PORT devices is dynamic, this patch slightly changed the condition for the creation of the switch config. Instead of only configuring the switch, if ONE_PORT and TWO_PORT is not set, the switch is now always configured if a swconfig device is present. However, some ONE and TWO_PORT devices have a swconfig device, even though only a single physical port is connected to it. Those devices require an unconfigured switch to function properly. Therefore, introduce additional conditions, so the switch configuration is not generated if ONE_PORT or TWO_PORT is set. Fixes: 1c3328e64ad7 ("Remove static configuration from dynamic script") Signed-off-by: Fabian Bläse --- .../fff/fff-network/files/etc/uci-defaults/22-network-base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/fff/fff-network/files/etc/uci-defaults/22-network-base b/src/packages/fff/fff-network/files/etc/uci-defaults/22-network-base index 92f14c91..3d060057 100644 --- a/src/packages/fff/fff-network/files/etc/uci-defaults/22-network-base +++ b/src/packages/fff/fff-network/files/etc/uci-defaults/22-network-base @@ -71,7 +71,7 @@ if [ "$DSA" = "1" ]; then set network.${SWITCHDEV}_2.ports="$WAN_PORTS" __EOF__ fi -elif [ -n "$SWITCHHW" ]; then +elif [ -n "$SWITCHHW" ] && [ -z "$ONE_PORT" ] && [ -z "$TWO_PORT" ]; then uci batch <<-__EOF__ set network.$SWITCHDEV=switch set network.$SWITCHDEV.name=$SWITCHHW