summaryrefslogtreecommitdiffstats
path: root/perl-install/commands.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-09-27 20:52:11 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-09-27 20:52:11 +0000
commitf902492a01c974283c9c800ddbd5de651c474c25 (patch)
tree4a8eb59f4644fb18ef8e3a448c79061643b60145 /perl-install/commands.pm
parent73e7a0f1107be369f7304335082afac4f96ee3d2 (diff)
downloaddrakx-f902492a01c974283c9c800ddbd5de651c474c25.tar
drakx-f902492a01c974283c9c800ddbd5de651c474c25.tar.gz
drakx-f902492a01c974283c9c800ddbd5de651c474c25.tar.bz2
drakx-f902492a01c974283c9c800ddbd5de651c474c25.tar.xz
drakx-f902492a01c974283c9c800ddbd5de651c474c25.zip
no_comment
Diffstat (limited to 'perl-install/commands.pm')
-rw-r--r--perl-install/commands.pm17
1 files changed, 12 insertions, 5 deletions
diff --git a/perl-install/commands.pm b/perl-install/commands.pm
index e4510a22d..3ff726617 100644
--- a/perl-install/commands.pm
+++ b/perl-install/commands.pm
@@ -395,12 +395,19 @@ sub unpack_ {
sub insmod {
my ($h) = getopts(\@_, qw(h));
$h || @_ == 0 and die "usage: insmod <module> [options]\n";
- my $name = shift;
- my $f = "/tmp/$name.o";
+ my $f = local $_ = shift;
+
require 'run_program.pm';
- run_program::run("cd /tmp ; bzip2 -cd /lib/modules.cpio.bz2 | cpio -i $name.o");
- -r $f or die "can't find module $name";
- run_program::run(["insmod_", "insmod"], $f, @_) or die("insmod $name failed");
+
+ unless (m|/|) {
+ m/(.*)\.o/ and die "either give ./$_ or $1\n";
+ unless (-r ($f = "/lib/modules/$_.o")) {
+ $f = "/tmp/$_.o";
+ run_program::run("cd /tmp ; bzip2 -cd /lib/modules.cpio.bz2 | cpio -i $_.o");
+ }
+ }
+ -r $f or die "can't find module $_";
+ run_program::run(["insmod_", "insmod"], $f, @_) or die("insmod $_ failed");
unlink $f;
}