On my system, I have two copies of CentOS 7 installed, and one copy of Windows 10 Pro. Every system is bootable and works correctly, and is fully up to date (kernels, packages, the works).
When I run grub2-mkconfig in either copy of CentOS (one host called pingu, the other pinga, for reasons), a new grub configuration is created. Part of it is generated through the os-prober template.
The entries generated by grub2-mkconfig for the copy of CentOS I booted into and started grub2-mkconfig from are correct. That is, they have menu entries with lines like these:
linuxefi /vmlinuz-5.4.147-1.el7.elrepo.x86_64 root=/dev/mapper/pinga-root ro crashkernel=auto spectre_v2=retpoline
initrdefi /initramfs-5.4.147-1.el7.elrepo.x86_64.img
However, entries generated for the other copy of CentOS 7, will look like this:
linux /vmlinuz-5.4.147-1.el7.elrepo.x86_64 root=/dev/mapper/pingu-root ro crashkernel=auto spectre_v2=retpoline
initrd /initramfs-5.4.147-1.el7.elrepo.x86_64.img
(note the linux and initrd instead of linuxefi and initrdefi)
I think this is due to four lines in the /etc/grub.d/30_os-prober like linux ${LKERNEL} ${LPARAMS} (etc.) - but why would this be the case? Why does os-prober assume the other copies of Linux should always be started with linux instead of linuxefi?
Am I missing some setting or override that would fix this?
For now, I have simply changed these lines in 30_os-prober to have linuxefi and initrdefi, but that feels like more than a bit of a hack.