2012-04-07

Slitaz-arm-emergency - rcS

rcS

1.
# ls -l /etc/init.d
total 12
-rwxrwxr-x 1 0 0 986 Apr 4 2012 rcS
-rwxrwxr-x 1 0 0 599 Mar 27 2012 rcS~
-rwxrwxr-x 1 0 0 1200 Mar 27 2012 vchiq

2.
# cat /etc/init.d/rcS
#! /bin/sh

/bin/mount -a
/sbin/ifconfig lo 127.0.0.1
/sbin/ifconfig eth0 10.0.2.15 up
/sbin/route add default gw 10.0.2.2
/bin/hostname raspberrypi

echo /sbin/mdev >/proc/sys/kernel/hotplug
# /sbin/mdev -s

/sbin/syslogd # circular buffer - use logread to read
/sbin/klogd # log kernel messages - also available in dmesg

# load kernel modules listed in /etc/modules
if [ -r /etc/modules ]; then
while read mod; do
modprobe $mod
done < /etc/modules
fi

# create vchiq device
# [ -x /etc/init.d/vchiq ] && /etc/init.d/vchiq start

echo
echo Greetings from standalone Raspberry Pi
echo

if [ -f /proc/cmdline -a -x /usr/local/bin/rpitestmode.sh ]; then
if grep rpitestmode /proc/cmdline > /dev/null; then
# wait for USB ennumeration to finish - otherwise test will fail
sleep 3
/usr/local/bin/rpitestmode.sh
fi
fi

# use an artificial SysRq-g to interrupt
# echo Attempting to enter the debugger! ....
# echo g > /proc/sysrq-trigger