From f902492a01c974283c9c800ddbd5de651c474c25 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 27 Sep 1999 20:52:11 +0000 Subject: no_comment --- perl-install/commands.pm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'perl-install/commands.pm') 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 [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; } -- cgit v1.2.1