current preinit code in base-files doesn't config switch when there are
no port roles defined. But this kind of configuration exists on single
port devices where switch vlan is simply disabled.
configure reset and enable_vlan property when a switch node exist.
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
include $(INCLUDE_DIR)/feeds.mk
PKG_NAME:=base-files
include $(INCLUDE_DIR)/feeds.mk
PKG_NAME:=base-files
PKG_FLAGS:=nonshared
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
PKG_FLAGS:=nonshared
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
json_get_vars enable reset
json_get_vars enable reset
+ if [ "$reset" -eq "1" ]; then
+ swconfig dev $name set reset
+ fi
+ swconfig dev $name set enable_vlan $enable
+
if json_is_a roles array; then
json_get_keys roles roles
json_select roles
if json_is_a roles array; then
json_get_keys roles roles
json_select roles
json_select ..
if [ "$device" = "$lan_if" ]; then
json_select ..
if [ "$device" = "$lan_if" ]; then
- if [ "$reset" -eq "1" ]; then
- swconfig dev $name set reset
- fi
-
- swconfig dev $name set enable_vlan $enable
swconfig dev $name vlan $role set ports "$ports"
swconfig dev $name vlan $role set ports "$ports"
- swconfig dev $name set apply
fi
done
json_select ..
fi
fi
done
json_select ..
fi
+ swconfig dev $name set apply
+
json_select ..
json_select ..
}
json_select ..
json_select ..
}