summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-09-07 07:06:42 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-09-07 07:06:42 +0000
commit71707fee88533f6bc9e97028c1b0497a69801d26 (patch)
tree36433c1c01da456c3bfe5097eda90e0149f77ee0
parent296fa74accf9b15a3065b3a052449d1359f531ee (diff)
downloaddrakx-backup-do-not-use-71707fee88533f6bc9e97028c1b0497a69801d26.tar
drakx-backup-do-not-use-71707fee88533f6bc9e97028c1b0497a69801d26.tar.gz
drakx-backup-do-not-use-71707fee88533f6bc9e97028c1b0497a69801d26.tar.bz2
drakx-backup-do-not-use-71707fee88533f6bc9e97028c1b0497a69801d26.tar.xz
drakx-backup-do-not-use-71707fee88533f6bc9e97028c1b0497a69801d26.zip
create get_kernels_and_labels_before_kernel_remove() used by bootloader-config
-rw-r--r--perl-install/bootloader.pm13
1 files changed, 11 insertions, 2 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 7bb1facd1..2e6b3954b 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -562,16 +562,25 @@ sub configure_entry {
}
}
+sub get_kernels_and_labels_before_kernel_remove {
+ my ($to_remove_kernel) = @_;
+ my @kernels = grep { $_ ne $to_remove_kernel } installed_vmlinuz();
+ map { kernel_str2label($_) => $_ } get_kernel_labels(\@kernels);
+}
+
sub get_kernels_and_labels {
my ($b_prefer_24) = @_;
+ get_kernel_labels([ installed_vmlinuz() ], $b_prefer_24);
+}
- my @kernels = installed_vmlinuz();
+sub get_kernel_labels {
+ my ($kernels, $b_prefer_24) = @_;
require pkgs;
my @kernels_str =
sort { c::rpmvercmp($b->{version_no_ext}, $a->{version_no_ext}) }
grep { -d "$::prefix/lib/modules/$_->{version}" }
- map { vmlinuz2kernel_str($_) } @kernels;
+ map { vmlinuz2kernel_str($_) } @$kernels;
if ($b_prefer_24) {
my ($kernel_24, $other) = partition { $_->{ext} eq '' && $_->{version} =~ /^\Q2.4/ } @kernels_str;