Search code examples
x86-64bootbootloaderuefi

UEFI one-time load boot option program implementation


How do utilities like EasyUEFI programmatically (what UEFI structs/attributes need to be changed from BootOrderList) implement the "one-time" boot feature? I've been going through the ofiicial UEFI specification and can't seem to find the answer from there.

The feature is that (let's assume I use Windows usually):

  1. I can choose to boot ONCE to let's say my USB stick containing Linux Live image.
  2. When rebooting, my machine boots to the Linux USB.
  3. When I power off the Linux Live USB and boot the PC again, it boots back to Windows.

Solution

  • Classically, and as always, I found the answer after 5 minutes of further searching through the spec:

    Otherwise, the boot manager is also required to initiate a boot of the boot option specified by the BootNext variable as the first boot option on the next boot, and only on the next boot. The boot manager removes the BootNext variable before transferring control to the BootNext boot option. After the BootNext boot option is tried, the normal BootOrder list is used. To prevent loops, the boot manager deletes BootNext before transferring control to the preselected boot option.

    As the spec mentions, the option to be used once should be put to BootNext list