lantiq: introduce lantiq_is_vdsl_system
authorMathias Kresin <dev@kresin.me>
Fri, 17 Feb 2017 21:04:12 +0000 (22:04 +0100)
committerMathias Kresin <dev@kresin.me>
Sat, 18 Feb 2017 15:52:05 +0000 (16:52 +0100)
Move the code to check if the current system is a system with vdsl
support to a dedicate function to make it reusable.

Signed-off-by: Mathias Kresin <dev@kresin.me>
target/linux/lantiq/base-files/etc/board.d/02_network
target/linux/lantiq/base-files/lib/functions/lantiq.sh

index 6ab5cb979e847e896675144468279e55475f86fc..41d6b7fab3a3d5e01d74620880b6805413bf55ad 100755 (executable)
@@ -168,7 +168,7 @@ if [ -n "$(ls /lib/modules/`uname -r`/ltq_atm*)" ]; then
        ucidef_add_atm_bridge "$vpi" "$vci" "$encaps" "$payload"
 fi
 
-if grep -qE "system type.*: (VR9|xRX200)" /proc/cpuinfo; then
+if lantiq_is_vdsl_system; then
        interface_wan="ptm0"
        ucidef_add_vdsl_modem "$annex" "av" "ptm"
 else
index e4eb4d723f19d147c36f2d7b2ef818b55e8b5f7f..630832e512ce0b8c759c3775951a92fa8c5800b0 100644 (file)
@@ -39,3 +39,7 @@ lantiq_get_dt_led() {
 
        echo "$label"
 }
+
+lantiq_is_vdsl_system() {
+       grep -qE "system type.*: (VR9|xRX200)" /proc/cpuinfo
+}