[oe-commits] org.oe.dev busybox: drop in an mdev patch from busybox.net

blaster8 commit openembedded-commits at lists.openembedded.org
Sun Sep 24 08:41:44 UTC 2006


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

Author: blaster8 at nslu2-linux.org
Branch: org.openembedded.dev
Revision: 6ff348260412742b1d440ddecd4bbe3ad5355017
ViewMTN: http://monotone.openembedded.org/revision.psp?id=6ff348260412742b1d440ddecd4bbe3ad5355017
Files:
1
packages/slugos-init/files/initscripts/loadmiscmod.sh
packages/slugos-init/files/initscripts/loadnetmod.sh
packages/slugos-init/files/initscripts/loadusbmod.sh
packages/busybox/busybox-1.2.1/mdevdelnodes.patch
packages/slugos-init/files/initscripts/loadmodules.sh
packages/busybox/busybox_1.2.1.bb
packages/slugos-init/slugos-init_0.10.bb
Diffs:

#
# mt diff -rb6746550dd8e9abc88c86ecc5d585192c6bcb3c6 -r6ff348260412742b1d440ddecd4bbe3ad5355017
#
# 
# 
# delete "packages/slugos-init/files/initscripts/loadmiscmod.sh"
# 
# delete "packages/slugos-init/files/initscripts/loadnetmod.sh"
# 
# delete "packages/slugos-init/files/initscripts/loadusbmod.sh"
# 
# add_file "packages/busybox/busybox-1.2.1/mdevdelnodes.patch"
#  content [9379dea51b13c4bac48aadf9f1a95487210c7284]
# 
# add_file "packages/slugos-init/files/initscripts/loadmodules.sh"
#  content [6f621c7c5d135694b4ec8b7ad5e2552296c96b1e]
# 
# patch "packages/busybox/busybox_1.2.1.bb"
#  from [6aeb42b7b6426fba0b15b3c8d38ec22cd592d686]
#    to [d3686ad4861d21be92f2512bba95aa15aa1fd2a3]
# 
# patch "packages/slugos-init/slugos-init_0.10.bb"
#  from [9190f47ed2a587818058c2972f7b4b37bf363105]
#    to [363deae1f50819d92354f05c2b8aa9bd9a12376b]
# 
============================================================
--- packages/busybox/busybox-1.2.1/mdevdelnodes.patch	9379dea51b13c4bac48aadf9f1a95487210c7284
+++ packages/busybox/busybox-1.2.1/mdevdelnodes.patch	9379dea51b13c4bac48aadf9f1a95487210c7284
@@ -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);
+ 
============================================================
--- packages/slugos-init/files/initscripts/loadmodules.sh	6f621c7c5d135694b4ec8b7ad5e2552296c96b1e
+++ packages/slugos-init/files/initscripts/loadmodules.sh	6f621c7c5d135694b4ec8b7ad5e2552296c96b1e
@@ -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
============================================================
--- packages/busybox/busybox_1.2.1.bb	6aeb42b7b6426fba0b15b3c8d38ec22cd592d686
+++ packages/busybox/busybox_1.2.1.bb	d3686ad4861d21be92f2512bba95aa15aa1fd2a3
@@ -10,13 +10,14 @@ PRIORITY = "required"
 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 \
============================================================
--- packages/slugos-init/slugos-init_0.10.bb	9190f47ed2a587818058c2972f7b4b37bf363105
+++ packages/slugos-init/slugos-init_0.10.bb	363deae1f50819d92354f05c2b8aa9bd9a12376b
@@ -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 = "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 @@ INITSCRIPTS = "syslog.buffer syslog.file
 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 @@ pkg_postinst_slugos-init() {
 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 .






More information about the Openembedded-commits mailing list