summaryrefslogtreecommitdiff
path: root/packages/slugos-init
diff options
context:
space:
mode:
Diffstat (limited to 'packages/slugos-init')
-rw-r--r--packages/slugos-init/files/boot/disk19
-rw-r--r--packages/slugos-init/files/boot/ram13
-rw-r--r--packages/slugos-init/files/initscripts/loadmodules.sh41
-rw-r--r--packages/slugos-init/files/modulefunctions37
-rw-r--r--packages/slugos-init/slugos-init_0.10.bb4
5 files changed, 52 insertions, 62 deletions
diff --git a/packages/slugos-init/files/boot/disk b/packages/slugos-init/files/boot/disk
index 02b8ee82cf..dca1e422aa 100644
--- a/packages/slugos-init/files/boot/disk
+++ b/packages/slugos-init/files/boot/disk
@@ -8,22 +8,10 @@ export PATH=/sbin:/bin:/usr/sbin:/usr/bin
#
# 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"
+ loaddiskmods
+ #
# 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
diff --git a/packages/slugos-init/files/boot/ram b/packages/slugos-init/files/boot/ram
index 4729e16a78..a7c78b39ac 100644
--- a/packages/slugos-init/files/boot/ram
+++ b/packages/slugos-init/files/boot/ram
@@ -12,19 +12,6 @@ export PATH=/sbin:/bin:/usr/sbin:/usr/bin
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"
diff --git a/packages/slugos-init/files/initscripts/loadmodules.sh b/packages/slugos-init/files/initscripts/loadmodules.sh
index f2b28d8868..e80f995598 100644
--- a/packages/slugos-init/files/initscripts/loadmodules.sh
+++ b/packages/slugos-init/files/initscripts/loadmodules.sh
@@ -1,44 +1,15 @@
#!/bin/sh
# This script is used for loading modules required by SlugOS
-# Currently, this script only supports the NSLU2
+# This script may not be necessary if udev is present, but is included
+# for 'backup' purposes in case udev is playing silly buggers
-. /etc/default/functions # Load $(machine) function required
+. /etc/default/modulefunctions # Load module loading logic
-echo "Starting Network Processing Engines"
-modprobe ixp4xx_npe
-sleep 1 # Wait for firmware load
+loadnetmods
-echo "Loading networking modules"
+loaddiskmods
-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
-
-# 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
diff --git a/packages/slugos-init/files/modulefunctions b/packages/slugos-init/files/modulefunctions
new file mode 100644
index 0000000000..c6719d4f79
--- /dev/null
+++ b/packages/slugos-init/files/modulefunctions
@@ -0,0 +1,37 @@
+#!/bin/sh
+# . this file to load the functions for automatically loading modules
+
+. /etc/default/functions
+
+loaddiskmods(){
+ modprobe scsi_mod
+ modprobe sd_mod
+ modprobe usbcore
+ case "$(machine)" in
+ nslu2)
+ modprobe ehci-hcd
+ modprobe ohci-hcd
+ ;;
+ nas100d)
+ modprobe ehci-hcd
+ modprobe uhci-hcd
+ ;;
+
+ esac
+ modprobe usb-storage
+}
+
+loadnetmods(){
+ modprobe af_packet
+ case "$(machine)" in
+ ixdp425|nslu2|nas100d)
+ modprobe ixp4xx_mac
+ ;;
+ esac
+}
+
+loadmiscmods(){
+ modprobe ixp4xx_rng
+ modprobe i2c_dev
+}
+
diff --git a/packages/slugos-init/slugos-init_0.10.bb b/packages/slugos-init/slugos-init_0.10.bb
index 4c775dd1d7..d6ce0b5f65 100644
--- a/packages/slugos-init/slugos-init_0.10.bb
+++ b/packages/slugos-init/slugos-init_0.10.bb
@@ -4,7 +4,7 @@ PRIORITY = "required"
LICENSE = "GPL"
DEPENDS = "base-files devio"
RDEPENDS = "busybox devio"
-PR = "r67"
+PR = "r69"
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/