summaryrefslogtreecommitdiffstats
path: root/images/make_boot_img
diff options
context:
space:
mode:
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/";