summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-07-08 02:10:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-07-08 02:10:16 +0000
commitd7caf9ba8bac3b97005a2d3c64d37dc575a654f8 (patch)
tree0ad6060c6cee2208754641b018264b2834521ff4
parent0fda8abd4f3bf91257265c8f6cd56650dfccebda (diff)
downloaddrakx-backup-do-not-use-d7caf9ba8bac3b97005a2d3c64d37dc575a654f8.tar
drakx-backup-do-not-use-d7caf9ba8bac3b97005a2d3c64d37dc575a654f8.tar.gz
drakx-backup-do-not-use-d7caf9ba8bac3b97005a2d3c64d37dc575a654f8.tar.bz2
drakx-backup-do-not-use-d7caf9ba8bac3b97005a2d3c64d37dc575a654f8.tar.xz
drakx-backup-do-not-use-d7caf9ba8bac3b97005a2d3c64d37dc575a654f8.zip
- create when_load_category()
- replace regexp [uo]hci on module name with testing category "bus/usb" - move the special case imm ppa from when_load() to load()
-rw-r--r--perl-install/modules.pm59
1 files changed, 33 insertions, 26 deletions
diff --git a/perl-install/modules.pm b/perl-install/modules.pm
index 832a93127..1d801ff3f 100644
--- a/perl-install/modules.pm
+++ b/perl-install/modules.pm
@@ -89,6 +89,16 @@ sub load {
if ($network_module) {
set_alias($_, $network_module) foreach difference2([ detect_devices::getNet() ], \@network_devices);
}
+
+ @l = grep {
+ if (c::kernel_version() =~ /^\Q2.6/ && member($_, 'imm', 'ppa')
+ && ! -d "/proc/sys/dev/parport/parport0/devices/$_") {
+ log::l("$_ loaded but is not useful, removing");
+ unload($_);
+ 0;
+ } else { 1 }
+ } @l;
+
when_load($_, @{$options{$_}}) foreach @l;
}
@@ -379,41 +389,38 @@ sub when_load {
$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');
- #- ensure keyboard is working, the kernel must do the job the BIOS was doing
- sleep 4;
- load("usbkbd", "keybdev") if detect_devices::usbKeyboards();
- }
- }
-
$conf{$name}{options} = join " ", @options if @options;
if (my $category = module2category($name)) {
- if (c::kernel_version() =~ /^\Q2.6/ && member($name, 'imm', 'ppa')
- && ! -d "/proc/sys/dev/parport/parport0/devices/$name") {
- unload($name);
- undef $category;
- }
- if ($category =~ m,disk/(scsi|hardware_raid|usb|firewire),) {
- add_probeall('scsi_hostadapter', $name);
- eval { load('sd_mod') };
- } elsif ($category eq 'bus/usb') {
- add_probeall('usb-interface', $name);
- } elsif ($category eq 'bus/firewire') {
- set_alias('ieee1394-controller', $name);
- } elsif ($category =~ /sound/) {
- my $sound_alias = find { /^sound-slot-[0-9]+$/ && $conf{$_}{alias} eq $name } keys %conf;
- $sound_alias ||= 'sound-slot-0';
- set_sound_slot($sound_alias, $name);
- }
+ when_load_category($name, $category);
}
if (my $above = $conf{$name}{above}) {
load($above); #- eg: for snd-pcm-oss set by set_sound_slot()
}
+}
+sub when_load_category {
+ my ($name, $category) = @_;
+
+ if ($category =~ m,disk/(scsi|hardware_raid|usb|firewire),) {
+ add_probeall('scsi_hostadapter', $name);
+ eval { load('sd_mod') };
+ } elsif ($category eq 'bus/usb') {
+ add_probeall('usb-interface', $name);
+ -f '/proc/bus/usb/devices' or eval {
+ require fs; fs::mount('/proc/bus/usb', '/proc/bus/usb', 'usbdevfs');
+ #- ensure keyboard is working, the kernel must do the job the BIOS was doing
+ sleep 4;
+ load("usbkbd", "keybdev") if detect_devices::usbKeyboards();
+ }
+ } elsif ($category eq 'bus/firewire') {
+ set_alias('ieee1394-controller', $name);
+ } elsif ($category =~ /sound/) {
+ my $sound_alias = find { /^sound-slot-[0-9]+$/ && $conf{$_}{alias} eq $name } keys %conf;
+ $sound_alias ||= 'sound-slot-0';
+ set_sound_slot($sound_alias, $name);
+ }
}
sub cz_file() {