2014-04-11 20:40:24 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
# Copyright (C) 2014 OpenWrt.org
|
|
|
|
|
2014-09-16 14:53:06 +00:00
|
|
|
. $IPKG_INSTROOT/lib/functions.sh
|
2014-04-11 20:40:24 +00:00
|
|
|
|
|
|
|
START=30
|
2014-05-06 21:06:22 +00:00
|
|
|
|
|
|
|
boot() {
|
2014-04-11 20:40:24 +00:00
|
|
|
MTD=$(find_mtd_index dsl_fw)
|
2014-05-06 21:06:22 +00:00
|
|
|
|
|
|
|
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
|
2014-04-11 20:40:24 +00:00
|
|
|
}
|