diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-01-20 11:49:48 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-01-20 11:49:48 +0000 |
commit | faa9a76e3bbe293893a7ad95ffb8a43199f9bc6d (patch) | |
tree | 9dbf910ea0e5e4edebed5f84c5392ba85b574da9 /perl-install/modules.pm | |
parent | e50ad50a237e6c636a018494c4419e5708020dd0 (diff) | |
download | drakx-backup-do-not-use-faa9a76e3bbe293893a7ad95ffb8a43199f9bc6d.tar drakx-backup-do-not-use-faa9a76e3bbe293893a7ad95ffb8a43199f9bc6d.tar.gz drakx-backup-do-not-use-faa9a76e3bbe293893a7ad95ffb8a43199f9bc6d.tar.bz2 drakx-backup-do-not-use-faa9a76e3bbe293893a7ad95ffb8a43199f9bc6d.tar.xz drakx-backup-do-not-use-faa9a76e3bbe293893a7ad95ffb8a43199f9bc6d.zip |
kernel 2.6 .ko adaptation
Diffstat (limited to 'perl-install/modules.pm')
-rw-r--r-- | perl-install/modules.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/perl-install/modules.pm b/perl-install/modules.pm index c4e6186ae..8252057ce 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -360,6 +360,13 @@ sub read_already_loaded() { when_load($_) foreach reverse loaded_modules(); } +my $module_extension = c::kernel_version() =~ /^\Q2.4/ ? 'o' : 'ko'; + +sub name2file { + my ($name) = @_; + "$name.$module_extension"; +} + sub when_load { my ($name, @options) = @_; @@ -402,7 +409,8 @@ sub extract_modules { eval { require packdrake; my $packer = new packdrake($cz, quiet => 1); - $packer->extract_archive($dir, map { "$_.o" } @modules); + $packer->extract_archive($dir, map { name2file($_) } @modules); + map { $dir . '/' . name2file($_) } @modules; }; } @@ -411,7 +419,7 @@ sub load_raw { extract_modules('/tmp', map { $_->[0] } @l); my @failed = grep { - my $m = "/tmp/$_->[0].o"; + my $m = '/tmp/' . name2file($_->[0]); if (-e $m && run_program::run(["/usr/bin/insmod_", "insmod"], '2>', '/dev/tty5', $m, @{$_->[1]})) { unlink $m; ''; |