#!/bin/sh mounted= /bin/mount -t proc proc /proc /bin/echo "0x0100" > /proc/sys/kernel/real-root-dev if [ -z "$mounted" ] && /bin/mount -rt jffs2 /dev/mtdblock4 /mnt/tmpmnt ; then if [ -x /mnt/tmpmnt/sbin/init -o -x /mnt/tmpmnt/bin/init ] ; then /bin/echo "Root filesystem will be mounted from /dev/mtdblock4 ..." mounted=/mnt/tmpmnt /bin/echo "0x1f04" > /proc/sys/kernel/real-root-dev fi /bin/umount /mnt/tmpmnt fi if [ -z "$mounted" ] ; then if [ -x /mnt/tmpmnt/sbin/init -o -x /mnt/tmpmnt/bin/init ] ; then /bin/echo "Root filesystem will be mounted from /dev/ram0 ..." mounted=/mnt/tmpmnt /bin/echo "0x0100" > /proc/sys/kernel/real-root-dev fi fi if [ -z "$mounted" ] ; then /bin/echo "Root filesystem cannot be found - dropping into shell ..." echo "5" > /proc/sys/kernel/panic exec /bin/sh fi /bin/umount /proc exit 0