aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-03-07 11:03:13 +0000
committerFelix Fietkau <nbd@openwrt.org>2016-03-07 11:03:13 +0000
commitda607ff53e673bae9f202351331ea84943d50c46 (patch)
tree62888b88918f939775cb9db093b94f1f19a7727c /package
parent7368864485e5e8e8d0edf49fcef245e8de4be243 (diff)
downloadmaster-187ad058-da607ff53e673bae9f202351331ea84943d50c46.tar.gz
master-187ad058-da607ff53e673bae9f202351331ea84943d50c46.tar.bz2
master-187ad058-da607ff53e673bae9f202351331ea84943d50c46.zip
ltq-vdsl-app: load the vrx200 firmware or patch it
This checks for the VRX firmware provided in the OpenWrt package. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48940 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r--package/network/config/ltq-vdsl-app/Makefile2
-rw-r--r--package/network/config/ltq-vdsl-app/files/dsl_control42
2 files changed, 43 insertions, 1 deletions
diff --git a/package/network/config/ltq-vdsl-app/Makefile b/package/network/config/ltq-vdsl-app/Makefile
index bfacccd40c..ffaf942e54 100644
--- a/package/network/config/ltq-vdsl-app/Makefile
+++ b/package/network/config/ltq-vdsl-app/Makefile
@@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ltq-vdsl-app
PKG_VERSION:=4.16.6.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_BASE_NAME:=dsl_cpe_control
PKG_SOURCE:=$(PKG_BASE_NAME)_vrx-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
diff --git a/package/network/config/ltq-vdsl-app/files/dsl_control b/package/network/config/ltq-vdsl-app/files/dsl_control
index fc100cfb0e..c4c3c0d601 100644
--- a/package/network/config/ltq-vdsl-app/files/dsl_control
+++ b/package/network/config/ltq-vdsl-app/files/dsl_control
@@ -153,6 +153,48 @@ start_service() {
;;
esac
+ if [ -z "${firmware}" ]; then
+ # search for the firmware provided by dsl-vrx200-firmware-xdsl-*
+ if grep -qE "system type.*: (VR9|xRX200)" /proc/cpuinfo; then
+ case "${annex}" in
+ a|l|m)
+ if [ -f "/lib/firmware/lantiq-vrx200-a.bin" ]; then
+ firmware="/lib/firmware/lantiq-vrx200-a.bin"
+ elif [ -f "/tmp/lantiq-vrx200-a.bin" ]; then
+ firmware="/tmp/lantiq-vrx200-a.bin"
+ elif [ -f "/lib/firmware/lantiq-vrx200-b.bin" ] && [ -f "/lib/firmware/lantiq-vrx200-b-to-a.bspatch" ]; then
+ bspatch /lib/firmware/lantiq-vrx200-b.bin \
+ /tmp/lantiq-vrx200-a.bin \
+ /lib/firmware/lantiq-vrx200-b-to-a.bspatch
+ firmware="/tmp/lantiq-vrx200-a.bin"
+ else
+ echo "firmware for annex a not found"
+ return 1
+ fi
+ ;;
+ b|j)
+ if [ -f "/lib/firmware/lantiq-vrx200-b.bin" ]; then
+ firmware="/lib/firmware/lantiq-vrx200-b.bin"
+ elif [ -f "/tmp/lantiq-vrx200-b.bin" ]; then
+ firmware="/tmp/lantiq-vrx200-b.bin"
+ elif [ -f "/lib/firmware/lantiq-vrx200-a.bin" ] && [ -f "/lib/firmware/lantiq-vrx200-a-to-b.bspatch" ]; then
+ bspatch /lib/firmware/lantiq-vrx200-a.bin \
+ /tmp/lantiq-vrx200-b.bin \
+ /lib/firmware/lantiq-vrx200-a-to-b.bspatch
+ firmware="/tmp/lantiq-vrx200-b.bin"
+ else
+ echo "firmware for annex b not found"
+ return 1
+ fi
+ ;;
+ *)
+ echo "annex type not supported use a or b"
+ return 1
+ ;;
+ esac
+ fi
+ fi
+
[ -z "${firmware}" ] && firmware=/lib/firmware/vdsl.bin
[ -f "${firmware}" ] || {
echo failed to find $firmware