#!/bin/ash

PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PATH
source /etc/rc.subr/colors 

mkdir -p /proc
mkdir -p /sys
mkdir -p /tmp
mkdir -p /var/log
mount -t proc none /proc
ln -sf /proc/mounts /etc/mtab
touch /etc/fstab
mount -t devtmpfs devtmpfs /dev
mkdir -p /dev/pts
mkdir -p /dev/shm
mkdir -p /dev/mapper
mkdir -p /dev/net
mount -t sysfs sysfs /sys
mount -t devpts -o rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 devpts /dev/pts
mount -t tmpfs devshm /dev/shm
mount -t tmpfs tmpfs /tmp

echo /sbin/mdev > /proc/sys/kernel/hotplug

ifconfig lo inet 127.0.0.1 netmask 255.0.0.0 up
echo '127.0.0.1 localhost' > /etc/hosts
hostname tinycross

for i in /etc/rc.d/[0-9][0-9][0-9][0-9]-*.?? ; do
	$i start
done

printf "${bold}Waiting five seconds for devices to settle... ${normal}\n\n"
sleep 5
clear
printf "${bold}Welcome to ${cyan}TinyCrossLinux${normal}${bold} - Mattias Schlenkers lesson to teach how to\n"
printf "${bold}construct a really compact distribution running from initramfs.\n\n"

printf "${bold}Please consult ${yellow}https://github.com/mschlenker/TinyCrossLinux${normal}\n"
printf "${bold}to obtain the build scripts and further information!\n\n"

printf "${bold}Have fun!${normal}\n \n \n"
