Udev speedups; thanks to Eric Edgar for the patch - bug #72253.
authorTim Yamin <plasmaroo@gentoo.org>
Sat, 27 Nov 2004 13:33:25 +0000 (13:33 +0000)
committerTim Yamin <plasmaroo@gentoo.org>
Sat, 27 Nov 2004 13:33:25 +0000 (13:33 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@150 67a159dc-881f-0410-a524-ba9dfbe2cb84

gen_initrd.sh
generic/initrd.scripts
generic/linuxrc

index dbfadab9de38f4f0da1e77d90bc67560c415634c..79232760948e6272f48781c1296b3bd97651101a 100644 (file)
@@ -82,6 +82,8 @@ create_base_initrd_sys() {
 
        [ "${UDEV}" -eq '1' ] && { tar -jxpf "${UDEV_BINCACHE}" -C "${TEMP}/initrd-temp" ||
                gen_die "Could not extract udev binary cache!"; }
+               ln -sf "./udev" "${TEMP}/initrd-temp/bin/udevstart" ||
+                       gen_die 'Could not symlink udev -> udevstart!'
 
 # We make our own devfsd.conf these days, the default one doesn't work with the stripped
 # down devfsd we use with dietlibc
index f2fed9b9f9ddd2a24943fba957759e2306eaff3f..06ba683f849378055f31514f8712ec57c72b4ca8 100644 (file)
@@ -65,45 +65,15 @@ kill_devfsd() {
 }
 
 runUdev() {
-       export ACTION=add
-       export UDEV_NO_SLEEP=1
 
-       # Add block devices and their partitions to /dev,
-       # using information from /sys, and only those
-       # devices (since other are not needed for boot).
+       mount -t tmpfs -o size=100k udev /dev
+       mkdir /dev/pts
+       mkdir /dev/shm
+       /sbin/udevstart
+       ln -snf /proc/self/fd /dev/fd
+       ln -snf /proc/self/fd/0 /dev/stdin
+       ln -snf /proc/self/fd/1 /dev/stdout
+       ln -snf /proc/self/fd/2 /dev/stderr
+       ln -snf /proc/kcore /dev/core
 
-       # We also do VC's for keymap support.
-
-       for x in block/*
-       do
-               export DEVPATH="/${x}"
-               /sbin/udev block
-
-               for y in ${x}/*
-               do
-                       if [ -f "${y}/dev" ]
-                       then
-                               export DEVPATH="/${y}"
-                               /sbin/udev block
-                       fi
-               done
-       done
-       for x in class/tty
-       do
-               export DEVPATH="/${x}"
-               /sbin/udev class
-
-               for y in ${x}/*
-               do
-                       if [ -f "${y}/dev" ]
-                       then
-                               export DEVPATH="/${y}"
-                               /sbin/udev class
-                       fi
-               done
-       done
-       
-       cd /
-
-       unset -v ACTION DEVPATH UDEV_NO_SLEEP
 }
index 7d5c33fc61b9eb2d109a5e0148790b65a70f40e0..0d27da297d5df877e0db9ed31e886b1b35509939 100644 (file)
@@ -147,6 +147,7 @@ then
        then
                cd /sys
                kill_devfsd
+               echo -e "${GOOD}>>${NORMAL}${BOLD} Activating udev...${NORMAL}"
                runUdev
                mv /dev/* /newroot/dev
        else
@@ -214,6 +215,7 @@ if [ "${USE_UDEV_NORMAL}" -eq '1' -a "${CDROOT}" -eq '0' ]
 then
        USE_DEVFS_NORMAL=0
        cd /sys
+       echo -e "${GOOD}>>${NORMAL}${BOLD} Activating udev...${NORMAL}"
        runUdev
 elif [ "${CDROOT}" -eq '0' -a "${USE_DEVFS_NORMAL}" -eq '1' ]
 then
@@ -419,6 +421,12 @@ then
        rm /tmp/.initrd/dev -rf || '*: Failed to remove the initrd /dev!'
 elif [ "${USE_UDEV_NORMAL}" -eq '1' ]
 then
+       rm /tmp/.initrd/dev/fd || echo '*: Failed to rm the initrd fd!'
+       rm /tmp/.initrd/dev/stdin || echo '*: Failed to rm the initrd stdin!'
+       rm /tmp/.initrd/dev/stdout || echo '*: Failed to rm the initrd stdout!'
+       rm /tmp/.initrd/dev/stderr || echo '*: Failed to rm the initrd stderr!'
+       rm /tmp/.initrd/dev/core || echo '*: Failed to rm the initrd core!'
+       umount /tmp/.initrd/dev || echo '*: Failed to unmount the initrd /dev!'
        umount /tmp/.initrd/proc || echo '*: Failed to unmount the initrd /proc!'
        umount /tmp/.initrd/sys || echo '*: Failed to unmount the initrd /sys!'
 elif [ "${CDROOT}" -eq '1' ]