aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-05-06 21:06:22 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-05-06 21:06:22 +0000
commit75c3ff3dee876002ab7ddf626ca89670a7e1e389 (patch)
tree5ea66cf62e8c954b25ad51eb51887a949532b105 /target/linux/lantiq
parent503bcc99794c5adc0f3b388a51dc1edfcc2f071e (diff)
downloadmaster-187ad058-75c3ff3dee876002ab7ddf626ca89670a7e1e389.tar.gz
master-187ad058-75c3ff3dee876002ab7ddf626ca89670a7e1e389.tar.bz2
master-187ad058-75c3ff3dee876002ab7ddf626ca89670a7e1e389.zip
lantiq: support loading the dsl firmware from a flash partition as a raw gzipped tarfile
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40715 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/lantiq')
-rwxr-xr-xtarget/linux/lantiq/base-files/etc/init.d/dsl_fs32
1 files changed, 27 insertions, 5 deletions
diff --git a/target/linux/lantiq/base-files/etc/init.d/dsl_fs b/target/linux/lantiq/base-files/etc/init.d/dsl_fs
index 975f5d8784..09c8a4afa2 100755
--- a/target/linux/lantiq/base-files/etc/init.d/dsl_fs
+++ b/target/linux/lantiq/base-files/etc/init.d/dsl_fs
@@ -4,10 +4,32 @@
. /lib/functions.sh
START=30
-start() {
+
+boot() {
MTD=$(find_mtd_index dsl_fw)
- [ "$MTD" -gt 0 ] && {
- mkdir -p /lib/firmware/dsl/
- mount -t jffs2 /dev/mtdblock$MTD /lib/firmware/dsl/
- }
+
+ grep /lib/firmware/lantiq /proc/mounts && umount /lib/firmware/lantiq
+
+ mkdir -p /lib/firmware/lantiq
+ [ "$MTD" -gt 0 ] || return 0
+
+ mount -t tmpfs none /lib/firmware/lantiq
+ case "$(dd if=/dev/mtd$MTD bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')" in
+ 1985)
+ mkdir -p /tmp/fw_mnt
+ mount -t jffs2 /dev/mtdblock$MTD /tmp/fw_mnt
+ cp -a /tmp/fw_mnt/*.bin /lib/firmware/lantiq/
+ umount /tmp/fw_mnt
+ rmdir /tmp/fw_mnt
+ ;;
+ 1f8b)
+ tar xz -C /lib/firmware/lantiq < /dev/mtd$MTD
+ ;;
+ *)
+ echo "No DSL firmware detected in /dev/mtd$MTD (dsl_fw)"
+ return 0
+ ;;
+ esac
+
+ [ -e /lib/firmware/vdsl.bin ] || ln -s /lib/firmware/lantiq/vr9_dsl_fw_annex_b.bin /lib/firmware/vdsl.bin
}