summaryrefslogtreecommitdiffstats
path: root/perl-install/modules.pm
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2004-02-13 13:58:16 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2004-02-13 13:58:16 +0000
commitddcdb532df623950e0b94e598acb2147c2697284 (patch)
treef3a0c8d3f404f6a9f2a6dcb4842b1214d6d8fd32 /perl-install/modules.pm
parente5f5f8499fd80fa3be65c6f109797741b69bf765 (diff)
downloaddrakx-backup-do-not-use-ddcdb532df623950e0b94e598acb2147c2697284.tar
drakx-backup-do-not-use-ddcdb532df623950e0b94e598acb2147c2697284.tar.gz
drakx-backup-do-not-use-ddcdb532df623950e0b94e598acb2147c2697284.tar.bz2
drakx-backup-do-not-use-ddcdb532df623950e0b94e598acb2147c2697284.tar.xz
drakx-backup-do-not-use-ddcdb532df623950e0b94e598acb2147c2697284.zip
fix deps problem because of 2.4/2.6 mappings, better support 2.4 and 2.6 alltogether by keeping 2.4 names in modules.conf
Diffstat (limited to 'perl-install/modules.pm')
-rw-r--r--perl-install/modules.pm34
1 files changed, 28 insertions, 6 deletions
diff --git a/perl-install/modules.pm b/perl-install/modules.pm
index 2bda575c7..0091ba2da 100644
--- a/perl-install/modules.pm
+++ b/perl-install/modules.pm
@@ -1,7 +1,7 @@
package modules; # $Id$
use strict;
-use vars qw(%conf);
+use vars qw(%conf %mappings_24_26 %mappings_26_24);
use common;
use detect_devices;
@@ -25,6 +25,30 @@ sub category2modules_and_description {
map { $_ => $modules_descriptions{$_} } category2modules($categories);
}
+%mappings_24_26 = ("usb-ohci" => "ohci-hcd",
+ "usb-uhci" => "uhci-hcd",
+ "uhci" => "uhci-hcd",
+ "printer" => "usblp",
+ "bcm4400" => "b44",
+ "3c559" => "3c359",
+ "3c90x" => "3c59x",
+ "dc395x_trm" => "dc395x");
+%mappings_26_24 = reverse %mappings_24_26;
+sub mapping_24_26 {
+ return map { c::kernel_version() =~ /^\Q2.6/ ? $mappings_24_26{$_} || $_ : $_ } @_;
+}
+sub mapping_26_24 {
+ my ($modname) = @_;
+ if (c::kernel_version() =~ /^\Q2.6/) {
+ if ($modname eq 'uhci-hcd') {
+ return 'usb-uhci';
+ } else {
+ return $mappings_26_24{$modname} || $modname;
+ }
+ }
+ $modname;
+}
+
#-###############################################################################
#- module loading
#-###############################################################################
@@ -36,11 +60,7 @@ sub load {
my @l = map {
my ($name, @options) = ref($_) ? @$_ : $_;
$options{$name} = \@options;
- my @l = dependencies_closure($name);
- if (c::kernel_version() =~ /^\Q2.6/) {
- push @l, "$1-hcd" if $name =~ /(uhci|ohci)/; # usb-uhci, uhci, usb-ohci are deprecated in 2.6
- }
- @l;
+ dependencies_closure(mapping_24_26($name));
} @_;
@l = difference2([ uniq(@l) ], [ map { my $s = $_; $s =~ s/_/-/g; $s, $_ } loaded_modules() ]) or return;
@@ -370,6 +390,8 @@ sub name2file {
sub when_load {
my ($name, @options) = @_;
+ $name = mapping_26_24($name); #- need to stay with 2.4 names, modutils will allow booting 2.4 and 2.6
+
if ($name =~ /[uo]hci/) {
-f '/proc/bus/usb/devices' or eval {
require fs; fs::mount('/proc/bus/usb', '/proc/bus/usb', 'usbdevfs');