[source] lantiq: introduce lantiq_is_vdsl_system

LEDE Commits lede-commits at lists.infradead.org
Sat Feb 18 07:58:15 PST 2017


mkresin pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/6a6e3a4928010f7e9a04cf3b7f61ecc472df2273

commit 6a6e3a4928010f7e9a04cf3b7f61ecc472df2273
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Fri Feb 17 22:04:12 2017 +0100

    lantiq: introduce lantiq_is_vdsl_system
    
    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 at kresin.me>
---
 target/linux/lantiq/base-files/etc/board.d/02_network  | 2 +-
 target/linux/lantiq/base-files/lib/functions/lantiq.sh | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/target/linux/lantiq/base-files/etc/board.d/02_network b/target/linux/lantiq/base-files/etc/board.d/02_network
index 6ab5cb9..41d6b7f 100755
--- a/target/linux/lantiq/base-files/etc/board.d/02_network
+++ b/target/linux/lantiq/base-files/etc/board.d/02_network
@@ -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
diff --git a/target/linux/lantiq/base-files/lib/functions/lantiq.sh b/target/linux/lantiq/base-files/lib/functions/lantiq.sh
index e4eb4d7..630832e 100644
--- a/target/linux/lantiq/base-files/lib/functions/lantiq.sh
+++ b/target/linux/lantiq/base-files/lib/functions/lantiq.sh
@@ -39,3 +39,7 @@ lantiq_get_dt_led() {
 
 	echo "$label"
 }
+
+lantiq_is_vdsl_system() {
+	grep -qE "system type.*: (VR9|xRX200)" /proc/cpuinfo
+}



More information about the lede-commits mailing list