ASR_BASE
Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/target/linux/mmp/files/initramfs/etc/init.d/rcS b/target/linux/mmp/files/initramfs/etc/init.d/rcS
new file mode 100755
index 0000000..248b5ac
--- /dev/null
+++ b/target/linux/mmp/files/initramfs/etc/init.d/rcS
@@ -0,0 +1,26 @@
+#!/bin/sh
+#This is the first script called by init process
+
+find_mtd_index() {
+ local PART="$(grep "\"$1\"" /proc/mtd | awk -F: '{print $1}')"
+ local INDEX="${PART##mtd}"
+
+ echo ${INDEX}
+}
+
+
+/bin/mount -a
+mount -t tmpfs tmpfs /tmp
+echo /sbin/mdev > /proc/sys/kernel/hotplug
+mdev -s
+
+if [ -e /dev/dm-0 ]; then
+ blkdev=/dev/dm-0
+else
+ mtdpart_idx="$(find_mtd_index rootfs)"
+ blkdev=/dev/mtdblock${mtdpart_idx}
+fi
+
+echo "==> mount squashfs from $blkdev to /mnt"
+mount -t squashfs -o ro $blkdev /mnt
+