When booting under UEFI the appropriate EFI executable is chosen and executed. In the case of linux installs this tends to be an EFI executable that starts up grub with the appropriate config. To do this properly this EFI executable starts grub relative to its config dir (I think, this is based on reading of blog posts and inspecting my local EFI and grub setups). On Ubuntu this EFI executable starts grub in /boot/grub and then the grub config is there to be found.
On CentOS it appears the expectation is the EFI executable and the grub config live in the same location on the EFI System Partition, /boot/efi/EFI/centos/. This means the current DIB element for bootloader setup isn't working (doesn't result in working paths for grub config when EFI is used to boot).
It is my understanding that this works if they perform that manual copy at the end of this script. However the "grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg" is not sufficient. (Please point out if I've gotten this wrong).
I think what we want in DIB is better understanding of where these EFI executables expect the grub config to be then ensure we put the grub config in that location. Unfortunately, I expect this to vary by distro as each of them is providing their own shims and things for secure boot and I don't think there is a consistent approach to launching grub. It is possible that if we always write it to /boot/grub|boot/grub2|/boot/efi/EFI/$distro we'd cover enough systems that things mostly just work (my opensuse system seems to do like centos and put it in the distro ESP dir too).
I'll try to expand on this a bit more based on some email conversations.
DIB currently assumes that the grub config is at /boot/grub/grub.cfg or /boot/grub2/ grub.cfg /opendev. org/openstack/ diskimage- builder/ src/branch/ master/ diskimage_ builder/ elements/ bootloader/ finalise. d/50-bootloader #L161-L209.
https:/
When booting under UEFI the appropriate EFI executable is chosen and executed. In the case of linux installs this tends to be an EFI executable that starts up grub with the appropriate config. To do this properly this EFI executable starts grub relative to its config dir (I think, this is based on reading of blog posts and inspecting my local EFI and grub setups). On Ubuntu this EFI executable starts grub in /boot/grub and then the grub config is there to be found.
On CentOS it appears the expectation is the EFI executable and the grub config live in the same location on the EFI System Partition, /boot/efi/ EFI/centos/ . This means the current DIB element for bootloader setup isn't working (doesn't result in working paths for grub config when EFI is used to boot).
To work around this some, like Jimmy, have a finalize script that runs after the DIB provided finalize script to try and shim the grub config into the location CentOS expects it: https:/ /github. com/cachengo/ rec-build- tools/blob/ dib_elements/ dib_elements/ myproduct/ finalise. d/99-fix- grub-console# L23-L34.
It is my understanding that this works if they perform that manual copy at the end of this script. However the "grub2-mkconfig -o /boot/efi/ EFI/centos/ grub.cfg" is not sufficient. (Please point out if I've gotten this wrong).
I think what we want in DIB is better understanding of where these EFI executables expect the grub config to be then ensure we put the grub config in that location. Unfortunately, I expect this to vary by distro as each of them is providing their own shims and things for secure boot and I don't think there is a consistent approach to launching grub. It is possible that if we always write it to /boot/grub| boot/grub2| /boot/efi/ EFI/$distro we'd cover enough systems that things mostly just work (my opensuse system seems to do like centos and put it in the distro ESP dir too).