diff options
Diffstat (limited to 'build/rootfs/init')
-rwxr-xr-x | build/rootfs/init | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/build/rootfs/init b/build/rootfs/init index 04ca3fe..faec9ad 100755 --- a/build/rootfs/init +++ b/build/rootfs/init @@ -23,8 +23,29 @@ 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" \ @@ -37,7 +58,10 @@ for i in "/dev/mem c 1 1" "/dev/null c 1 3" "/dev/zero c 1 5" \ [ -e $(echo $i | awk ' {print $1}') ] || mknod $i done mkdir -p ${devdir}/pts ${devdir}/shm -export PATH=/bin:/sbin:/usr/bin/:/usr/sbin + +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 & @@ -60,18 +84,18 @@ 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 +echo "/sbin/udhcpc -f -n -q -s /etc/udhcpc.default.script -i $nwif &>/dev/null &" \ + >> /bin/run_udhcpc.sh cat /etc/issue -export QWS_MOUSE_PROTO=MouseMan:/dev/mouse0 +#ntbdate time.uni-freiburg.de -$(/bin/fbgui && /bin/sh ) & +if [ $DEBUGLEVEL -ge 1 ]; then +echo "\$DEBUGLEVEL=$DEBUGLEVEL" > /tmp/debuglevel +echo "starting debug shell: " +/bin/sh +fi +echo "start init" > /dev/klog exec /sbin/init - - -#exec getty -n -l /bin/ash 38400 tty1 |