#!/bin/sh

RAMFS_MODE=0

mount -t devtmpfs none /dev
mount -t proc proc /proc

for parm in $(cat /proc/cmdline); do
    case $parm in
    ramfs)
      RAMFS_MODE=1
      ;;
    esac
done


if [ "$RAMFS_MODE" = "1" ]; then
    /sbin/getty -L ttyS0 115200 vt100
    exit 0
fi

e2fsck -y /dev/nandd
mount -o rw,noatime,nodiratime,norelatime,noauto_da_alloc,barrier=0,data=writeback -t ext4 /dev/nandd /mnt

[ -x /mnt/init ] && exec switch_root /mnt /init
/sbin/getty -L ttyS0 115200 vt100
/bin/ash

