diff options
author | Sebastian Schmelzer | 2010-10-25 16:53:54 +0200 |
---|---|---|
committer | Sebastian Schmelzer | 2010-10-25 16:53:54 +0200 |
commit | 3050a9253437f4a4b5ad4bf3b3efdc3c660a5137 (patch) | |
tree | 91ac22153e416aac7ca20916b314b5e2ffa871b1 /initramfs/eglibc-rootfs/init | |
download | preboot-master.tar.gz preboot-master.tar.xz preboot-master.zip |
Diffstat (limited to 'initramfs/eglibc-rootfs/init')
-rwxr-xr-x | initramfs/eglibc-rootfs/init | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/initramfs/eglibc-rootfs/init b/initramfs/eglibc-rootfs/init new file mode 100755 index 0000000..cb2ff2d --- /dev/null +++ b/initramfs/eglibc-rootfs/init @@ -0,0 +1,72 @@ +#!/bin/ash +# sc2010 Init + +############################################################################# +# PreBoot init main part + +# device files get their own filesystem +devdir="/dev" +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 DEBUGLEVEL=0 + +# 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 +export PATH=/bin:/sbin:/usr/bin/:/usr/sbin + +echo "Starting shell, leaving it would continue init." +getty -i -n -l /bin/cat 38400 tty10 & +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." + +# run udhcpc and start a debug shell if no lease could be obtained +udhcpc -f -n -q -s /etc/udhcpc.default.script -i $nwif 2>/dev/null + +loadkmap < /etc/keymaps/de_DE + +cat /etc/issue + +exec /sbin/init + +#exec getty -n -l /bin/ash 38400 tty1 |