Grubenv : symlink or not symlink?

Hi.

I recently built two RL systems using exactly the same method.

I’ve noticed a difference regarding the grubenv files in /boot:

System 1:

       18      4 -rwx------   1  root     root         1004 Feb 22 12:47 /boot/efi/EFI/rocky/grubenv
   262274      4 -rwx------   1  root     root         1004 Feb 22 12:48 /boot/grub2/grubenv

System 2:

       21      4 -rwx------   1  root     root         1024 Mar  8 17:43 /boot/efi/EFI/rocky/grubenv
   262273      0 lrwxrwxrwx   1  root     root           24 Nov 14 03:33 /boot/grub2/grubenv -> ../efi/EFI/rocky/grubenv

This prompted me to check previous builds and they are all a random mixture.

I can’t see any reason why the builds would be different.

Is anyone able to enlighten me?

Thanks in advance.

My RL install is bios boot but I have a couple of Fedora EFI installs.

What I do notice is that system 2 appears to be an earlier build origin (8.4) and system 1’s build is more recent (8.5) base on the file dates. During the evolution of Fedora from F33 to F34 they modified the location of the primary grub.cfg and grubenv files from …/EFI/fedora to /boot/grub2/. They did this by creating small grub.cfg stub file in …/EFI/fedora/ that points to /boot/grub2/grub.cfg via the root partitions UUID. So look at the …/EFI/Rocky/grub.cfg file for the two different systems and see if they differ.
The reason this was done on Fedora was so that the command to update the grub.cfg would be the same across bios boot and EFI boot systems " grub2-mkconfig -o /boot/grub2/grub.cfg ".

The …/EFI, the “ESP”, is a fat32 volume. Everything there is in “one place”. If stub there tells GRUB to read from /boot/grub2/, then GRUB has to mount that other filesystem too (but then again, it has to anyway as BLS entries, kernel, and initramfs are not on ESP).

That definitely makes sense. Legacy seems to be a die hard.

Thanks for the responses.

I’ve just checked my Fedora 35 systems and, as mentioned, there is a grub.cfg file in /boot/efi/EFI/fedora/ that references a grub.cfg file in /boot/grub2/. There is also only one grubenv file in /boot/grub2/.

The two RL systems were built a few days apart, “System 1” on 21/02 and “System 2” on 24/02. They were also built from the same installation media. This is why I’m really confused as to why they are different.

I’ve just built another VM using the latest RL 8.5 installation media and it is the same as “System 2”.

For the previous builds, that were originally built using RL 8.4 and have separate files like “System 1”, I can see that installing a new kernel updates /boot/grub2/grubenv, but when the system boots it must use /boot/efi/EFI/rocky/grubenv because it continues to boot to the old kernel. If I change the system so it uses a symbolic link like “System 2”, it boots to the latest kernel.

So, my plan it change all the systems so they are like “System 2”, and check that all new builds continue to use the symbolic link.

So there is an install script that is supposed to make the link as in system 2 for all EFI installs. If this is a repeatable occurrence then I think it would be worth a bug report. Kernel updates are far between on RHEL and I bet a lot of users don’t reboot their systems after an update until some scheduled time and then do they actually check to see if they are using the latest kernel?