# /etc/inittab
#
# Copyright (C) 2012 GuoWenxue <guowenxue@gmail.com QQ:281143292>
#
# 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. 
#              If specified, then /dev/$id device must exist
# runlevels == ignored, busybox doesn't support it
# action    == one of sysinit, respawn, askfirst, wait, and once
# process   == program to run

# Startup the system
# mount all the file systems specified in /etc/fstab 
::sysinit:/bin/mount -a

#Use mdev as hotplug to auto mount USB storage or SD card 
::sysinit:/bin/echo /sbin/mdev > /proc/sys/kernel/hotplug
::sysinit:/sbin/mdev -s


#make shm, pts support
::sysinit:/bin/mkdir -p /dev/pts
::sysinit:/bin/mkdir -p /dev/shm
::sysinit:/bin/mount -t devpts devpts /dev/pts

#Mount our apps/info partition
#null::wait:/bin/mount -o sync,noatime,ro -t jffs2 /dev/mtdblock6 /apps
#null::wait:/bin/mount -o sync,noatime,ro -t jffs2 /dev/mtdblock7 /info
null::wait:/usr/bin/sysmnt -a

#Set hostname 
null::sysinit:/bin/hostname -F /etc/hostname


#Initialize the user account files
null::wait:/usr/bin/initpwd

#Enable console logon
null::respawn:/sbin/getty -L ttySAC0 115200 vt100

null::sysinit:/bin/mkdir -p /tmp/logs
null::sysinit:/bin/mkdir -p /tmp/stat

# install drivers
null::wait:/info/install

# now run any rc scripts
null::wait:/etc/init.d/rcS

# system daemon
null::respawn:/sbin/syslogd -n
null::respawn:/sbin/klogd -n

# Stuff to do before rebooting
null::shutdown:/bin/umount /apps
null::shutdown:/bin/umount /info
null::shutdown:/bin/umount /data
null::shutdown:/bin/killall klogd
null::shutdown:/bin/killall syslogd
null::shutdown:/bin/umount -a -r
#null::shutdown:/sbin/swapoff -a
