summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--images/NEWS1
-rwxr-xr-ximages/make_boot_img17
2 files changed, 18 insertions, 0 deletions
diff --git a/images/NEWS b/images/NEWS
index f00ca4acb..126fc05d9 100644
--- a/images/NEWS
+++ b/images/NEWS
@@ -1,5 +1,6 @@
- include firmwares for most common network cards (#49195)
- pass --restore instead of restore option
+- add a userspace helper to load firmwares
Version 1.37 - 3 April 2009, by Pascal Terjan
diff --git a/images/make_boot_img b/images/make_boot_img
index 4c788368d..246eb9de1 100755
--- a/images/make_boot_img
+++ b/images/make_boot_img
@@ -163,6 +163,23 @@ sub initrd {
_ "cp -a $_ $tmp_initrd$_";
};
+ output("$tmp_initrd/sbin/hotplug", q{
+#!/bin/sh -e
+if [ \$SUBSYSTEM = firmware ] && [ \$ACTION = add ] && [ -n "\$FIRMWARE" ] ; then
+ if [ ! -e /sys\$DEVPATH/loading ]; then
+ exit 1
+ fi
+ if [ -e "/lib/firmware/$FIRMWARE" ]; then
+ echo 1 > /sys$DEVPATH/loading
+ cat "/lib/firmware/$FIRMWARE" > /sys$DEVPATH/data
+ echo 0 > /sys$DEVPATH/loading
+ exit 0
+ fi
+ echo -1 > /sys$DEVPATH/loading
+ exit 1
+fi
+});
+ _ "chmod 755 $tmp_initrd/sbin/hotplug";
_ "install $stage1_root/init $tmp_initrd/";
foreach ('stage1', 'pppd', 'pppoe') {
_ "install $stage1_root/$_ $tmp_initrd/sbin/";