diff -urN e-smith-grub-2.6.1.old/root/etc/e-smith/events/actions/update-grub e-smith-grub-2.6.1/root/etc/e-smith/events/actions/update-grub --- e-smith-grub-2.6.1.old/root/etc/e-smith/events/actions/update-grub 2021-02-17 22:22:46.513745448 +0000 +++ e-smith-grub-2.6.1/root/etc/e-smith/events/actions/update-grub 2021-02-17 22:27:03.302588400 +0000 @@ -1,5 +1,13 @@ #!/usr/bin/perl use strict; use warnings; - system("/usr/sbin/grub2-mkconfig","-o","/boot/grub2/grub.cfg") == 0 - or die("Unable to update grub2\n"); +my $grubpath; + +if (-e "/sys/firmware/efi") { + $grubpath = "/boot/efi/EFI/centos/grub.cfg"; +} else { + $grubpath = "/boot/grub2/grub.cfg"; +} + +system("/usr/sbin/grub2-mkconfig", "-o", $grubpath) == 0 + or die("Unable to update grub2\n");