[Initng-svn] r2353 - initng/initfiles/system

svn at initng.thinktux.net svn at initng.thinktux.net
Tue Dec 6 12:07:02 CET 2005


Author: jimmy
Date: Tue Dec  6 12:07:01 2005
New Revision: 2353

Modified:
   initng/initfiles/system/initial.ii
Log:
Udev fixes to make initng boot on a recent dappy ubuntu system, and maby an debian one.


Modified: initng/initfiles/system/initial.ii
==============================================================================
--- initng/initfiles/system/initial.ii	(original)
+++ initng/initfiles/system/initial.ii	Tue Dec  6 12:07:01 2005
@@ -24,38 +24,56 @@
 @/sbin/setsysfont@
 #endd
 
-# Check for udevstart.
-if [ ! -e @/sbin/udevstart:/sbin/start_udev@ ]; then
-    echo "@/sbin/udevstart:/sbin/start_udev@ is missing, cant boot this system!"
+# look for the udevd daemon
+if [ ! -x @/sbin/udevd@ ]; then
+    echo "@/sbin/udevd@ missing, cant boot the computer!"
     exit 1
 fi
 
-# Launch udevd daemon
-if [ -x @/sbin/udevd@ ]; then
-    @/bin/ps@ ax -o comm=|grep '^udevd$' || @/sbin/udevd@ --daemon
-fi
-
 # Ok, go create /dev
 echo "Mounting ramfs at /dev ..."
 @mkdir@ -p /dev && mount -n -o size=10M,mode=0755 -t tmpfs tmpfs /dev
-    
-echo "Configuring system to use udev ..."
 @mknod@ /dev/null c 1 3 -m 666
-@/sbin/start_udev:/sbin/udevstart@
-
-# udevstart fails sometimes, retry until /dev/zero exists.
-if [ ! -e /dev/zero ]; then
-    echo "@/sbin/udevstart:/sbin/start_udev@ failed to create standard device files"
-    exit 1
-fi
 
+# Launch udevd daemon
+@/sbin/udevd@ --daemon
 
-# Create /dev/MAKEDEV
-if [ -e @/sbin/MAKEDEV@ ]
+if [ -e /lib/udev/devices ]
 then
-    @ln@ -fs @/sbin/MAKEDEV@ /dev/MAKEDEV
+
+    # Copy over default device tree
+    (cd /lib/udev/devices && find -print0 | cpio --quiet -0pmdu /dev)
+    
+    echo -n "Running @/sbin/udevplug@ .. :"
+    time @/sbin/udevplug@
+    echo "  done"
+else
+
+    # Check for udevstart.
+    if [ ! -e @/sbin/udevstart:/sbin/start_udev@ ]; then 
+	echo "@/sbin/udevstart:/sbin/start_udev@ is missing, cant boot this system!"
+	exit 1
+    fi
+
+    echo "Configuring system to use udev ..."
+    @/sbin/start_udev:/sbin/udevstart@
+
+    # udevstart fails sometimes, retry until /dev/zero exists.
+    if [ ! -e /dev/zero ]; then
+	echo "@/sbin/udevstart:/sbin/start_udev@ failed to create standard device files"
+	exit 1
+    fi
+
+    # Create /dev/MAKEDEV
+    if [ -e @/sbin/MAKEDEV@ ]
+    then
+	@ln@ -fs @/sbin/MAKEDEV@ /dev/MAKEDEV
+    fi
+
 fi
 
+
+
 # To be created the udev way
 if [ -e /etc/udev/links.conf ]
 then
@@ -96,17 +114,11 @@
 # Setup hotplugging (if possible)
 if [ -e /proc/sys/kernel/hotplug ]
 then
-    if   [ -x /sbin/udevsend ] ; then
-	echo "  Setting /sbin/udevsend as hotplug agent ..."
-	echo "/sbin/udevsend" > /proc/sys/kernel/hotplug
-
-    elif [ -x /sbin/hotplug  ] ; then
-	echo "  Using /sbin/hotplug as hotplug agent ..."
-	echo "/sbin/hotplug" > /proc/sys/kernel/hotplug
-
+    if   [ -x @/sbin/udevsend:/sbin/hotplug:/sbin/udev@ ] ; then
+	echo "  Setting @/sbin/udevsend:/sbin/hotplug:/sbin/udev@ as hotplug agent ..."
+	echo "@/sbin/udevsend:/sbin/hotplug:/sbin/udev@" > /proc/sys/kernel/hotplug	
     else
-	echo "  Setting /sbin/udev as hotplug agent ..."
-	echo "/sbin/udev" > /proc/sys/kernel/hotplug
+	echo "" > /proc/sys/kernel/hotplug
     fi
 fi
 


More information about the Initng-svn mailing list