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>v19.07.3_mercusys_ac12_duma
parent
08bbb804c8
commit
2dc9c8206b
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$ACTION" = add ]; then
|
||||
[ "$DEVICENAME" = "nas0" ] ||[ "$DEVICENAME" = "ptm0" ] || exit
|
||||
|
||||
ip link set $DEVICENAME name dsl0
|
||||
fi
|
@ -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
|
Loading…
Reference in New Issue