On a USB flash drive, I have installed "Precise Light" and "BionicPup64" to two separate GPT partitions, '(hd0,msdos3)' and '(hd0,msdos1)', respectively. Each installation has its own "/EFI/boot/bootx64.efi" and "/grub.cfg". However, on the UEFI boot no matter which partition I select the "Precise Light" grub.cfg menu is always displayed.
Conjecture:
bootx64.efi does not know the partition it was loaded from and searches all available partitions for a grub.cfg to use.
Is this conjecture correct? Is there any way to force bootx64.efi to use the grub.cfg from the same partition where the bootx64.efi lives?
N.B., This flash drive will be booted in UEFI mode only. Both installations are bootable. I confirmed this by escaping to the grub command prompt and manually entering the boot sequence. As a workaround I have the added following menu item to the "Precise Light" grub.cfg:
Code: Select all
menuentry "configfile for BionicPup64" {
configfile (hd0,msdos1)'/grub.cfg'
}
This works, but when booting into BionicPup64 I need to visit two grub menus. I want to visit only one.
ADDENDUM
I think the question really boils down to:
After the UEFI firmware has loaded bootx64.efi into RAM and before transferring control to the bootx64.efi code does the UEFI firmware pass any parameters via CPU registers or in RAM anything specifying the partition that bootx64.efi was loaded from.
Empirically, I think not and the bootx64.efi code starts clean and has to search all partitions for grub.cfg.
The objective here is not to have a master boot menu whose contents is dependent on all the installed Puppies. (This has to be updated every time a new Puppy is installed on the disk. Something I want to avoid.) But use the boot menu of each installed Puppy independently. I can inconveniently achieve this manually by exiting to the grub command prompt and entering the appropriate grub configfile command. Is it possible to do better? In other words, I want to copy a Puppy partition from another drive and have it bootable without doing anything additional.