aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/base-files/etc/init.d
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/lantiq/base-files/etc/init.d')
-rwxr-xr-xtarget/linux/lantiq/base-files/etc/init.d/dsl_fs35
-rwxr-xr-xtarget/linux/lantiq/base-files/etc/init.d/esi7
2 files changed, 42 insertions, 0 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
new file mode 100755
index 0000000..ccba4ae
--- /dev/null
+++ b/target/linux/lantiq/base-files/etc/init.d/dsl_fs
@@ -0,0 +1,35 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2014 OpenWrt.org
+
+. $IPKG_INSTROOT/lib/functions.sh
+
+START=30
+
+boot() {
+ MTD=$(find_mtd_index dsl_fw)
+
+ 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
+}
diff --git a/target/linux/lantiq/base-files/etc/init.d/esi b/target/linux/lantiq/base-files/etc/init.d/esi
new file mode 100755
index 0000000..ca79070
--- /dev/null
+++ b/target/linux/lantiq/base-files/etc/init.d/esi
@@ -0,0 +1,7 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2013 OpenWrt.org
+
+START=19
+start() {
+ esi $(printf '%012X' $((1+0x$(tr -d : </sys/class/net/eth0/address)))) 2>/dev/console || :
+}