summaryrefslogtreecommitdiffstats
path: root/perl-install/bootloader.pm
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2020-05-29 12:08:17 +0100
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2020-05-29 12:08:17 +0100
commite06d741c4b73ea0e802b324de9900ff74741c357 (patch)
treef3320fd8c17973c8ae3c8b315ceb259b98935525 /perl-install/bootloader.pm
parent45cde3abd4700ceed3e9e6e6d749b9d54fe4f0c3 (diff)
downloaddrakx-e06d741c4b73ea0e802b324de9900ff74741c357.tar
drakx-e06d741c4b73ea0e802b324de9900ff74741c357.tar.gz
drakx-e06d741c4b73ea0e802b324de9900ff74741c357.tar.bz2
drakx-e06d741c4b73ea0e802b324de9900ff74741c357.tar.xz
drakx-e06d741c4b73ea0e802b324de9900ff74741c357.zip
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.
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r--perl-install/bootloader.pm2
1 files changed, 1 insertions, 1 deletions
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");