#!/bin/sh
# /etc/rc — this file will be called directly by /sbin/init
# it is safest to use absolute paths here because
# /etc/profile is not yet loaded
/bin/dmesg -n 1
/bin/echo "Mounting required filesystems"
/bin/mount -t sysfs sysfs /sys
/bin/mount -t proc proc /proc
/bin/echo "Mounting fstab filesystems"
/bin/mount -a
/bin/echo "Remounting root as read/write"
/bin/mount / -o remount,rw
/bin/echo "Mounting /dev/shm"
[ -d /dev/shm ] || /bin/mkdir /dev/shm
/bin/mount -t tmpfs tmpfs /dev/shm
/bin/echo "Mounting /dev/pts"
[ -d /dev/pts ] || /bin/mkdir /dev/pts
/bin/mount -t devpts devpts /dev/pts
/bin/echo "Mounting /tmp"
/bin/mount -t tmpfs tmpfs /tmp
/bin/echo "Starting mdev"
/bin/echo /sbin/mdev > /proc/sys/kernel/hotplug
/sbin/mdev -s
/bin/echo "Executing init scripts"
for FILE in /etc/rc.d/*; do
  [ -x /etc/rc.d/$FILE ] && /etc/rc.d/$FILE start
done
echo "System booted with $(/bin/cat /proc/cmdline)"
/bin/echo "Spawning TTY"
/sbin/respawn /bin/busybox getty 38400 /dev/tty0
