[Lunar-commits] r17351 - lunar-iso/trunk/initrd/template/sbin

Auke Kok sofar at lunar-linux.org
Wed Nov 16 06:16:12 UTC 2005


Author: sofar
Date: 2005-11-16 06:16:09 +0000 (Wed, 16 Nov 2005)
New Revision: 17351

Modified:
   lunar-iso/trunk/initrd/template/sbin/init
Log:
Incorporate changes needed to make this work with 2.6 kernels on-the-fly


Modified: lunar-iso/trunk/initrd/template/sbin/init
===================================================================
--- lunar-iso/trunk/initrd/template/sbin/init	2005-11-16 06:15:14 UTC (rev 17350)
+++ lunar-iso/trunk/initrd/template/sbin/init	2005-11-16 06:16:09 UTC (rev 17351)
@@ -3,12 +3,19 @@
 #
 # Parts (C) K. Sallee 2002
 # Parts (C) K. Kongar 2002,2003
-# Parts (c) Lunar-Linux 2002,2003,2004
+# Parts (C) Lunar-Linux 2002-2005
 #
 # This document is licensed under the GPL
 #
 
+is_26() {
+    case `uname -r` in
+        2.6*) return 0 ;;
+           *) return 1 ;;
+    esac
+}
 
+
 shell()
 {
     echo "Press CTRL-D or type exit to return"
@@ -187,15 +194,16 @@
     fi
 
     if mount -n -t $VFSTYPE -o $OPTIONS $ROOT /mnt && [ -x /mnt/sbin/init ]; then
-	pkill devfsd
-	sleep 1
+        is_26 && pkill udevd || pkill devfsd
+        sleep 1
         umount -n /proc
-	umount -n /dev
+        umount -n /dev
+	is_26 && umount -n /sys
         pivot_root /mnt /mnt
         exec /sbin/init  $*
     else
         $DIALOG --msgbox "Unable to locate /sbin/init on $ROOT." 0 0
-	umount -n /mnt
+        umount -n /mnt
         main $*
     fi
 }
@@ -219,12 +227,20 @@
 --stdout"
 
 mount -n -t proc proc /proc
-mount -n -t devfs devfs /dev
-devfsd /dev &
 
 KERNEL=`uname -r`
 DEVICE="/dev/cdroms/cdrom"
 
+is_26 && (
+    mount -n -t sysfs sysfs /sys
+    mount -n -t ramfs none /dev
+    echo /sbin/udevsend > /proc/sys/kernel/hotplug
+    /sbin/udevstart
+) || (
+    mount -n -t devfs devfs /dev
+    devfsd /dev &
+)
+
 # short timeout, we really need to be able to see debug info
 sleep 2
 



More information about the Lunar-commits mailing list