summaryrefslogtreecommitdiffstats
path: root/rescue/tree
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2004-01-23 18:45:20 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2004-01-23 18:45:20 +0000
commit71bcb42927b2970d522f96c635d159f01946b2d7 (patch)
tree636aa3ccbf1116472bdb07eb7ff426090d784f8a /rescue/tree
parent7f28f0bf7dc4ef8b49d797ebcdc4461645542568 (diff)
downloaddrakx-backup-do-not-use-71bcb42927b2970d522f96c635d159f01946b2d7.tar
drakx-backup-do-not-use-71bcb42927b2970d522f96c635d159f01946b2d7.tar.gz
drakx-backup-do-not-use-71bcb42927b2970d522f96c635d159f01946b2d7.tar.bz2
drakx-backup-do-not-use-71bcb42927b2970d522f96c635d159f01946b2d7.tar.xz
drakx-backup-do-not-use-71bcb42927b2970d522f96c635d159f01946b2d7.zip
support 2.4 and 2.6
Diffstat (limited to 'rescue/tree')
-rwxr-xr-xrescue/tree/sbin/modprobe24
1 files changed, 19 insertions, 5 deletions
diff --git a/rescue/tree/sbin/modprobe b/rescue/tree/sbin/modprobe
index 84de032e2..774101d7c 100755
--- a/rescue/tree/sbin/modprobe
+++ b/rescue/tree/sbin/modprobe
@@ -20,18 +20,32 @@ sub load_deps($) {
}
}
+my $module_extension = cat_('/proc/version') =~ /^Linux version 2.4/ ? '.o' : '.ko';
+
+my %mappings = ("usb-ohci" => "ohci-hcd",
+ "usb-uhci" => "uhci-hcd",
+ "uhci" => "uhci-hcd",
+ "printer" => "usblp",
+ "bcm4400" => "b44",
+ "3c559" => "3c359",
+ "3c90x" => "3c59x",
+ "dc395x_trm" => "dc395x",
+ "audigy" => "snd-emu10k1");
+
sub load {
my ($name, @options) = @_;
- $name =~ s/\.o//;
+ $name =~ s/\.k?o$//;
+
+ $name = $mappings{$name} || $name; #- 2.4 -> 2.6 compat mappings
$conf{$name}{loaded} and return;
eval { load($_, 'prereq') } foreach @{$deps{$name}};
- system("packdrake -x /modules/modules.cz* /tmp $name.o");
- -r "/tmp/$name.o" or die "can't find module $name\n";
- system("/sbin/insmod /tmp/$name.o");
+ system("packdrake -x /modules/modules.cz* /tmp $name$module_extension");
+ -r "/tmp/$name$module_extension" or die "can't find module $name\n";
+ system("/sbin/insmod /tmp/$name$module_extension");
my $retval = $?;
- system("rm /tmp/$name.o");
+ system("rm /tmp/$name$module_extension");
$retval and die("insmod $name failed");
}