[OpenWrt-Devel] [PATCH 2/5] ltq-vdsl-app: load the vrx200 firmware or patch it
Hauke Mehrtens
hauke at hauke-m.de
Sat Feb 27 17:59:49 EST 2016
This checks for the VRX firmware provided in the OpenWrt package.
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
.../network/config/ltq-vdsl-app/files/dsl_control | 41 ++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/package/network/config/ltq-vdsl-app/files/dsl_control b/package/network/config/ltq-vdsl-app/files/dsl_control
index fc100cf..d7ba622 100644
--- a/package/network/config/ltq-vdsl-app/files/dsl_control
+++ b/package/network/config/ltq-vdsl-app/files/dsl_control
@@ -153,6 +153,47 @@ start_service() {
;;
esac
+ if [ -z "${firmware}" ]; then
+ 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
--
2.7.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list