diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-12-03 15:46:43 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-12-03 15:46:43 +0000 |
commit | 6fcb567202bb8f54d004806c086b8918cc692adc (patch) | |
tree | 3f09ee6da5ab4d0a31e911d9e5a209131b94c730 /package/base-files/files/bin | |
parent | 0e3b0a4fc769c598b19c43e14b185da05d931e96 (diff) | |
download | master-187ad058-6fcb567202bb8f54d004806c086b8918cc692adc.tar.gz master-187ad058-6fcb567202bb8f54d004806c086b8918cc692adc.tar.bz2 master-187ad058-6fcb567202bb8f54d004806c086b8918cc692adc.zip |
base-files: config_generate: add missing chunks of force tag support
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47718 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/bin')
-rwxr-xr-x | package/base-files/files/bin/config_generate | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index 45dcd71616..1aa6d43e3f 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -109,12 +109,13 @@ generate_switch_vlan() { calculate_switch_vlans() { local switch="$1" - local ports port attr val - local prev_role - local num device role index - local n_cpu=0 cpu0 cpu1 cpu2 cpu3 - local dev0 dev1 dev2 dev3 role0 role1 role2 role3 - local n_vlan=0 vlan_off=-1 + local ports port attr val prev_role + local num device role index need_tag + local cpu0 cpu1 cpu2 cpu3 + local dev0 dev1 dev2 dev3 + local tag0 tag1 tag2 tag3 + local role0 role1 role2 role3 + local n_cpu=0 n_vlan=0 vlan_off=-1 local vlan_ports cpu_port json_get_keys ports ports @@ -124,7 +125,7 @@ calculate_switch_vlans() { # gather all cpu ports and count vlans for port in $ports; do json_select "$port" - json_get_vars num device role + json_get_vars num device role need_tag if json_is_a attr object; then json_get_keys attr attr @@ -149,6 +150,7 @@ calculate_switch_vlans() { if [ -n "$num" ] && [ -n "$device" ]; then export "cpu$n_cpu=$num" export "dev$n_cpu=$device" + export "tag$n_cpu=${need_tag:-0}" n_cpu=$((n_cpu + 1)) elif [ -n "$num" ] && [ -n "$role" ] && [ "$role" != "$prev_role" ]; then export "role$n_vlan=$role" |