From d0c2267895b13d25d10a13b28f70d6e30538e91e Mon Sep 17 00:00:00 2001 From: kueller Date: Tue, 9 Feb 2010 15:06:37 +0000 Subject: [PATCH] =?UTF-8?q?init=20=C3=BCberarbeitet=20-=20udev=20und=20hot?= =?UTF-8?q?plug=20eingebaut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.compuextreme.de/Viitor/V962/Viitor_initrd@5369 504e572c-2e33-0410-9681-be2bf7408885 --- init | 45 +++++++++++++++++++++++++-------------------- init.hd | 18 +++++++++--------- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/init b/init index bd5c2c0..c79f9ed 100755 --- a/init +++ b/init @@ -57,18 +57,23 @@ cd /bin ./busybox ln -s busybox ln cd /bin ./busybox echo "Generating links in /bin for busybox" -for i in [ [[ addgroup adduser ar ash awk basename bunzip2 \ - bzcat cat chgrp chmod chown chvt clear cp cpio cut date dc \ - dd deallocvt delgroup deluser df diff dirname dmesg du echo \ - ed egrep env expr false fgrep find free fuser getopt grep \ - gunzip gzip head hostname id insmod ip ipaddr iplink iproute \ - iptunnel kill killall last less logger login ls md5sum mesg \ - mkdir mknod mktemp more mount mountpoint mt mv netstat newlink \ - nslookup passwd patch pidof ping printf ps pwd realpath renice \ - reset rm rmdir sed sh sleep sort stat strings stty su sync tail \ - tar tee telnet test tftp top touch traceroute true tty umount \ - uname uncompress uniq unzip uptime vi wc wget which who whoami \ - xargs yes zcat; do +for i in [ [[ acpid addgroup adduser ar arp arping ash awk \ + basename brctl bunzip2 bzcat cat chgrp chmod chown \ + chvt clear cp cpio cut date dc dd deallocvt delgroup \ + deluser depmod df diff dirname dmesg du echo ed egrep \ + eject env expand expr false fgrep find free fsck \ + fuser getopt grep gunzip gzip head hostname id install\ + ip ipaddr iplink iproute iptunnel kbd_mode kill killall\ + last less linuxrc loadkmap logger login ls lsmod \ + lzmacat makedevs md5sum mdev mesg mkdir mkfifo mknod \ + mktemp more mount mountpoint mt mv netstat nice nohup \ + nslookup passwd patch pidof ping pkill printf ps pwd \ + rdev realpath renice reset rm rmdir sed setconsole \ + setkeycodes sh showkey sleep sort split stat strings \ + stty su sync tail tar tee telnet test tftp top touch \ + traceroute true tty tunctl umount uname uncompress uniq \ + unzip uptime usleep vi wc wget which who whoami xargs \ + yes zcat; do ln -s busybox $i done cd - 2>&1 >/dev/null @@ -98,26 +103,25 @@ done mount -t proc none /proc mount -t sysfs none /sys -mount -t tmpfs none /dev +mount -n -t tmpfs -o mode=0755 udev /dev if [ -d /proc/bus/usb ]; then mount -t usbfs none /proc/bus/usb fi +if [ ! -d /var/lock/subsys ]; then + mkdir -p /var/log/subsys +fi +/etc/init.d/udev start +/etc/init.d/hotplug start echo "0" >/proc/sys/kernel/printk cd /lib/modules/* -for i in `find . -name "*.ko"`; do +for i in `find kernel/drivers -name "*.ko"`; do MODNAME=`basename $i` MODNAME=`echo $MODNAME|sed -e "s/\.ko$//"` echo "Trying to load $MODNAME" modprobe -q $MODNAME 2>&1 >/dev/null done -udevstart echo "7" >/proc/sys/kernel/printk -for i in /etc/init.d/rcS.d/S??*; do - [ ! -f "$i" ] && continue; - $i start -done - for i in /dev/sr*; do mount -o ro $i /mnt if [ -d /mnt/Viitor ]; then @@ -126,6 +130,7 @@ for i in /dev/sr*; do fi umount /mnt done + if [ "$FOUND" ]; then exec /sbin/switch_root /mnt /sbin/init else diff --git a/init.hd b/init.hd index 5ebdf18..6f34f7b 100755 --- a/init.hd +++ b/init.hd @@ -96,27 +96,27 @@ for i in /proc /sys /mnt; do fi done -for i in /etc/init.d/rcS.d/S??*; do - [ ! -f "$i" ] && continue; - $i start -done - mount -t proc none /proc echo "0" >/proc/sys/kernel/printk mount -t sysfs none /sys +mount -n -t tmpfs -o mode=0755 udev /dev if [ -d /proc/bus/usb ]; then mount -t usbfs none /proc/bus/usb fi +if [ ! -d /var/lock/subsys ]; then + mkdir -p /var/log/subsys +fi +/etc/init.d/udev start +/etc/init.d/hotplug start cd /lib/modules/* -for i in `find . -name "*.ko"`; do +for i in `find kernel/drivers -name "*.ko"`; do MODNAME=`basename $i` MODNAME=`echo $MODNAME|sed -e "s/\.ko$//"` echo "Trying to load $MODNAME" - modprobe -q $MODNAME 2>&1 >/dev/null + modprobe -q -s $MODNAME 2>&1 >/dev/null done -mount -t tmpfs none /dev -udevstart echo "7" >/proc/sys/kernel/printk + for i in `cat /proc/cmdline`; do DEVNAME=$DEVNAME`echo $i|awk -F "=" '{ if ($1 == "root" ) print $2 }'` done