[Lunar-commits] r14545 - lunar-iso/branches/lunar-iso-2.6/initrd/template/sbin

Jaime Buffery nestu at lunar-linux.org
Sat Apr 30 22:34:50 UTC 2005


Author: nestu
Date: 2005-04-30 22:34:49 +0000 (Sat, 30 Apr 2005)
New Revision: 14545

Modified:
   lunar-iso/branches/lunar-iso-2.6/initrd/template/sbin/init
Log:
Making the script 2.6 compatible: start udev services 
and stop them where necessary.



Modified: lunar-iso/branches/lunar-iso-2.6/initrd/template/sbin/init
===================================================================
--- lunar-iso/branches/lunar-iso-2.6/initrd/template/sbin/init	2005-04-30 22:27:18 UTC (rev 14544)
+++ lunar-iso/branches/lunar-iso-2.6/initrd/template/sbin/init	2005-04-30 22:34:49 UTC (rev 14545)
@@ -3,7 +3,7 @@
 #
 # Parts (C) K. Sallee 2002
 # Parts (C) K. Kongar 2002,2003
-# Parts (c) Lunar-Linux 2002,2003,2004
+# Parts (c) Lunar-Linux 2002,2003,2004,2005
 #
 # This document is licensed under the GPL
 #
@@ -187,16 +187,23 @@
     fi
 
     if /bin/mount -n -t $VFSTYPE -o $OPTIONS $ROOT /mnt && [ -x /mnt/sbin/init ]; then
-	/bin/pkill devfsd
-	sleep 1
-        /bin/umount -n /proc
-	/bin/umount -n /dev
-        /sbin/pivot_root /mnt /mnt
-        exec /sbin/init  $*
+       if /bin/echo $KERNEL | /bin/grep -q "^2\.4\." ; then
+	      /bin/pkill devfsd
+	      sleep 1
+       else
+          /bin/pkill udevd
+          sleep 1 
+          /bin/umount -n /sys
+       fi
+
+       /bin/umount -n /proc
+       /bin/umount -n /dev
+       /sbin/pivot_root /mnt /mnt
+       exec /sbin/init  $*
     else
-        $DIALOG --msgbox "Unable to locate /sbin/init on $ROOT." 0 0
-	/bin/umount -n /mnt
-        main $*
+       $DIALOG --msgbox "Unable to locate /sbin/init on $ROOT." 0 0
+       /bin/umount -n /mnt
+       main $*
     fi
 }
 
@@ -212,18 +219,28 @@
 export IFS="	
 "
 export DIALOGRC=/etc/dialogrc
-DIALOG="/bin/dialog
+DIALOG="/usr/bin/dialog
 --backtitle
 Lunar Linux Install/Rescue CDROM
 --stdout"
 
-/bin/mount -n -t proc proc /proc
-/bin/mount -n -t devfs devfs /dev
-/sbin/devfsd /dev &
-
 KERNEL=`/bin/uname -r`
 DEVICE="/dev/cdroms/cdrom"
 
+/bin/mount -n -t proc proc /proc
+
+if /bin/echo $KERNEL | /bin/grep -q "^2\.4\." ; then
+   /bin/mount -n -t devfs devfs /dev
+   /sbin/devfsd /dev &
+else
+   /bin/mount -t sysfs sysfs /sys
+   /bin/mount -t ramfs none /dev
+   /bin/echo "/sbin/udevsend" > /proc/sys/kernel/hotplug
+   /sbin/udevstart
+   /bin/mkdir /dev/{pts,shm}
+   /bin/mount -t devpts devpts /dev/pts
+fi
+
 # fastboot or not?
 if cat /proc/cmdline | grep -q 'skipinitrd=1'; then
     echo ""



More information about the Lunar-commits mailing list