lantiq: vr9-vdsl-fw: properly write firmware to flash
authorJohn Crispin <john@openwrt.org>
Fri, 31 Oct 2014 11:00:42 +0000 (11:00 +0000)
committerJohn Crispin <john@openwrt.org>
Fri, 31 Oct 2014 11:00:42 +0000 (11:00 +0000)
Using a redirect to a non-empty mtd partition will not erase the
blocks prior to writing to them resulting in broken dsl_fw.
Fix this by piping to mtd write - /dev/mtdX instead.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
SVN-Revision: 43125

package/kernel/lantiq/ltq-vdsl-fw/src/vdsl_fw_install.sh

index 63ed9486874bb3b4d7109278ae99af89316fd7b0..858e8f1aed05712d283e43854e30b1195ec28efd 100755 (executable)
@@ -49,7 +49,7 @@ D=`md5sum -b ${FW_DSL} | cut -d" " -f1`
 MTD=$(find_mtd_index dsl_fw)
 if [ "$MTD" -gt 0 -a -e "/dev/mtd$MTD" ]; then
        echo "Storing firmware in flash"
-       tar cvz ${FW_TAPI} ${FW_DSL} > "/dev/mtd$MTD"
+       tar cvz ${FW_TAPI} ${FW_DSL} | mtd write - "/dev/mtd$MTD"
        /etc/init.d/dsl_fs boot
 else
        cp ${FW_TAPI} ${FW_DSL} /lib/firmware/