aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface
diff options
context:
space:
mode:
authorMartin Schiller <ms@dev.tdt.de>2017-10-09 08:26:01 +0200
committerMathias Kresin <dev@kresin.me>2017-10-15 11:11:29 +0200
commit2dc9c8206b7a452ab6977945206ce9384b2d5f3f (patch)
tree448dc67167a776a609f93b4b70c90c627ce2c11c /target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface
parent08bbb804c88a74cd7a04cea548cebf85bcf09b8f (diff)
downloadupstream-2dc9c8206b7a452ab6977945206ce9384b2d5f3f.tar.gz
upstream-2dc9c8206b7a452ab6977945206ce9384b2d5f3f.tar.bz2
upstream-2dc9c8206b7a452ab6977945206ce9384b2d5f3f.zip
lantiq: xrx200: rename nas0/ptm0 to dsl0
This change makes it possible to configure the wan/dsl ppp interface settings independantly from the used TC-Layer (ATM/PTM). Now you can move a device from an ADSL/ATM port to an VDSL/PTM port without any configuration changes for example. Signed-off-by: Martin Schiller <ms@dev.tdt.de> [use the dsl0 interface name for the default netdev trigger in 01_led, add ip dependency] Signed-off-by: Mathias Kresin <dev@kresin.me>
Diffstat (limited to 'target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface')
-rw-r--r--target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface57
1 files changed, 57 insertions, 0 deletions
diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface b/target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface
new file mode 100644
index 0000000000..1a7cd337e7
--- /dev/null
+++ b/target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+. /lib/functions.sh
+. /lib/functions/lantiq.sh
+
+IFNAME_CHANGED=0
+
+rename_xdsl_ifname()
+{
+ local cfg="$1"
+ local section="$2"
+ local option="$3"
+ local name
+
+ config_get name ${section} $option
+ case $name in
+ nas0*)
+ name=${name/nas0/dsl0}
+ ;;
+ ptm0*)
+ name=${name/ptm0/dsl0}
+ ;;
+ *)
+ return
+ ;;
+ esac
+
+ uci set ${cfg}.${section}.$option=$name
+ IFNAME_CHANGED=1
+}
+
+migrate_network_xdsl_ifname()
+{
+ rename_xdsl_ifname network "$1" ifname
+ rename_xdsl_ifname network "$1" name
+}
+
+migrate_led_xdsl_ifname()
+{
+ rename_xdsl_ifname system "$1" dev
+}
+
+lantiq_is_vdsl_system || exit 0
+
+config_load network
+config_foreach migrate_network_xdsl_ifname
+
+[ "$IFNAME_CHANGED" = "1" ] && uci commit network
+
+IFNAME_CHANGED=0
+
+config_load system
+config_foreach migrate_led_xdsl_ifname led
+
+[ "$IFNAME_CHANGED" = "1" ] && uci commit system
+
+exit 0