CVS: initscripts/rc.d rc.sysinit,1.7,1.8

Jasper Huysmans jasper at lunar-linux.org
Tue Nov 18 08:13:39 GMT 2003


Update of /var/cvs/lunar/initscripts/rc.d
In directory dbguin.lunar-linux.org:/tmp/cvs-serv26206

Modified Files:
	rc.sysinit 
Log Message:
Fix a devpts issue, add module loading from /etc/modules

Index: rc.sysinit
===================================================================
RCS file: /var/cvs/lunar/initscripts/rc.d/rc.sysinit,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- rc.sysinit	6 Nov 2003 13:52:09 -0000	1.7
+++ rc.sysinit	18 Nov 2003 08:13:37 -0000	1.8
@@ -11,21 +11,6 @@
   exec /sbin/initlog $INITLOG_ARGS -r /etc/rc.d/rc.sysinit
 fi
 
-# If we're using devfs, start devfsd now - we need the old device names
-# because lunar kernels are not automatically mounting devfs we do it here
-[ -e /dev/.devfsd -a -x /sbin/devfsd ] && {
-  mount -n -t devfs devfs /dev
-  /sbin/devfsd /dev
-}
-
-HOSTNAME=`/bin/hostname`
-if [ -f /etc/sysconfig/network ]; then
-  . /etc/sysconfig/network
-fi
-if [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" ]; then
-  HOSTNAME=localhost
-fi
-
 # check kernel version
 unamer=$(uname -r)
 
@@ -37,7 +22,25 @@
 # Mount /proc (done here so volume labels can work with fsck)
 mount -n -t proc /proc /proc
 [ -n "$TWODOTSIX" ] && mount -n -t sysfs /sys /sys
-mount -n -t devpts /dev/pts /dev/pts
+
+# If we're using devfs, start devfsd now - we need the old device names.
+# Because lunar kernels are not automatically mounting devfs we do it here.
+# /dev/pts must be mounted before running devfsd, but after mounting devfs
+if [ -e /dev/.devfsd -a -x /sbin/devfsd ] ; then
+  mount -n -t devfs devfs /dev
+  mount -n /dev/pts
+  /sbin/devfsd /dev
+else
+  mount -n /dev/pts
+fi
+
+HOSTNAME=`/bin/hostname`
+if [ -f /etc/sysconfig/network ]; then
+  . /etc/sysconfig/network
+fi
+if [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" ]; then
+  HOSTNAME=localhost
+fi
 
 . /etc/init.d/functions
 
@@ -184,7 +187,7 @@
 # Initialiaze ACPI bits
 if [ -d /proc/acpi ]; then
    for module in /lib/modules/$unamer/kernel/drivers/acpi/* ; do
-      insmod $module
+      [ -f $module ] && insmod $module
    done
 fi
 
@@ -195,10 +198,10 @@
   if ! LC_ALL=C fgrep -q "usb" /proc/devices 2>/dev/null ; then
     aliases=`/sbin/modprobe -c | awk '/^alias usb-controller/ { print $3 }'`
     if [ -n "$aliases" -a "$aliases" != "off" ]; then
-      modprobe usbcore
+      /sbin/modprobe usbcore
       for alias in $aliases ; do 
       	[ "$alias" = "off" ] && continue
-	action $"Initializing USB controller ($alias): " modprobe $alias
+	action $"Initializing USB controller ($alias): " /sbin/modprobe $alias
       done
       [ $? -eq 0 -a -n "$aliases" ] && usb=1
     fi
@@ -216,14 +219,14 @@
 if [ $usb = "1" ]; then
   needusbstorage=`LC_ALL=C grep -e "^I.*Cls=08" /proc/bus/usb/devices 2>/dev/null`
   LC_ALL=C fgrep -q 'hid' /proc/bus/usb/drivers 2>/dev/null || \
-    action $"Initializing USB HID interface: " modprobe hid 2> /dev/null
+    action $"Initializing USB HID interface: " /sbin/modprobe hid 2> /dev/null
 
   if [ -z "$TWODOTSIX" ] ; then
-    action $"Initializing USB keyboard: " modprobe keybdev 2> /dev/null
-    action $"Initializing USB mouse: " modprobe mousedev 2> /dev/null 
+    action $"Initializing USB keyboard: " /sbin/modprobe keybdev 2> /dev/null
+    action $"Initializing USB mouse: " /sbin/modprobe mousedev 2> /dev/null 
   elif [ "$USB_HID_BOOTPROTO" = "yes" ]; then
-    action $"Initializing USB keyboard: " modprobe usbkbd 2> /dev/null
-    action $"Initializing USB mouse: " modprobe usbmouse  2> /dev/null 
+    action $"Initializing USB keyboard: " /sbin/modprobe usbkbd 2> /dev/null
+    action $"Initializing USB mouse: " /sbin/modprobe usbmouse  2> /dev/null 
   fi
 fi
 
@@ -357,7 +360,7 @@
 
 # LVM initialization
 if [ -f /etc/lvmtab ]; then
-  [ -e /proc/lvm ] || modprobe lvm-mod > /dev/null 2>&1
+  [ -e /proc/lvm ] || /sbin/modprobe lvm-mod > /dev/null 2>&1
   if [ -e /proc/lvm -a -x /sbin/vgchange ]; then
     action $"Setting up Logical Volume Management:" /sbin/vgscan && /sbin/vgchange -a y
   fi
@@ -422,11 +425,11 @@
 if LC_ALL=C fgrep -q "options sound dmabuf=1" /etc/modules.conf 2>/dev/null ; then
   alias=`/sbin/modprobe -c | awk '/^alias sound / { print $3 }'`
   if [ -n "$alias" -a "$alias" != "off" ]; then
-    action $"Loading sound module ($alias): " modprobe sound
+    action $"Loading sound module ($alias): " /sbin/modprobe sound
   fi
   alias=`/sbin/modprobe -c | awk '/^alias sound-slot-0 / { print $3 }'`
   if [ -n "$alias" -a "$alias" != "off" ]; then
-    action $"Loading sound module ($alias): " modprobe sound-slot-0
+    action $"Loading sound module ($alias): " /sbin/modprobe sound-slot-0
   fi
 fi
 
@@ -445,11 +448,18 @@
  # if [ -f /etc/rc.modules ]; then
  #   /etc/rc.modules
  # fi
+# Lunar module loading script moved here:
+if [ -n "$USEMODULES" -a -f /etc/modules ]; then
+  echo $"Loading modules from /etc/modules"
+  for module in $(cat /etc/modules); do
+    action " * $module :" /sbin/modprobe $module
+  done
+fi
 
  # update_boot_stage RCraid
 if [ -f /etc/raidtab ]; then
   # Add raid devices
-  [ -f /proc/mdstat ] || modprobe md >/dev/null 2>&1
+  [ -f /proc/mdstat ] || /sbin/modprobe md >/dev/null 2>&1
 
   if [ -f /proc/mdstat ]; then
     echo -n $"Starting up RAID devices: " 
@@ -708,14 +718,14 @@
   if [ -f /proc/scsi/scsi -a -n "$USEMODULES" ]; then
     if LC_ALL=C fgrep -q 'Type:   Sequential-Access' /proc/scsi/scsi 2>/dev/null ; then
       if LC_ALL=C fgrep -qv ' 9 st' /proc/devices ; then
-	modprobe st >/dev/null 2>&1
+	/sbin/modprobe st >/dev/null 2>&1
       fi
     fi
   fi
 
   # Load usb storage here, to match most other things
   if [ -n "$needusbstorage" ]; then
-    modprobe usb-storage >/dev/null 2>&1
+    /sbin/modprobe usb-storage >/dev/null 2>&1
   fi
 
   # Ooh, firewire too.
@@ -724,17 +734,17 @@
     if [ -n "$aliases" -a "$aliases" != "off" ]; then
       for alias in $aliases ; do 
       	[ "$alias" = "off" ] && continue
-	action $"Initializing firewire controller ($alias): " modprobe $alias
+	action $"Initializing firewire controller ($alias): " /sbin/modprobe $alias
       done
       LC_ALL=C fgrep -q "SBP2" /proc/bus/ieee1394/devices 2>/dev/null && \
-	modprobe sbp2 >/dev/null 2>&1
+	/sbin/modprobe sbp2 >/dev/null 2>&1
     fi
   fi
 
   # If they asked for ide-scsi, load it
   if strstr "$cmdline" ide-scsi ; then
-    modprobe ide-cd >/dev/null 2>&1
-    modprobe ide-scsi >/dev/null 2>&1
+    /sbin/modprobe ide-cd >/dev/null 2>&1
+    /sbin/modprobe ide-scsi >/dev/null 2>&1
   fi
 
   # Turn on harddisk optimization




More information about the Lunar-commits mailing list