ASR_BASE
Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/target/linux/mmp/files/initramfs/etc/fstab b/target/linux/mmp/files/initramfs/etc/fstab
new file mode 100644
index 0000000..1b64ca7
--- /dev/null
+++ b/target/linux/mmp/files/initramfs/etc/fstab
@@ -0,0 +1,5 @@
+#device mount-point type options dump fsck order
+proc /proc proc defaults 0 0
+tmpfs /tmp tmpfs defaults 0 0
+sysfs /sys sysfs defaults 0 0
+tmpfs /dev tmpfs defaults 0 0
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
+
diff --git a/target/linux/mmp/files/initramfs/etc/inittab b/target/linux/mmp/files/initramfs/etc/inittab
new file mode 100644
index 0000000..cb3d88b
--- /dev/null
+++ b/target/linux/mmp/files/initramfs/etc/inittab
@@ -0,0 +1,11 @@
+#this is run first except when booting in single-user mode.
+::sysinit:/etc/init.d/rcS
+# /bin/sh invocations on selected ttys
+::respawn:-/bin/sh
+# Start an "askfirst" shell on the console (whatever that may be)
+::askfirst:-/bin/sh
+# Stuff to do when restarting the init process
+#::restart:/sbin/init
+# Stuff to do before rebooting
+#::ctrlaltdel:/sbin/reboot
+#::shutdown:/sbin/swapoff -a
diff --git a/target/linux/mmp/files/initramfs/etc/profile b/target/linux/mmp/files/initramfs/etc/profile
new file mode 100644
index 0000000..739bb56
--- /dev/null
+++ b/target/linux/mmp/files/initramfs/etc/profile
@@ -0,0 +1,10 @@
+#!/bin/sh
+#!/bin/sh
+export HOSTNAME=openwrt
+export USER=root
+export HOME=root
+export PS1="[$USER@$HOSTNAME \W]\# "
+#export PS1="[\[\033[01;32m\]$USER@\[\033[00m\]\[\033[01;34m\]$HOSTNAME\[\033[00m\ \W]\$ "
+PATH=/bin:/sbin:/usr/bin:/usr/sbin
+LD_LIBRARY_PATH=/lib:/usr/lib:$LD_LIBRARY_PATH
+export PATH LD_LIBRARY_PATH