From e06d741c4b73ea0e802b324de9900ff74741c357 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Fri, 29 May 2020 12:08:17 +0100 Subject: Don't die in write_grub2 if grub.cfg doesn't exist (mga#26676). This bug was introduced by the change from renaming to copying grub.cfg. renamef doesn't fail if the file doesn't exist. cp_af does. --- perl-install/NEWS | 2 ++ perl-install/bootloader.pm | 2 +- perl-install/install/NEWS | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/perl-install/NEWS b/perl-install/NEWS index 416055980..5f6cb71f8 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,5 @@ +- drakboot: don't die in write_grub2 if grub.cfg doesn't exist (mga#26676) + Version 18.27.1 - 8 May 2020 - bootloader: diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index b77e1432b..fe69db7af 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -2103,7 +2103,7 @@ sub write_grub2 { my $f1 = "$::prefix/boot/grub2/grub.cfg"; # we won't just rename as update-grub2 (more likely os-prober may fail): - cp_af($f1, $f1 . '.old'); + cp_af($f1, $f1 . '.old') if -e $f1; run_program::rooted($::prefix, 'update-grub2', '2>', \$error) or die "update-grub2 failed: $error"; log::l("update-grub2 logs: $error"); diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 93cf8272a..ae2c6798d 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,3 +1,5 @@ +- bootloader: don't die in write_grub2 if grub.cfg doesn't exist (mga#26676) + Version 18.27.1 - 8 May 2020 - bootloader: -- cgit v1.2.1