[oe-commits] org.oe.dev slugos-init: improve module loading at boot

blaster8 commit openembedded-commits at lists.openembedded.org
Thu Sep 28 12:02:59 UTC 2006


slugos-init: improve module loading at boot

Author: blaster8 at nslu2-linux.org
Branch: org.openembedded.dev
Revision: 78ec23151eb467654dc2cc3aec6ecf23a60fb8b3
ViewMTN: http://monotone.openembedded.org/revision.psp?id=78ec23151eb467654dc2cc3aec6ecf23a60fb8b3
Files:
1
packages/slugos-init/files/boot/disk
packages/slugos-init/files/boot/ram
packages/slugos-init/files/initscripts/loadmodules.sh
packages/slugos-init/slugos-init_0.10.bb
Diffs:

#
# mt diff -rb4422f8e2fbc9192ee79d09122f221f89665626c -r78ec23151eb467654dc2cc3aec6ecf23a60fb8b3
#
# 
# 
# patch "packages/slugos-init/files/boot/disk"
#  from [e6516cda7cfdeadff061e3d2abdfc41ee646b6b4]
#    to [bf9133a87e100f13901a997ff267050975248bad]
# 
# patch "packages/slugos-init/files/boot/ram"
#  from [7777a27495729efaf16b2a7ff3b01acbb99278e8]
#    to [0196e2404034a031dd316f8be685fd7072e05d4a]
# 
# patch "packages/slugos-init/files/initscripts/loadmodules.sh"
#  from [f06b7f2a38b979527214d62314f23cf7dd683465]
#    to [3acb608206d7754011945ca7ba8e45f18e4a90da]
# 
# patch "packages/slugos-init/slugos-init_0.10.bb"
#  from [fbb783f272da87f847d6f1f07755cc6a3a1228c9]
#    to [0f1ec24220ffd684c21edcd8db62bb273fc444d6]
# 
============================================================
--- packages/slugos-init/files/boot/disk	e6516cda7cfdeadff061e3d2abdfc41ee646b6b4
+++ packages/slugos-init/files/boot/disk	bf9133a87e100f13901a997ff267050975248bad
@@ -8,22 +8,10 @@ export PATH=/sbin:/bin:/usr/sbin:/usr/bi
 #
 # Load the helper functions
 . /etc/default/functions
+. /etc/default/modulefunctions
 #
 leds boot system
 #
-# Load the required SCSI and USB modules 'by hand'
-insmod /lib/modules/`uname -r`/kernel/drivers/scsi/scsi_mod.ko
-insmod /lib/modules/`uname -r`/kernel/drivers/scsi/sd_mod.ko
-insmod /lib/modules/`uname -r`/kernel/drivers/usb/core/usbcore.ko
-# Add more cases here for different boards
-case "$(machine)" in
-    nslu2)
-	insmod /lib/modules/`uname -r`/kernel/drivers/usb/host/ehci-hcd.ko
-	insmod /lib/modules/`uname -r`/kernel/drivers/usb/host/ohci-hcd.ko
-        ;;
-esac
-insmod /lib/modules/`uname -r`/kernel/drivers/usb/storage/usb-storage.ko
-#
 if test -n "$1"
 then
 	device="$1"
@@ -35,6 +23,11 @@ then
 	#
 	# proc is needed for UUID mount
 	mount -t proc proc /proc 
+	#
+	# load USB & SCSI storage modules (/proc required!)
+	echo "boot: loading modules required for boot"
+	loadusbmods
+	#
 	# Mount read-write because before exec'ing init
 	# If a UUID is given (in the environment) this
 	# is used in preference to the device, but if
============================================================
--- packages/slugos-init/files/boot/ram	7777a27495729efaf16b2a7ff3b01acbb99278e8
+++ packages/slugos-init/files/boot/ram	0196e2404034a031dd316f8be685fd7072e05d4a
@@ -12,19 +12,6 @@ leds boot system
 leds beep -r 2
 leds boot system
 #
