fff-network: Do not configure switch for ONE and TWO_PORT devices

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: 1c3328e64a ("Remove static configuration from dynamic script")

Signed-off-by: Fabian Bläse <fabian@blaese.de>
This commit is contained in:
Fabian Bläse 2022-03-23 22:39:10 +01:00
parent 0234203bed
commit 41b4168290
1 changed files with 1 additions and 1 deletions

View File

@ -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