diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-02-11 22:42:11 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-02-11 22:42:11 +0000 |
commit | dfa3bb4a63ecd2c5006e606d23b13b52ae0c3cfe (patch) | |
tree | 9c85a6b502e6c05c1702b55f831b463c3108d131 | |
parent | f6ec65fb9897dd6befd9b4cf0c6e8ca22f796d27 (diff) | |
download | drakx-backup-do-not-use-dfa3bb4a63ecd2c5006e606d23b13b52ae0c3cfe.tar drakx-backup-do-not-use-dfa3bb4a63ecd2c5006e606d23b13b52ae0c3cfe.tar.gz drakx-backup-do-not-use-dfa3bb4a63ecd2c5006e606d23b13b52ae0c3cfe.tar.bz2 drakx-backup-do-not-use-dfa3bb4a63ecd2c5006e606d23b13b52ae0c3cfe.tar.xz drakx-backup-do-not-use-dfa3bb4a63ecd2c5006e606d23b13b52ae0c3cfe.zip |
use modname2path instead of hardcoding /modules (to use /lib/modules/`uname -r`)
-rw-r--r-- | perl-install/modules.pm | 24 |
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->{$_})); |