aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/bin/config_generate
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-12-04 09:56:55 +0000
committerJo-Philipp Wich <jow@openwrt.org>2015-12-04 09:56:55 +0000
commit6c8daa6ba3e39cfb5373eff1297c798676ef76eb (patch)
tree544aa2f43005c3cfd7096ac88238241146869b28 /package/base-files/files/bin/config_generate
parent813227d9924b75d393a7a372ee09d0543d12f2c2 (diff)
downloadupstream-6c8daa6ba3e39cfb5373eff1297c798676ef76eb.tar.gz
upstream-6c8daa6ba3e39cfb5373eff1297c798676ef76eb.tar.bz2
upstream-6c8daa6ba3e39cfb5373eff1297c798676ef76eb.zip
base-files: board.d: support dsl modems, atm bridges and pppoe protocol
This adds support for specifying the dsl modem, atm bridge configs and setting the pppoe protocol for wan. These additions are required to port the Lantiq target to board.d. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47750
Diffstat (limited to 'package/base-files/files/bin/config_generate')
-rwxr-xr-xpackage/base-files/files/bin/config_generate50
1 files changed, 50 insertions, 0 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 02f6998c84..49784ebfae 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -18,6 +18,40 @@ generate_static_network() {
set network.globals='globals'
set network.globals.ula_prefix='auto'
EOF
+
+ if json_is_a dsl object; then
+ json_select dsl
+ if json_is_a atmbridge object; then
+ json_select atmbridge
+ local vpi vci encaps payload
+ json_get_vars vpi vci encaps payload
+ uci -q batch <<-EOF
+ delete network.atm
+ set network.atm='atm-bridge'
+ set network.atm.vpi='$vpi'
+ set network.atm.vci='$vci'
+ set network.atm.encaps='$encaps'
+ set network.atm.payload='$payload'
+ EOF
+ json_select ..
+ fi
+
+ if json_is_a modem object; then
+ json_select modem
+ local type annex firmware tone xfer_mode
+ json_get_vars type annex firmware tone xfer_mode
+ uci -q batch <<-EOF
+ delete network.dsl
+ set network.dsl='$type'
+ set network.dsl.annex='$annex'
+ set network.dsl.firmware='$firmware'
+ set network.dsl.tone='$tone'
+ set network.dsl.xfer_mode='$xfer_mode'
+ EOF
+ json_select ..
+ fi
+ json_select ..
+ fi
}
addr_offset=2
@@ -74,6 +108,22 @@ generate_network() {
set network.${1}6.proto='dhcpv6'
EOF
;;
+
+ pppoe)
+ # fixup IPv6 slave interface
+ ifname="pppoe-$1"
+
+ uci -q batch <<-EOF
+ set network.$1.proto='pppoe'
+ set network.$1.username='username'
+ set network.$1.password='password'
+ set network.$1.ipv6='auto'
+ delete network.${1}6
+ set network.${1}6='interface'
+ set network.${1}6.ifname='$ifname'
+ set network.${1}6.proto='dhcpv6'
+ EOF
+ ;;
esac
}