summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/bootloader-config
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-09-07 07:08:37 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-09-07 07:08:37 +0000
commitdc1c46d9d842e2a9b09ceeef930f0659aa183b58 (patch)
treef1da0d23bb5aa4d7a5e216bb87cf151c78bc5d3e /perl-install/standalone/bootloader-config
parentce0a1b887671ac54480bb133b4fb5ae23c333de7 (diff)
downloaddrakx-backup-do-not-use-dc1c46d9d842e2a9b09ceeef930f0659aa183b58.tar
drakx-backup-do-not-use-dc1c46d9d842e2a9b09ceeef930f0659aa183b58.tar.gz
drakx-backup-do-not-use-dc1c46d9d842e2a9b09ceeef930f0659aa183b58.tar.bz2
drakx-backup-do-not-use-dc1c46d9d842e2a9b09ceeef930f0659aa183b58.tar.xz
drakx-backup-do-not-use-dc1c46d9d842e2a9b09ceeef930f0659aa183b58.zip
take care of symlink based bootloader entries
Diffstat (limited to 'perl-install/standalone/bootloader-config')
-rwxr-xr-xperl-install/standalone/bootloader-config28
1 files changed, 23 insertions, 5 deletions
diff --git a/perl-install/standalone/bootloader-config b/perl-install/standalone/bootloader-config
index 9e21d1ee9..0115e6de6 100755
--- a/perl-install/standalone/bootloader-config
+++ b/perl-install/standalone/bootloader-config
@@ -75,19 +75,37 @@ sub remove_kernel() {
unlink "/lib/modules/$kernel_version/build";
remove_now_broken_boot_symlinks();
+ my %proposed_labels;
+ my @new_entries;
my ($to_remove, $to_keep) = partition {
- $_->{kernel_or_dev} && $_->{kernel_or_dev} eq $image;
+ if ($_->{kernel_or_dev} && $_->{kernel_or_dev} eq $image) {
+ 1;
+ } else {
+ my $vmlinuz = $_->{kernel_or_dev} && bootloader::expand_vmlinuz_symlink($_->{kernel_or_dev});
+ if ($vmlinuz && "/boot/$vmlinuz" eq $image) {
+ if (!%proposed_labels) {
+ %proposed_labels = bootloader::get_kernels_and_labels_before_kernel_remove($vmlinuz);
+ }
+ if (my $proposed = $proposed_labels{$_->{label}}) {
+ my %to_add = %$_;
+ put_in_hash(\%to_add, $proposed);
+ push @new_entries, \%to_add;
+ }
+ 1;
+ } else {
+ 0;
+ }
+ }
} @{$bootloader->{entries}};
$_->{initrd} && unlink $_->{initrd} foreach @$to_remove;
-# foreach (@$to_keep) {
-# $_->{kernel_or_dev} && bootloader::expand_vmlinuz_symlink($_->{kernel_or_dev}) eq $image or next;
-# }
-
@{$bootloader->{entries}} = @$to_keep;
+ foreach (@new_entries) {
+ bootloader::add_kernel($bootloader, $_, {});
+ }
modify_bootloader();
}