summaryrefslogtreecommitdiffstats
path: root/perl-install/modules.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/modules.pm')
-rw-r--r--perl-install/modules.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/perl-install/modules.pm b/perl-install/modules.pm
index 3ed7e24fc..d2b1c7684 100644
--- a/perl-install/modules.pm
+++ b/perl-install/modules.pm
@@ -3,7 +3,7 @@ package modules;
use strict;
use vars qw(%drivers);
-use common qw(:common :file :system);
+use common qw(:common :file :system :functional);
use detect_devices;
use run_program;
use log;
@@ -394,13 +394,17 @@ sub remove_alias($) {
sub when_load {
my ($name, $type, @options) = @_;
- add_alias('scsi_hostadapter', $name), eval { load('sd_mod') } if $type =~ /scsi/ || $type eq $type_aliases{scsi};
+ if ($type =~ /scsi/ || $type eq $type_aliases{scsi}) {
+ add_alias('scsi_hostadapter', $name), eval { load('sd_mod') };
+ }
$conf{$name}{options} = join " ", @options if @options;
}
sub load {
my ($name, $type, @options) = @_;
+ my @netdev = detect_devices::getNet() if $type eq 'net';
+
if ($::testing) {
log::l("i try to install $name module (@options)");
} elsif ($::live) {
@@ -413,6 +417,10 @@ sub load {
}
sleep 2 if $name =~ /usb-storage|mousedev/;
+ if ($type eq 'net') {
+ add_alias($_, $name) foreach difference2([ detect_devices::getNet() ], \@netdev);
+ }
+
when_load($name, $type, @options);
}
sub load_multi {
@@ -524,9 +532,6 @@ sub write_conf {
my $written = read_conf($file);
- my %net = detect_devices::net2module();
- while (my ($k, $v) = each %net) { add_alias($k, $v) }
-
local *F;
open F, ">> $file" or die("cannot write module config file $file: $!\n");
while (my ($mod, $h) = each %conf) {