#!/bin/ash

echo -n "Mounting filesystems: /tmp "
mount -n -t tmpfs tmpfs /tmp -o mode=1777

echo -n "/proc "
mount -n -t proc none /proc
echo >/proc/sys/kernel/printk "1 4 1 7"

echo -n "/sys "
mount -n -t sysfs sysfs /sys

echo -n "/dev "
mount -n -t tmpfs tmpfs /dev -o mode=755
mkdir -p -m 0755 /dev/pts
mkdir -p -m 0755 /dev/shm

echo -n "/dev/pts "
mount -n -t devpts devpts /dev/pts

echo "/root"
mount -n -t ramfs none /root

echo -n -e "\033[9;0]"

ln -snf /proc/self/fd /dev/fd
ln -snf /proc/self/fd/0 /dev/stdin
ln -snf /proc/self/fd/1 /dev/stdout
ln -snf /proc/self/fd/2 /dev/stderr
ln -s /proc/kcore /dev/core

echo "Starting syslogd"
syslogd -O /dev/tty4

echo "Loading scsi_mod & libata module"
modprobe scsi_mod
modprobe libata

echo "Starting udev daemon"
/sbin/udevd --daemon
/sbin/udevtrigger
/sbin/udevsettle

sleep 3
for file in /dev/.udev/failed/*/uevent ; do
	echo "add" >"${file}"
done 2>/dev/null
/sbin/udevsettle

echo "Loading Installer..."
