summaryrefslogtreecommitdiff
path: root/packages/mdev
diff options
context:
space:
mode:
authorMichael-Luke Jones <mlj28@cam.ac.uk>2006-09-26 19:30:49 +0000
committerMichael-Luke Jones <mlj28@cam.ac.uk>2006-09-26 19:30:49 +0000
commit95fea465c9286297ec719febbb1231909854cf51 (patch)
treebb940b62148e7a500d59a163bde8fff7db32e1ef /packages/mdev
parentc31179aa7e8ae910b86ca7bd08f795bdf249a289 (diff)
mdev: Add proper firmware loading support to mdev
* Patch contributed by Christian Hohnstaedt * mdev.conf updated to reflect change in firmware loading
Diffstat (limited to 'packages/mdev')
-rw-r--r--packages/mdev/mdev-1.2.1/firmware14
-rw-r--r--packages/mdev/mdev-1.2.1/mdevfirmware.patch20
-rw-r--r--packages/mdev/mdev-1.2.1/slugos/loadmicrocode.sh29
-rw-r--r--packages/mdev/mdev-1.2.1/slugos/mdev.conf2
-rw-r--r--packages/mdev/mdev_1.2.1.bb11
5 files changed, 41 insertions, 35 deletions
diff --git a/packages/mdev/mdev-1.2.1/firmware b/packages/mdev/mdev-1.2.1/firmware
new file mode 100644
index 0000000000..c88d3fbe22
--- /dev/null
+++ b/packages/mdev/mdev-1.2.1/firmware
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+firmwaredir=/lib/firmware
+
+if test "$SUBSYSTEM" = "firmware" -a "$ACTION" = "add"; then
+ if test -f $firmwaredir/$FIRMWARE; then
+ echo 1 > /sys/$DEVPATH/loading
+ cat $firmwaredir/$FIRMWARE > /sys/$DEVPATH/data
+ echo 0 > /sys/$DEVPATH/loading
+ else
+ echo -1 > /sys/$DEVPATH/loading
+ fi
+fi
+
diff --git a/packages/mdev/mdev-1.2.1/mdevfirmware.patch b/packages/mdev/mdev-1.2.1/mdevfirmware.patch
new file mode 100644
index 0000000000..8dae2a9921
--- /dev/null
+++ b/packages/mdev/mdev-1.2.1/mdevfirmware.patch
@@ -0,0 +1,20 @@
+--- busybox-1.2.1/util-linux/mdev.c.orig 2006-07-01 00:42:13.000000000 +0200
++++ busybox-1.2.1/util-linux/mdev.c 2006-09-26 17:42:38.414162744 +0200
+@@ -255,7 +255,16 @@
+ bb_show_usage();
+
+ sprintf(temp, "/sys%s", env_path);
+- if (!strcmp(action, "add")) make_device(temp,0);
++ if (!strcmp(action, "add")) {
++ struct stat st;
++ make_device(temp,0);
++ sprintf(temp, "/lib/mdev/%s", getenv("SUBSYSTEM"));
++ if (stat(temp, &st) == 0) {
++ if ((st.st_mode & S_IXUSR) && S_ISREG(st.st_mode)) {
++ system(temp);
++ }
++ }
++ }
+ else if (!strcmp(action, "remove")) make_device(temp,1);
+ }
+
diff --git a/packages/mdev/mdev-1.2.1/slugos/loadmicrocode.sh b/packages/mdev/mdev-1.2.1/slugos/loadmicrocode.sh
deleted file mode 100644
index ad1a9e7a44..0000000000
--- a/packages/mdev/mdev-1.2.1/slugos/loadmicrocode.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-
-# Manual firmware loading with firmware_class
-# Reason: Because I can (or because mdev doesn't support firmware loading)
-# Trigger: Creation of the /dev/ixp4xx_ucode device (this is hacky too, unfortunately)
-
-sleep 1
-
-# Cancel NPE-A microcode upload
-echo -1 > /sys/class/firmware/ixp4xx_npe.0/loading
-
-sleep 1
-
-# Test for NPE-B presence
-
-if test -f /lib/firmware/NPE-B; then
- # Upload NPE-B microcode
- echo 1 > /sys/class/firmware/ixp4xx_npe.1/loading
- cat /lib/firmware/NPE-B > /sys/class/firmware/ixp4xx_npe.1/data
- echo 0 > /sys/class/firmware/ixp4xx_npe.1/loading
-else
- # Cancel NPE-B microcode upload
- echo -1 > /sys/class/firmware/ixp4xx_npe.1/loading
-fi
-
-sleep 1
-
-# Cancel NPE-C microcode upload
-echo -1 > /sys/class/firmware/ixp4xx_npe.2/loading
diff --git a/packages/mdev/mdev-1.2.1/slugos/mdev.conf b/packages/mdev/mdev-1.2.1/slugos/mdev.conf
index eaf77e64d7..751663e53e 100644
--- a/packages/mdev/mdev-1.2.1/slugos/mdev.conf
+++ b/packages/mdev/mdev-1.2.1/slugos/mdev.conf
@@ -9,4 +9,4 @@ ptmx 0:5 666
tty 0:5 0660
ttyS* 0:20 640
event0 0:0 660 @ln -sf /dev/event0 /dev/buzzer
-ixp4xx_ucode root:root 600 @/lib/mdev/loadmicrocode.sh \ No newline at end of file
+ixp4xx_ucode root:root 600
diff --git a/packages/mdev/mdev_1.2.1.bb b/packages/mdev/mdev_1.2.1.bb
index b2496f5852..78f7e942f1 100644
--- a/packages/mdev/mdev_1.2.1.bb
+++ b/packages/mdev/mdev_1.2.1.bb
@@ -4,22 +4,23 @@ busybox. This adds a very small extra overhead in rootfs size \
(approx 4kB) but allows greater flexibility."
HOMEPAGE = "http://www.busybox.net"
LICENSE = "GPL"
-PR = "r4"
+PR = "r5"
S = ${WORKDIR}/busybox-${PV}
SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.gz \
file://mdevdelnodes.patch;patch=1 \
- file://defconfig \
+ file://mdevfirmware.patch;patch=1 \
+ file://defconfig \
file://mdev.sh \
file://mdev.conf \
+ file://firmware \
"
-SRC_URI_append_slugos = "file://loadmicrocode.sh"
export EXTRA_CFLAGS = "${CFLAGS}"
EXTRA_OEMAKE_append = " CROSS=${HOST_PREFIX}"
-FILES_${PN} = "${sysconfdir}/init.d/mdev.sh ${sysconfdir}/mdev.conf ${base_sbindir}/mdev ${base_libdir}/mdev/loadmicrocode.sh"
+FILES_${PN} = "${sysconfdir}/init.d/mdev.sh ${sysconfdir}/mdev.conf ${base_sbindir}/mdev ${base_libdir}/mdev/firmware"
INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_NAME_${PN} = "mdev.sh"
@@ -56,5 +57,5 @@ do_install () {
install -m 0755 ${WORKDIR}/mdev.sh ${D}${sysconfdir}/init.d/
install -d ${D}${base_libdir}/mdev
- install -m 0755 ${WORKDIR}/loadmicrocode.sh ${D}${base_libdir}/mdev/loadmicrocode.sh
+ install -m 0755 ${WORKDIR}/firmware ${D}${base_libdir}/mdev/firmware
}