summaryrefslogtreecommitdiffstats
path: root/images
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2011-01-20 09:53:15 +0000
committerAntoine Ginies <aginies@mandriva.com>2011-01-20 09:53:15 +0000
commitf710ad7efecee968f33bf64a3ec7a567789ddfd5 (patch)
treeda2e3851931f576e7dd0833b537308cc9358b874 /images
parent766a76838cb0588786f014582caa7e1768e4650d (diff)
downloaddrakx-f710ad7efecee968f33bf64a3ec7a567789ddfd5.tar
drakx-f710ad7efecee968f33bf64a3ec7a567789ddfd5.tar.gz
drakx-f710ad7efecee968f33bf64a3ec7a567789ddfd5.tar.bz2
drakx-f710ad7efecee968f33bf64a3ec7a567789ddfd5.tar.xz
drakx-f710ad7efecee968f33bf64a3ec7a567789ddfd5.zip
add firmware support
Diffstat (limited to 'images')
-rwxr-xr-ximages/make_boot_img27
-rwxr-xr-ximages/update_kernel1
2 files changed, 26 insertions, 2 deletions
diff --git a/images/make_boot_img b/images/make_boot_img
index bc341be9c..02fd0b85d 100755
--- a/images/make_boot_img
+++ b/images/make_boot_img
@@ -143,8 +143,9 @@ sub initrd {
my $stage1_root = "../mdk-stage1";
_ "rm -rf $tmp_initrd";
- mkdir_p("$tmp_initrd$_") foreach qw(/etc /lib /modules /sbin /tmp /var);
+ mkdir_p("$tmp_initrd$_") foreach qw(/etc /firmware /lib /modules /sbin /tmp /var);
symlink "../modules", "$tmp_initrd/lib/modules";
+ symlink "../firmware", "$tmp_initrd/lib/firmware";
symlink "/proc/mounts", "$tmp_initrd/etc/mtab";
symlink "../tmp", "$tmp_initrd/var/run";
@@ -156,7 +157,29 @@ sub initrd {
foreach ("/usr/share/ldetect-lst/fallback-modules.alias", "/lib/module-init-tools/ldetect-lst-modules.alias") {
_ "install -D $_ $tmp_initrd$_";
}
-
+ foreach my $firm (glob_("all.kernels$I/$ext/firmware/*")) {
+ my $dest=$firm;
+ $dest =~ s|all.kernels$I/$ext/||;
+ _ "cp -a $firm $tmp_initrd/$dest";
+ };
+
+ output("$tmp_initrd/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/hotplug";
+ symlink "../hotplug", "$tmp_initrd/sbin/hotplug";
_ "install $stage1_root/init $tmp_initrd/";
foreach ('stage1', 'pppd', 'pppoe') {
_ "install $stage1_root/$_ $tmp_initrd/sbin/";
diff --git a/images/update_kernel b/images/update_kernel
index d06ccf126..0b2b82fae 100755
--- a/images/update_kernel
+++ b/images/update_kernel
@@ -75,6 +75,7 @@ sub extract_installed_rpm {
}
sys('perl', '../kernel/modules.pl', 'remove_unneeded_modules', $kern_ver);
+ sys('perl', '../kernel/modules.pl', 'get_firmwares', $kern_ver);
sys('perl', '../kernel/modules.pl', 'make_modules_per_image', $kern_ver);
rm_rf("$local_dir/modules");