#!/bin/sh
echo "Start AT91SAM9261EK shell"
mount -t proc none /proc
mount -t sysfs none /sys

mount -t tmpfs -o size=3m tmpfs /media/tmpdir
mkdir -p /media/tmpdir/var
mkdir -p /media/tmpdir/etc
mkdir -p /media/tmpdir/home
cp -a /var/* /media/tmpdir/var/
cp -a /etc/* /media/tmpdir/etc/
cp -a /home/* /media/tmpdir/home/
sync
mount -o bind /media/tmpdir/var /var
mount -o bind /media/tmpdir/etc /etc
mount -o bind /media/tmpdir/home /home


export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
export HOME=/home/root

# Bootup message

#dd if=/etc/fbbootimage of=/dev/fb0 

# make some cleanup
#rm -rf /tmp/.X*
#rm -rf /tmp/*

# X server and clients setup

export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CONFFILE=/usr/share/tslib/ts.conf-h3600
export DISPLAY=:0

#sleep 5
/bin/sh
