MaddieM4 / os-prober

Tool for adding other distros to GRUB. A fork of the original Debian util, but designed to be more distro-agnostic.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Are hardcoded folder names necessary?

Mi-La opened this issue · comments

commented

Hi, this is more a question than an issue. Is it necessary to search for Windows bootloader by checking the exact folder name "Microsoft"?

Description of my problem:
I have OPAL encrypted nvme drive with Ubuntu / Windows dual boot and my BIOS always tries to re-scan the EFI partition for available bootloaders after drive unlocking. It probably happens because from BIOS point of view the EFI partition it sees is changed during the unlocking. Unfortunately the BIOS always choose Windows bootloader as default and Windows are booted if I don't use a "magic key" to choose another bootloader (F7 in my case).

The only permanent solution I've found so far is to rename the "EFI/Microsoft" folder, to e.g. "EFI/xMicrosoft". Then the BIOS doesn't detect the Microsoft bootloader and detects only grub (it probably also search only for the exact folder name). However, currently also the grub doesn't detect my "xMicrosoft" because the os-prober tries to find it in the "EFI/Microsoft" folder only. So I copied the menuentry for Windows bootloader created by os-prober before renaming and put it into /etc/grub.d/40_custom and just changed path to chainloader to the prober "EFI/xMicrosoft/..." path. And it work!

It would be great if os-prober could try to detect Windows bootloader in a more generic way, something like searching "bootmgfw.efi". Is it possible or is it somehow standardized that the Windows bootloader must be in "EFI/Microsoft" folder?