efi_loader: bootmgr: support BootNext and BootCurrent variable behavior
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Wed, 20 Mar 2019 00:07:55 +0000 (09:07 +0900)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 7 Apr 2019 12:17:06 +0000 (14:17 +0200)
commit37279ad3eeed5285c2fee4ed9eb24d110515fe3f
treec700f385b39c4cf64797ff48579953201828c620
parentb0c3c346c6d7ec44363037ad55fdfad4c3b474d1
efi_loader: bootmgr: support BootNext and BootCurrent variable behavior

See UEFI v2.7, section 3.1.2 for details of the specification.

With efidebug command, you can run any EFI boot option as follows:
  => efi boot add 1 SHELL ...
  => efi boot add 2 HELLO ...
  => efi boot order 1 2
  => efi bootmgr
     (starting SHELL ...)

  => efi boot next 2
  => efi bootmgr
     (starting HELLO ...)
  => env print -e
  <snip ...>
  BootCurrent: {boot,run}(blob)
  00000000:  02 00                    ..
  BootOrder: {boot,run}(blob)
  00000000:  01 00 02 00              ....

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_loader/efi_bootmgr.c