summaryrefslogtreecommitdiffstats
path: root/perl-install/commands.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-01-20 11:48:55 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-01-20 11:48:55 +0000
commite50ad50a237e6c636a018494c4419e5708020dd0 (patch)
treeb693911292ca5136a3681426c2eb492b25dfd098 /perl-install/commands.pm
parent5eaff85c3588d4fd1968bf43a2f7854602786f62 (diff)
downloaddrakx-backup-do-not-use-e50ad50a237e6c636a018494c4419e5708020dd0.tar
drakx-backup-do-not-use-e50ad50a237e6c636a018494c4419e5708020dd0.tar.gz
drakx-backup-do-not-use-e50ad50a237e6c636a018494c4419e5708020dd0.tar.bz2
drakx-backup-do-not-use-e50ad50a237e6c636a018494c4419e5708020dd0.tar.xz
drakx-backup-do-not-use-e50ad50a237e6c636a018494c4419e5708020dd0.zip
cleanup & kernel 2.6 .ko adaptation
Diffstat (limited to 'perl-install/commands.pm')
-rw-r--r--perl-install/commands.pm33
1 files changed, 10 insertions, 23 deletions
diff --git a/perl-install/commands.pm b/perl-install/commands.pm
index 88735b8ea..d5d511b8b 100644
--- a/perl-install/commands.pm
+++ b/perl-install/commands.pm
@@ -335,33 +335,20 @@ sub more {
sub insmod {
my ($h) = getopts(\@_, qw(h));
$h || @_ == 0 and die "usage: insmod <module> [options]\n";
- my $f = local $_ = shift;
+ my $f = shift;
require run_program;
+ require modules;
- #- try to install the module if it exist else extract it from archive.
- #- needed for cardmgr.
- unless (-r $f) {
- $_ = $1 if m!.*/([^/]*)\.o!;
- unless (-r ($f = "/lib/modules/$_.o")) {
- $f = "/tmp/$_.o";
- my $cz = "/lib/modules" . (arch() eq 'sparc64' && "64") . ".cz";
- -e $cz or $cz .= '-'.c::kernel_version();
- if (-e $cz) {
- eval {
- require packdrake;
- my $packer = new packdrake($cz, quiet => 1);
- $packer->extract_archive("/tmp", "$_.o");
- };
- } elsif (-e "/lib/modules.cpio.bz2") {
- run_program::run("cd /tmp ; $ENV{LD_LOADER} bzip2 -cd /lib/modules.cpio.bz2 | $ENV{LD_LOADER} cpio -i $_.o");
- } else {
- die "unable to find an archive for modules";
- }
- }
+ if (! -r $f) {
+ my $name = basename($f);
+ $name =~ s/\.k?o$//;
+ ($f) = modules::extract_modules('/tmp', $name);
+ }
+ if (! -r $f) {
+ die "can't find module $f\n";
}
- -r $f or die "can't find module $_";
- run_program::run(["/usr/bin/insmod_", "insmod"], "-f", $f, @_) or die("insmod $_ failed");
+ run_program::run(["/usr/bin/insmod_", "insmod"], "-f", $f, @_) or die("insmod $f failed");
unlink $f;
}