# /etc/inittab
#
# Copyright (C) 2001 Erik Andersen <andersen@codepoet.org>
#
# Note: BusyBox init doesn't support runlevels.  The runlevels field is
# completely ignored by BusyBox init. If you want runlevels, use
# sysvinit.
#
# Format for each entry: <id>:<runlevels>:<action>:<process>
#
# id        == tty to run on, or empty for /dev/console
# runlevels == ignored
# action    == one of sysinit, respawn, askfirst, wait, and once
# process   == program to run

# Startup the system
::sysinit:/bin/mount -t proc proc /proc
::sysinit:/bin/mount -o remount,ro,sync /
#::sysinit:/bin/mount -o remount,rw /
::sysinit:/bin/mount -t sysfs sysfs /sys
::sysinit:/bin/mkdir -p /dev/pts
::sysinit:/bin/mkdir -p /dev/pts /dev/shm
::sysinit:/bin/mount -a
::sysinit:/bin/mkdir /var/tmp /var/log /var/run /var/lock
::sysinit:/bin/mount /var/tmp /tmp
::sysinit:/bin/mount /var/run /run
::sysinit:/sbin/swapon -a
::sysinit:/bin/hostname -F /etc/hostname
#::sysinit:/bin/echo 1 > /sys/class/leds/netred/brightness
#::sysinit:/bin/echo 1 > /sys/class/leds/netgreen/brightness


null::sysinit:/bin/ln -sf /proc/self/fd /dev/fd
null::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin
null::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout
null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr


# network initialization
::sysinit:/sbin/ifconfig lo 127.0.0.1 up
::sysinit:/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo

# now run any rc scripts
::sysinit:/etc/init.d/rcS
# Put a getty on the serial port
ttymxc0::respawn:/sbin/getty -L ttymxc0 115200 vt100
#ttymxc0::respawn:-/bin/sh

# Restart script
ttyS0::restart:/sbin/init.restart

# As the init script stop targets do not stop the processes
# kill them so that we are able to control the LEDs.
null::shutdown:/usr/bin/killall -9 mono devicestack knxstack
::shutdown:/etc/init.d/K99ledreset

# save random seed
null::shutdown:/etc/init.d/S20urandom stop
# Gracefully ask udevd to stop
null::shutdown:/etc/init.d/S10udev stop

# update hardware clock
null::shutdown:/sbin/hwclock --utc -w

# Logging junk
null::sysinit:/bin/touch /var/log/messages

# Stuff to do before rebooting
null::shutdown:/bin/umount -a -r
null::shutdown:/sbin/swapoff -a
