summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-02-11 22:42:11 +0000
committerOlivier Blin <oblin@mandriva.com>2008-02-11 22:42:11 +0000
commitdfa3bb4a63ecd2c5006e606d23b13b52ae0c3cfe (patch)
tree9c85a6b502e6c05c1702b55f831b463c3108d131 /perl-install
parentf6ec65fb9897dd6befd9b4cf0c6e8ca22f796d27 (diff)
downloaddrakx-dfa3bb4a63ecd2c5006e606d23b13b52ae0c3cfe.tar
drakx-dfa3bb4a63ecd2c5006e606d23b13b52ae0c3cfe.tar.gz
drakx-dfa3bb4a63ecd2c5006e606d23b13b52ae0c3cfe.tar.bz2
drakx-dfa3bb4a63ecd2c5006e606d23b13b52ae0c3cfe.tar.xz
drakx-dfa3bb4a63ecd2c5006e606d23b13b52ae0c3cfe.zip
use modname2path instead of hardcoding /modules (to use /lib/modules/`uname -r`)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/modules.pm24
1 files changed, 10 insertions, 14 deletions
diff --git a/perl-install/modules.pm b/perl-install/modules.pm
index 53f5b6e13..8e0240cd1 100644
--- a/perl-install/modules.pm
+++ b/perl-install/modules.pm
@@ -240,16 +240,6 @@ sub read_already_loaded {
when_load($conf, $_) foreach reverse loaded_modules();
}
-sub name2file {
- my ($name) = @_;
- my $f = list_modules::modname2filename($name);
- if (!$f) {
- log::l("warning: unable to get module filename for $name");
- $f = $name;
- }
- $f . ".ko";
-}
-
sub when_load {
my ($conf, $name) = @_;
@@ -294,13 +284,19 @@ sub when_load_category {
#-###############################################################################
#- isInstall functions
#-###############################################################################
+sub module_extension() { ".ko" }
+
sub extract_modules {
my ($dir, @modules) = @_;
map {
- my $f = name2file($_);
- if (-e "/modules/$f.gz") {
- system("gzip -dc /modules/$f.gz > $dir/$f") == 0
+ my $modname = $_;
+ my $path = list_modules::modname2path($modname);
+ my $f = $modname . module_extension();
+ if (-e $path) {
+ system("gzip -dc $path > $dir/$f") == 0
or unlink "$dir/$f";
+ } else {
+ log::l("warning: unable to get module filename for $modname (path: $path)");
}
"$dir/$f";
} @modules;
@@ -311,7 +307,7 @@ sub load_raw_install {
extract_modules('/tmp', @$l);
my @failed = grep {
- my $m = '/tmp/' . name2file($_);
+ my $m = '/tmp/' . $_ . module_extension();
if (-e $m) {
my $stdout;
my $rc = run_program::run('insmod', '2>', \$stdout, $m, split(' ', $options->{$_}));