summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorMichael-Luke Jones <mlj28@cam.ac.uk>2006-09-24 08:30:45 +0000
committerMichael-Luke Jones <mlj28@cam.ac.uk>2006-09-24 08:30:45 +0000
commitb063040bc4416c347fb179df5fa71402cd6011d0 (patch)
tree525200d1114e10823ef7dfc3e59bded3835c7116 /packages
parenta56c24ff15fdd6f51cc2cd606c459b76388162c7 (diff)
busybox: drop in an mdev patch from busybox.net
slugos-init: add in module loading logic for NSLU2 * Maintainers with other ixp4xx devices should follow suit
Diffstat (limited to 'packages')
-rw-r--r--packages/busybox/busybox-1.2.1/mdevdelnodes.patch39
-rw-r--r--packages/busybox/busybox_1.2.1.bb3
-rw-r--r--packages/slugos-init/files/initscripts/loadmiscmod.sh12
-rw-r--r--packages/slugos-init/files/initscripts/loadmodules.sh42
-rw-r--r--packages/slugos-init/files/initscripts/loadnetmod.sh17
-rw-r--r--packages/slugos-init/files/initscripts/loadusbmod.sh20
-rw-r--r--packages/slugos-init/slugos-init_0.10.bb12
7 files changed, 87 insertions, 58 deletions
diff --git a/packages/busybox/busybox-1.2.1/mdevdelnodes.patch b/packages/busybox/busybox-1.2.1/mdevdelnodes.patch
new file mode 100644
index 0000000000..b63a703a89
--- /dev/null
+++ b/packages/busybox/busybox-1.2.1/mdevdelnodes.patch
@@ -0,0 +1,39 @@
+Patch from Chris Steel to fix mdev deleting device nodes.
+
+--- busybox/util-linux/mdev.c 2006/08/03 15:41:12 15767
++++ busybox/util-linux/mdev.c 2006/08/10 01:09:37 15795
+@@ -37,18 +37,19 @@
+ * because sscanf() will stop at the first nondigit, which \n is. We
+ * also depend on path having writeable space after it. */
+
+- strcat(path, "/dev");
+- fd = open(path, O_RDONLY);
+- len = read(fd, temp + 1, 64);
+- *temp++ = 0;
+- close(fd);
+- if (len < 1) return;
++ if (!delete) {
++ strcat(path, "/dev");
++ fd = open(path, O_RDONLY);
++ len = read(fd, temp + 1, 64);
++ *temp++ = 0;
++ close(fd);
++ if (len < 1) return;
++ }
+
+ /* Determine device name, type, major and minor */
+
+ device_name = strrchr(path, '/') + 1;
+ type = path[5]=='c' ? S_IFCHR : S_IFBLK;
+- if (sscanf(temp, "%d:%d", &major, &minor) != 2) return;
+
+ /* If we have a config file, look up permissions for this device */
+
+@@ -164,6 +165,7 @@
+
+ umask(0);
+ if (!delete) {
++ if (sscanf(temp, "%d:%d", &major, &minor) != 2) return;
+ if (mknod(device_name, mode | type, makedev(major, minor)) && errno != EEXIST)
+ bb_perror_msg_and_die("mknod %s failed", device_name);
+
diff --git a/packages/busybox/busybox_1.2.1.bb b/packages/busybox/busybox_1.2.1.bb
index 8e1204ef78..2c3d5c4cb7 100644
--- a/packages/busybox/busybox_1.2.1.bb
+++ b/packages/busybox/busybox_1.2.1.bb
@@ -10,13 +10,14 @@ HOMEPAGE = "http://www.busybox.net"
LICENSE = "GPL"
SECTION = "base"
PRIORITY = "required"
-PR = "r1.5"
+PR = "r1.6"
SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.gz \
file://dhcp-hostname.patch;patch=1 \
file://ifupdown-spurious-environ.patch;patch=1 \
file://udhcpscript.patch;patch=1 \
file://wget-long-options.patch;patch=1 \
+ file://mdevdelnodes.patch;patch=1 \
file://defconfig \
file://busybox-cron \
file://busybox-httpd \
diff --git a/packages/slugos-init/files/initscripts/loadmiscmod.sh b/packages/slugos-init/files/initscripts/loadmiscmod.sh
deleted file mode 100644
index d2d09821f1..0000000000
--- a/packages/slugos-init/files/initscripts/loadmiscmod.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-# This script is used for loading modules required for other purposes than
-# usb or networking
-
-# A way of finding which embedded board SlugOS is being run on is needed
-
-echo "Loading misc modules"
-modprobe ixp4xx_rng
-modprobe i2c_dev
-
-exit 0 \ No newline at end of file
diff --git a/packages/slugos-init/files/initscripts/loadmodules.sh b/packages/slugos-init/files/initscripts/loadmodules.sh
new file mode 100644
index 0000000000..2ed4156ab0
--- /dev/null
+++ b/packages/slugos-init/files/initscripts/loadmodules.sh
@@ -0,0 +1,42 @@
+#!/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
+
+echo "Loading networking modules"
+
+modprobe af_packet # Required for DHCP
+
+modprobe ixp4xx_npe
+sleep 1 # Allow firmware load to occur
+
+# 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 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
+
+exit 0 \ No newline at end of file
diff --git a/packages/slugos-init/files/initscripts/loadnetmod.sh b/packages/slugos-init/files/initscripts/loadnetmod.sh
deleted file mode 100644
index eb8f3eb9dd..0000000000
--- a/packages/slugos-init/files/initscripts/loadnetmod.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-# This script is used for loading modules required for networking
-
-# A way of finding which embedded board SlugOS is being run on is needed
-
-echo "Loading networking modules"
-
-modprobe af_packet #Required for DHCP
-
-modprobe ixp4xx_npe
-sleep 1 #Allow Firmware Load
-
-#Conditional required: Not all IXP4xx boards use onboard MAC
-modprobe ixp4xx_mac
-
-exit 0 \ No newline at end of file
diff --git a/packages/slugos-init/files/initscripts/loadusbmod.sh b/packages/slugos-init/files/initscripts/loadusbmod.sh
deleted file mode 100644
index 92866dcf6d..0000000000
--- a/packages/slugos-init/files/initscripts/loadusbmod.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-# This script is used for loading modules required for usb storage devices
-# As this script is run very early in the boot process, insmod is used
-
-echo "Loading usb storage modules"
-insmod /lib/modules/2.6.18/kernel/drivers/scsi/scsi_mod.ko
-insmod /lib/modules/2.6.18/kernel/drivers/usb/core/usbcore.ko
-#Conditional required: NSLU2 has ohci/ehci but others have uhci/ehci
-insmod /lib/modules/2.6.18/kernel/drivers/usb/host/ohci-hcd.ko
-insmod /lib/modules/2.6.18/kernel/drivers/usb/host/ehci-hcd.ko
-insmod /lib/modules/2.6.18/kernel/drivers/usb/storage/usb-storage.ko
-
-echo "Loading ext2/3 support"
-insmod /lib/modules/2.6.18/kernel/fs/mbcache.ko
-insmod /lib/modules/2.6.18/kernel/fs/jbd/jbd.ko
-insmod /lib/modules/2.6.18/kernel/fs/ext2/ext2.ko
-insmod /lib/modules/2.6.18/kernel/fs/ext3/ext3.ko
-
-exit 0 \ No newline at end of file
diff --git a/packages/slugos-init/slugos-init_0.10.bb b/packages/slugos-init/slugos-init_0.10.bb
index 0fe8860648..be5fc61789 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 = "r63"
+PR = "r64"
SRC_URI = "file://boot/flash \
file://boot/disk \
@@ -21,9 +21,7 @@ SRC_URI = "file://boot/flash \
file://initscripts/rmrecovery \
file://initscripts/sysconfsetup \
file://initscripts/umountinitrd.sh \
- file://initscripts/loadusbmod.sh \
- file://initscripts/loadnetmod.sh \
- file://initscripts/loadmiscmod.sh \
+ file://initscripts/loadmodules.sh \
file://functions \
file://conffiles \
file://sysconf \
@@ -40,7 +38,7 @@ SCRIPTS = "turnup reflash leds sysconf"
BOOTSCRIPTS = "flash disk nfs ram network udhcpc.script"
INITSCRIPTS = "syslog.buffer syslog.file syslog.network zleds\
leds_startup rmrecovery sysconfsetup umountinitrd.sh\
- fixfstab loadusbmod.sh loadnetmod.sh loadmiscmod.sh"
+ fixfstab loadmodules.sh"
# This just makes things easier...
S="${WORKDIR}"
@@ -123,14 +121,12 @@ do_install() {
pkg_postinst_slugos-init() {
opt=
test -n "$D" && opt="-r $D"
- update-rc.d $opt loadusbmod.sh start 6 S .
update-rc.d $opt hwclock.sh start 8 S . start 45 0 6 .
update-rc.d $opt umountinitrd.sh start 9 S .
update-rc.d $opt fixfstab start 10 S .
update-rc.d $opt syslog.buffer start 11 S . start 49 0 6 .
update-rc.d $opt sysconfsetup start 12 S .
- update-rc.d $opt loadnetmod.sh start 21 S .
- update-rc.d $opt loadmiscmod.sh start 22 S .
+ update-rc.d $opt loadmodules.sh start 21 S .
update-rc.d $opt syslog.file start 39 S . start 47 0 6 .
update-rc.d $opt syslog.network start 44 S . start 39 0 6 .
update-rc.d $opt zleds start 99 S 1 2 3 4 5 . start 89 0 6 . stop 5 0 1 2 3 4 5 6 .