summaryrefslogtreecommitdiffstats
path: root/images/make_boot_img
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mandriva.org>2009-04-03 17:22:30 +0000
committerPascal Terjan <pterjan@mandriva.org>2009-04-03 17:22:30 +0000
commitd2e3f8c0bb9ca5ea9267390c4971e4567c583068 (patch)
treefd6ee474268a8fe84e1dc0eae9659407014bd309 /images/make_boot_img
parent64c46896bffa2cd987cc2231ac0c2c6b2a358479 (diff)
downloaddrakx-d2e3f8c0bb9ca5ea9267390c4971e4567c583068.tar
drakx-d2e3f8c0bb9ca5ea9267390c4971e4567c583068.tar.gz
drakx-d2e3f8c0bb9ca5ea9267390c4971e4567c583068.tar.bz2
drakx-d2e3f8c0bb9ca5ea9267390c4971e4567c583068.tar.xz
drakx-d2e3f8c0bb9ca5ea9267390c4971e4567c583068.zip
add a userspace helper to load firmwares
Diffstat (limited to 'images/make_boot_img')
-rwxr-xr-ximages/make_boot_img17
1 files changed, 17 insertions, 0 deletions
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/";