diff options
author | Mystery Man <unknown@mandriva.org> | 2005-08-22 14:57:05 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2005-08-22 14:57:05 +0000 |
commit | c4c6eb3de2799d5544e9cc8703b0261c0a3350d6 (patch) | |
tree | b9f1a4c99ae89c4210c2c2848b16e66430b63700 /rescue/tree/sbin/modprobe | |
parent | a723a6e26fc5be438675cc29b636f0b61547ec32 (diff) | |
download | drakx-backup-do-not-use-c4c6eb3de2799d5544e9cc8703b0261c0a3350d6.tar drakx-backup-do-not-use-c4c6eb3de2799d5544e9cc8703b0261c0a3350d6.tar.gz drakx-backup-do-not-use-c4c6eb3de2799d5544e9cc8703b0261c0a3350d6.tar.bz2 drakx-backup-do-not-use-c4c6eb3de2799d5544e9cc8703b0261c0a3350d6.tar.xz drakx-backup-do-not-use-c4c6eb3de2799d5544e9cc8703b0261c0a3350d6.zip |
This commit was manufactured by cvs2svn to create tagV10_3_0_48mdk
'V10_3_0_48mdk'.
Diffstat (limited to 'rescue/tree/sbin/modprobe')
-rwxr-xr-x | rescue/tree/sbin/modprobe | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/rescue/tree/sbin/modprobe b/rescue/tree/sbin/modprobe deleted file mode 100755 index 774101d7c..000000000 --- a/rescue/tree/sbin/modprobe +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/perl - -sub cat_ { local *F; open F, $_[0] or $_[1] ? die "cat of file $_[0] failed: $!\n" : return; my @l = <F>; wantarray ? @l : join '', @l } - -sub read_already_loaded() { - foreach (cat_("/proc/modules")) { - my ($name) = split; - $conf{$name}{loaded} = 1; - } -} - -sub load_deps($) { - my ($file) = @_; - - local *F; - open F, $file or log::l("error opening $file: $!"), return 0; - foreach (<F>) { - my ($f, $deps) = split ':'; - push @{$deps{$f}}, split ' ', $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/\.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$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$module_extension"); - $retval and die("insmod $name failed"); -} - -!@ARGV || $ARGV[0] =~ /-h/ and die "usage: modprobe <module> [<options...>]\n"; - -read_already_loaded(); -load_deps("/modules/modules.dep"); -load(@ARGV); |