ccba4ae843d3f9e3af00accdfefd1f483db0c7a6
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2014 OpenWrt.org
4 .
$IPKG_INSTROOT/lib
/functions.sh
9 MTD
=$
(find_mtd_index dsl_fw
)
11 grep /lib
/firmware
/lantiq
/proc
/mounts
&& umount
/lib
/firmware
/lantiq
13 mkdir
-p /lib
/firmware
/lantiq
14 [ "$MTD" -gt 0 ] ||
return 0
16 mount
-t tmpfs none
/lib
/firmware
/lantiq
17 case "$(dd if=/dev/mtd$MTD bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x
"')" in
20 mount
-t jffs2
/dev
/mtdblock
$MTD /tmp
/fw_mnt
21 cp -a /tmp
/fw_mnt
/*.bin
/lib
/firmware
/lantiq
/
26 tar xz
-C /lib
/firmware
/lantiq
< /dev
/mtd
$MTD
29 echo "No DSL firmware detected in /dev/mtd$MTD (dsl_fw)"
34 [ -e /lib
/firmware
/vdsl.bin
] ||
ln -s /lib
/firmware
/lantiq
/vr9_dsl_fw_annex_b.bin
/lib
/firmware
/vdsl.bin