I cloned a Rocky 8.6 installation from a “legacy” system to a new system with UEFI boot. I managed to make almost all the required changes, adding an ESP (EFI System Partition) etc. The only remaining problem is that package grub2-efi-x64 is supposed to install a /boot/efi/EFI/rocky/grub.cfg file that is actually a shim that chains to the standard /boot/grub2/grub.cfg file. However, such a file was not created.
As a test, I copied the /boot/grub2/grub.cfg file to /boot/efi/EFI/rocky and after doing that the system boots properly. Following some Fedora documentation, I then deleted /boot/efi/EFI/rocky/grub.cfg and tried to “dnf reinstall grub2-efi-x64”. There were no error messages, but the desired /boot/efi/EFI/rocky/grub.cfg was not created.
I note that “rpm -ql grub2-efi-x64” indicated that the desired file should be created.
Is this a known bug in Rocky 8,.6 (or even RHEL 8.6)? Is there a workaround that’s better than having to copy grub.cfg every time it changes?