aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2021-05-15 21:06:27 +0200
committerRafał Miłecki <rafal@milecki.pl>2021-05-27 11:39:15 +0200
commit892fc7caa9eee9f5ef9e172677f871c02841bae8 (patch)
treeffb8ff6024362084fbd5c8408c42096c7d13243c /package/base-files
parent4b691077e0ae658c3c3d4fc625b09a5b9f01f99d (diff)
downloadupstream-892fc7caa9eee9f5ef9e172677f871c02841bae8.tar.gz
upstream-892fc7caa9eee9f5ef9e172677f871c02841bae8.tar.bz2
upstream-892fc7caa9eee9f5ef9e172677f871c02841bae8.zip
base-files: generate "device" UCI type section for bridge
This switches from the old way of defining bridges in an "interface" UCI section type (that should be used for layer 3 only). From now a defualt board switch will have its own "device" UCI section type. It's a new & preferred way of defining L2 devices. Before: config interface 'lan' option type 'bridge' option ifname 'lan1 lan2 lan3 lan4' option proto 'static' option ipaddr '192.168.1.1' option netmask '255.255.255.0' After: config device option name 'lan' option type 'bridge' list ports 'lan1' list ports 'lan2' list ports 'lan3' list ports 'lan4' config interface 'lan' option ifname 'lan' option proto 'static' option ipaddr '192.168.1.1' option netmask '255.255.255.0' Signed-off-by: Rafał Miłecki <rafal@milecki.pl> (cherry picked from commit 43fc720657c6e3b30c6ed89d7227ee6e646c158b)
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/files/bin/config_generate10
1 files changed, 8 insertions, 2 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 56f6c4423b..0f6f280cf0 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -110,8 +110,14 @@ generate_network() {
}
[ -n "$ports" ] && {
- type="bridge"
- ifname="$ports"
+ uci -q batch <<-EOF
+ add network device
+ set network.@device[-1].name='$1'
+ set network.@device[-1].type='bridge'
+ EOF
+ for port in $ports; do uci add_list network.@device[-1].ports="$port"; done
+ ifname=$1
+ type=
}
[ -n "$bridge" ] && {