diff options
author | Arnaud Patard <rtp@mageia.org> | 2011-03-18 21:21:26 +0000 |
---|---|---|
committer | Arnaud Patard <rtp@mageia.org> | 2011-03-18 21:21:26 +0000 |
commit | 2923175afa8b253cffdea00c1087c29e877d7fea (patch) | |
tree | a3507f3b193fde9731ecbc49b984faf0da4651e6 /perl-install | |
parent | 0dae133a236a21d79d7292593fe7fc6658b227c6 (diff) | |
download | drakx-2923175afa8b253cffdea00c1087c29e877d7fea.tar drakx-2923175afa8b253cffdea00c1087c29e877d7fea.tar.gz drakx-2923175afa8b253cffdea00c1087c29e877d7fea.tar.bz2 drakx-2923175afa8b253cffdea00c1087c29e877d7fea.tar.xz drakx-2923175afa8b253cffdea00c1087c29e877d7fea.zip |
- try to handle the built-in module case before trying to load a module.
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/modules.pm | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/perl-install/modules.pm b/perl-install/modules.pm index f81b1af4b..5b5f7de5f 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -61,7 +61,30 @@ sub module_is_available { #-############################################################################### # handles dependencies sub load_raw { - my ($l, $h_options) = @_; + my ($lm, $h_options) = @_; + + # try to detect built-in modules by looking at /sys/module + # unfortunately it does not work for all modules eg : + # - networks protocols like af_packet + # - file systems + foreach my $mod (@$lm) { + $mod =~ s/-/_/g; + if (-d "/sys/module/$mod") { + log::l("$mod already loaded"); + } elsif ($mod =~ /af_packet/) { + if (-f "/proc/net/packet") { + log::l("$mod already loaded"); + } else { + @$l = (@$l, $mod); + } + } elsif (cat_("/proc/filesystems") =~ /$mod/) { + log::l("$mod already loaded"); + } elsif ($mod =~ /serial/) { + # hack ... must find who tries to load the module serial + } else { + @$l = (@$l, $mod); + } + } if ($::testing || $::local_install) { log::l("i would load module $_ ($h_options->{$_})") foreach @$l; } elsif ($::isInstall) { |