-# Load the required SCSI and USB modules 'by hand'
-insmod /lib/modules/`uname -r`/kernel/drivers/scsi/scsi_mod.ko
-insmod /lib/modules/`uname -r`/kernel/drivers/scsi/sd_mod.ko
-insmod /lib/modules/`uname -r`/kernel/drivers/usb/core/usbcore.ko
-# Add more cases here for different boards
-case "$(machine)" in
-    nslu2)
-        insmod /lib/modules/`uname -r`/kernel/drivers/usb/host/ehci-hcd.ko
-        insmod /lib/modules/`uname -r`/kernel/drivers/usb/host/ohci-hcd.ko
-        ;;
-esac
-insmod /lib/modules/`uname -r`/kernel/drivers/usb/storage/usb-storage.ko
-#
 if test -n "$1"
 then
 	device="$1"
============================================================
--- packages/slugos-init/files/initscripts/loadmodules.sh	f06b7f2a38b979527214d62314f23cf7dd683465
+++ packages/slugos-init/files/initscripts/loadmodules.sh	3acb608206d7754011945ca7ba8e45f18e4a90da
@@ -1,44 +1,18 @@
 #!/bin/sh
 
 # This script is used for loading modules required by SlugOS
 # Currently, this script only supports the NSLU2
 
 . /etc/default/functions # Load $(machine) function required
+. /etc/default/modulefunctions
 
-echo "Starting Network Processing Engines"
-modprobe ixp4xx_npe
-sleep 1 # Wait for firmware load
-
 echo "Loading networking modules"
+loadnetmods
 
-modprobe af_packet # Required for DHCP
-
-# Add nas100d/loft below when mac definition is added to kernel
-case "$(machine)" in
-    ixdp425|nslu2)
-        modprobe ixp4xx_mac
-        ;;
-esac
-
-# Add conditional DSM-G600 ethernet module load
-
 echo "Loading usb storage modules"
-modprobe scsi_mod
-modprobe sd_mod
-modprobe usbcore
+loadusbmods
 
-# Add more entries as appropriate
-case "$(machine)" in
-    nslu2)
-        modprobe ohci_hcd
-        modprobe ehci_hcd
-        ;;
-esac
-
-modprobe usb_storage
-
 echo "Loading other modules"
-modprobe ixp4xx_rng
-modprobe i2c_dev
+loadmiscmods
 
 exit 0
============================================================
--- packages/slugos-init/slugos-init_0.10.bb	fbb783f272da87f847d6f1f07755cc6a3a1228c9
+++ packages/slugos-init/slugos-init_0.10.bb	0f1ec24220ffd684c21edcd8db62bb273fc444d6
@@ -1,10 +1,10 @@ RDEPENDS = "busybox devio"
 DESCRIPTION = "SlugOS initial network config via sysconf"
 SECTION = "base"
 PRIORITY = "required"
 LICENSE = "GPL"
 DEPENDS = "base-files devio"
 RDEPENDS = "busybox devio"
-PR = "r67"
+PR = "r68"
 
 SRC_URI = "file://boot/flash \
 	   file://boot/disk \
@@ -23,6 +23,7 @@ SRC_URI = "file://boot/flash \
 	   file://initscripts/umountinitrd.sh \
 	   file://initscripts/loadmodules.sh \
 	   file://functions \
+	   file://modulefunctions \
 	   file://conffiles \
 	   file://sysconf \
 	   file://leds \
@@ -89,6 +90,7 @@ do_install() {
 	#
 	# Init scripts
 	install -m 0644 functions ${D}${sysconfdir}/default
+	install -m 0644 modulefunctions ${D}${sysconfdir}/default	
 	for s in ${INITSCRIPTS}
 	do
 		install -m 0755 initscripts/$s ${D}${sysconfdir}/init.d/






More information about the Openembedded-commits mailing list