Comment 4 for bug 1050940

Revision history for this message
YannUbuntu (yannubuntu) wrote :

Following Steve comment #6 on Bug #1015211, here are my thoughts:

> It should be obvious that if the firmware booted the CD under UEFI, the firmware is UEFI and we should install grub-efi to the install disk too.

You forget that the fact that many UEFI firmwares can boot on the CD/USB in a different mode than on the HDD. I added some examples in https://help.ubuntu.com/community/UEFI#Setup_the_BIOS_in_EFI_or_Legacy_mode
So if the liveCD/USB is booted in UEFI mode (= /sys/firmware/efi exists when running Ubiquity), it does not always imply that the UEFI firmware is setup to boot the HDD in UEFI mode.
Among the Boot-Repair users, I saw some Windows installed in Legacy mode (UEFI is setup to boot the HDD in Legacy mode), but when the BootInfo report (created when booting the Ubuntu CD) showed that there was a /sys/firmware/efi folder (so the firmware was booting the CD in UEFI mode).
Eg, such situations can result from the fact that some UEFI firmware try to boot the HDD in UEFI mode by default, but if there is no EFI file it then tries to boot in Legacy(mbr) mode.
These are not "buggy firmwares".

> we could rearchitect the grub packages so that we are always installing both grub-efi and grub-pc on all installs

This is a good idea, but IMHO not for all cases, let me explain:
The difficulty we have is that when installing Ubuntu (= when we are in live session), we can't know if the firmware is setup to boot the HDD in UEFI or in Legacy mode.
However, we know that:
1) if there is an ESP with Windows EFI file, and no Legacy Windows boot files (bootmgr+boot/BCD), the firmware is setup to boot the HDD in UEFI mode, so Ubiquity must install grub-efi
2) if there is an ESP without Windows EFI file, and Legacy Windows boot files (bootmgr+boot/BCD), the firmware is setup to boot the HDD in Legacy mode, so Ubiquity has to install grub-pc.
3) if there is an ESP with Windows EFI file, and Legacy Windows boot files (bootmgr+boot/BCD), the firmware is probably setup to boot the HDD in UEFI mode, so Ubiquity must install grub-efi. But here i think Ubiquity should also install grub-pc by security, in case the firmware is setup to boot in Legacy mode.

Hope this helps making Ubiquity better.