lantiq: Tune the XWAY subtarget cflags
[openwrt/staging/yousong.git] / package / platform / lantiq / ltq-vdsl-fw / src / vdsl_fw_install.sh
1 #!/bin/sh
2
3 FW="/tmp/Firmware_Speedport_W921V_1.20.000.bin"
4 URL="http://hilfe.telekom.de/dlp/eki/downloads/Speedport/Speedport%20W%20921V/Firmware_Speedport_W921V_1.20.000.bin"
5 FW_TAPI="/tmp/vr9_tapi_fw.bin"
6 FW_DSL="/tmp/vr9_dsl_fw_annex_b.bin"
7 FW_TGZ="/tmp/vr9_fw.tgz"
8 MD5_FW="4d812f2c3476dadd738b022c4767c491"
9 MD5_TAPI="06b6ab3481b8d3eb7e8bf6131f7f6b7f"
10 MD5_DSL="59dd9dc81195c6854433c691b163f757"
11
12 [ -f /lib/firmware/vdsl.bin] && exit 0
13
14 [ -z "$1" ] || URL=$1
15
16 [ -f "${FW}" ] || {
17 echo "${FW} does not exist. Try to Download it ? (y/N)"
18 read -n 1 R
19 echo ""
20 [ "$R" = "y" ] || {
21 echo "Please manually download the firmware from ${URL} and copy the file to ${FW}"
22 exit 1
23 }
24 echo "Download w921v Firmware"
25 wget "${URL}" -O "${FW}"
26 [ $? -eq 0 -a -f "${FW}" ] || exit 1
27 }
28
29 F=`md5sum -b ${FW} | cut -d" " -f1`
30 [ "$F" = "${MD5_FW}" ] || {
31 echo "Failed to verify Firmware MD5"
32 exit 1
33 }
34
35 echo "Unpack and decompress w921v Firmware"
36 w921v_fw_cutter
37 [ $? -eq 0 ] || exit 1
38
39 T=`md5sum -b ${FW_TAPI} | cut -d" " -f1`
40 D=`md5sum -b ${FW_DSL} | cut -d" " -f1`
41
42 [ "$T" = "${MD5_TAPI}" -a "$D" = "${MD5_DSL}" ] || {
43 echo "Failed to verify MD5"
44 exit 1
45 }
46
47 cp ${FW_TAPI} ${FW_DSL} /lib/firmware/
48 ln -s /lib/firmware/vr9_dsl_fw_annex_b.bin /lib/firmware/vdsl.bin