help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get/set UEFI variables or NVMe driver?


From: JZB
Subject: Re: Get/set UEFI variables or NVMe driver?
Date: Wed, 27 Mar 2024 19:37:48 -0500
User-agent: Mozilla Thunderbird

On 3/26/24 20:00, Marek Marczykowski-Górecki wrote:
Hi,

Is there a command for getting/setting UEFI variables? I see
grub_efi_{get,set}_variable functions in the source code, but can't find
if it's connected to any command. Alternatively, is there an NVMe driver
for grub?

I know the alternative looks a bit weird, so let me explain. I use
grub2-efi loaded over PXE to boot different systems depending on some
external settings (a config file loaded over network too). One of the
boot paths is booting Linux that is installed on the local disk. With
SATA it's simple - I can load grub.cfg from the local disk and jump
there. But for NVMe, grub doesn't see the disk when it's loaded from
network (my guess is that firmware doesn't load its NVMe driver when
booting from network). The same grub can access the disk when loaded
from local disk. My current workaround is booting Linux (loaded
from network too) that sets BootNext variable to local system and
reboot. Booting whole Linux kernel just for that feels silly...
So, I'd like to set the BootNext from grub directly.

An NVMe driver would solve the problem for me too, but I guess that's
much more work (for a rather niche use case, I realise). And the BootNext
approach is more reliable anyway, because it ensures the grub version
matching its config, and would work with non-grub bootloader too.


Try this in your PXE grub.cfg:

menuentry 'Local Boot'
{
  exit
}

BIOS will interpret this as a failure and move on to the next device after PXE boot. Arrange that in your boot order, and you should get your local NVMe boot. Granted, its not very flexible, but the better solution would be more work and require that grub tell the BIOS to "reconnect" its partition driver (long story).

--jzb



reply via email to

[Prev in Thread] Current Thread [Next in Thread]