#!/bin/sh # activate the loopback /sbin/ifconfig lo 127.0.0.1 # clear the mtab >/etc/mtab /bin/mount -t proc proc /proc /bin/mount -f sysfs /sys -t sysfs /bin/mount -t jffs2 /dev/mtdblock6 /persistent # link back the configuration files for f in `ls /persistent/etc/`; do ln -fs /persistent/etc/$f /etc done # Make sure this exists mkdir -p /service # set the hostname if [ ! -f /etc/HOSTNAME ] ; then echo warp > /etc/HOSTNAME fi /bin/hostname `cat /etc/HOSTNAME` # mount all paritions that are not marked noauto mount -a ln -fs /tmp /var/tmp mount_sd () { # Do we even have the driver installed? if [ ! -f /proc/driver/pikasd ] ; then echo "No pikasd driver" return 1 fi # Is there a card preset? CARD_PRESENT=`cat /proc/driver/pikasd` if [ "$CARD_PRESENT" = 0 ] ; then echo "No SD Card present" return 1 fi # Wait for the card to be initialized while ! ls /sys/bus/mmc/devices/mmc* >/dev/null 2>/dev/null ; do sleep 1 done # Mount the partitions for dev in `fgrep mmcblk0 /etc/fstab | cut -f1` ; do dir=`fgrep $dev /etc/fstab | awk '{ print $2; }'` type=`fgrep $dev /etc/fstab | awk '{ print $3; }'` mount -t $type $dev $dir done } # attempt to mount the SD card mount_sd # scan autorun folder and execute all shell scripts in alphabetical order for filename in `ls /persistent/autorun/*`; do if [ -x "$filename" ]; then . $filename; fi done # start watchdog watchdog -t5 /dev/watchdog if [ -x /etc/rc.local ]; then . /etc/rc.local fi