#!/bin/ash # sc2010 Init ############################################################################# # PreBoot init main part # device files get their own filesystem devdir="/dev" mkdir -p /tmp /sys /proc mount -n -t tmpfs -o 'size=25%,mode=0755' mdev ${devdir} mount -t tmpfs tmpfs /tmp mkdir -p /dev/pts mount -t devpts devpts /dev/pts mount -t proc proc /proc mount -t sysfs sysfs /sys echo /sbin/mdev > /proc/sys/kernel/hotplug cat > /etc/mdev.conf << "EOF" sda* 0:6 0660 sdb* 0:6 0660 sg* 0:6 0660 hda* 0:6 0660 hdb* 0:6 0660 EOF mdev -s export PATH=/bin:/sbin:/usr/bin/:/usr/sbin export DEBUGLEVEL=0 read KCMDLINE < /proc/cmdline export KCMDLINE # read the system wide initramfs-setup and then the kernel commandline for opts in ${KCMDLINE} ; do case ${opts} in # single token for debugging ... debug) DEBUGLEVEL=1 ;; # ... or a specified debug level debug=*) DEBUGLEVEL=${opts#debug=} syslogd -C2048 klogd ;; esac done # create basic device files an directories in dev for i in "/dev/mem c 1 1" "/dev/null c 1 3" "/dev/zero c 1 5" \ "/dev/urandom c 1 9" "/dev/kmsg c 1 11" "/dev/tty0 c 4 0" \ "/dev/tty1 c 4 1" "/dev/tty2 c 4 2" "/dev/tty3 c 4 3" \ "/dev/tty4 c 4 4" "/dev/tty5 c 4 5" "/dev/tty6 c 4 6" \ "/dev/tty7 c 4 7" "/dev/tty8 c 4 8" "/dev/tty9 c 4 9" \ "/dev/tty10 c 4 10" "/dev/tty c 5 0" "/dev/console c 5 1" \ "/dev/ptmx c 5 2" "/dev/psaux c 10 1" "/dev/agpgart c 10 175" \ "/dev/fb0 c 29 0" "/dev/bootsplash p" "/dev/xconsole p"; do [ -e $(echo $i | awk ' {print $1}') ] || mknod $i done mkdir -p ${devdir}/pts ${devdir}/shm loadkmap < /etc/keymaps/de_DE echo "1" > /dev/mouse0 echo "1" > /dev/tty0 echo "Starting shell, leaving it would continue init." getty -i -n -l /bin/cat 38400 tty10 & getty -n -l /bin/ash 38400 tty2 & getty -n -l /bin/ash 38400 tty3 & setlogcons 10 # initramfs-setup configuration (common settings for all clients using a # certain InitRamFS generated by slxmkramfs/mkdxsinitrd) [ -f /etc/initramfs-setup ] && . /etc/initramfs-setup 2>/dev/null # set a default LAN interface, has to be modified for WLAN or on machines # with more than one ethernet card built in nwif="eth0" # mount the important standard directories [ ! -f /proc/cpuinfo ] && mount -n -t proc proc /proc [ ! -d /sys/class ] && mount -n -t sysfs sysfs /sys # set up loopback networking and power up ethernet ip link set dev lo up ip addr add 127.0.0.1/8 dev lo ip link set dev $nwif up || echo "I did not find any usable network adaptor." #echo "/sbin/udhcpc -f -n -q -s /etc/udhcpc.default.script -i $nwif &>/dev/null &" \ # >> /bin/run_udhcpc.sh mkdir -p /var/tmp /var/run /var/lib cat /etc/issue #ntbdate time.uni-freiburg.de if [ $DEBUGLEVEL -ge 1 ]; then echo "DEBUGLEVEL=$DEBUGLEVEL" > /tmp/debuglevel echo -n "Starting debug shell: " echo "CTRL + D will start fbgui" /bin/sh fi echo "Start init" > /dev/klog exec /sbin/init