From 35896e59866acf39532b41f493697174ddeee265 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Thu, 11 Aug 2022 10:44:13 +0100 Subject: bootloader: don't completely remove failsafe/nonfb entries on upgrade. bootloader::suggest() removes any failsafe and nonfb entries for old kernels on the assumption it will then add them for a newer kernel. This is particularly a problem when using rEFInd, where we only keep the entries for the default (unversioned) kernel, but would also eliminate the failsafe/nonfb entries when using the installer upgrade option to quickly repair the bootloader. --- perl-install/bootloader.pm | 4 +++- perl-install/install/NEWS | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index b3156ddff..44376db2b 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -1369,7 +1369,9 @@ sub suggest { @kernels = grep { !$old_kernels{$_->{version}} } @kernels; #- remove existing failsafe and linux-nonfb, do not care if the previous one was modified by the user? - @{$bootloader->{entries}} = grep { !member($_->{label}, qw(failsafe linux-nonfb)) } @{$bootloader->{entries}}; + #- but only if we are going to add new ones. + @{$bootloader->{entries}} = grep { !member($_->{label}, qw(failsafe linux-nonfb)) } @{$bootloader->{entries}} + if @kernels; foreach my $kernel (@kernels) { my $e = add_kernel($bootloader, $kernel, diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 838b77d3e..a3c2fb22b 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,3 +1,5 @@ +- bootloader: don't remove existing failsafe/nonfb entries on upgrade + if we aren't replacing them with new ones - bootloader: add options to change the rEFInd background (mga#28073) - Update the list of drivers that need a nonfree firmware against kernel-5.18 -- cgit v1.2.1