Customize installation iso, install failed with 'failed to write bootloader configuration' with UEFI

Dear,

I have customized the Rocky Linux 8.4 ISO for both BIOS and UEFI installation,Installation with BIOS is OK. But installation with UEFI failed with ''failed to write bootloader configuration".
Check /tmp/syslog find:
in chroot ‘/mnt/sysroot’…grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
/sbin/grub2-mkconfig line 274
/boot/efi/EFI/redhat/grub.cfg.new No such file or directory.
There is directory /boot/efi/EFI/rocky, but no directory ‘/boot/efi/EFI/redhat/’.

While installing with original Rocky Linux ISO, it will call
grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg and installation succeeded.

I need help to figure out who control the grub conf directory.

BTW, I have changed the ISO label.

Best regards!

Paul

I find the reason it that I use a customzied product.img. it break the UEFI installation.

Thx!

Blockquote

Let me see if I got this right: You want to break the .iso so as to break the UEFI installation?!? Is that about right or not? Have you ever thought about doing a CUSTOM INSTALL which allows you you to decide if you want to use /boot/grub2/ or if you want to do a /boot/efi/. I’ve been doing Custom installs, like forever. The first partition I create is the /boot partition. If I wanted to to use UEFI then the first partition I would create is /boot/efi. This is not rocket science.

Now like everything there are caveats to be aware of. If you do an automatic install it will be to create an LVM partition and a /boot/efi partition – it assumes that the user wants to or may want to create a dual boot system with Windows be one of the two OS’s. In that case you have to have UEFI and Secure Boot enabled in BIOS and the partition table in GPT. On the other hand IF you are running strictly a LEGACY BIOS , your partition table will be MBR.

Thus the ONLY reason for “breaking” the installation so it does not set things to UEFI is IF and only IF you plan to run a purely LEGACY BIOS with an MBR partition system; If on the other hand you plan to run Windows you are going to be forced to have UEFI enabled, Secure Boot enabled, and will have to have /boot/efi enable rather than /boot .

Hope this helps,

D’ Cat

You talk about customization of the storage interactively in the installer. The installer can read all those choices from a kickstart file. It is therefore possible to get your fancy partition scheme and package selection with the automatic install.

However, you can’t choose between UEFI and legacy in the installer. That is done earlier. If you load the installer with legacy, then it installs what legacy needs. If you load installer with EFI, then it installs the EFI-related packages. The install media supports both boot methods. You can, obviously, sabotage the install by “customizing partitions” to nonsense.

What OP does is to have an install media (ISO) that has custom set of packages (and probably config in kickstart). There are three Rocky ISOs:

  • Boot, that loads all packages from network repositories
  • Minimal, that contains small set of packages to install
  • DVD1, that has lot of packages

OP’s custom ISO probably has only necessary packages, but also third-party packages that Rocky does not supply. A self-sufficient install media for automatic installs without network required.

I see no “want to break” in that. Quite the opposite.

Thank D’ Cat.

There is no problem with EFI part . The reason is I have change the product name when customizing anoconda.

Ah!! Sorry, I did not quite understand.

D’ Cat