1

When I run efibootmgr to list all my boot options, this is the output:

$ efibootmgr
BootCurrent: 0003
Timeout: 1 seconds
BootOrder: 0000,0002,0003,0001
Boot0000* (my linux distro grub boot)
Boot0001* file
Boot0002* Windows Boot Manager
Boot0003* (my linux distro systemd-boot)

And when I want to see more detailed output, I get this:

$ efibootmgr -v
BootCurrent: 0003
Timeout: 1 seconds
BootOrder: 0000,0002,0003,0001
Boot0000* (my linux distro grub boot)       HD(1,GPT,3e1eXXXX-f3XX-40XX-b1XX-569aXXXXXXXX,0x800,0x82000)/File(\EFI\DISTRONAME-GRUB\GRUBX64.EFI)
Boot0001* file  VenHw(99e2XXXX-75XX-4bXX-a2XX-c538XXXXXXXX)
Boot0002* Windows Boot Manager  HD(1,GPT,3e1eXXXX-f3XX-40XX-b1XX-569aXXXXXXXX,0x800,0x82000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.X.X.X.X.-.5.c.X.X.-.4.e.X.X.-.a.c.X.X.-.f.3.2.b.X.X.X.X.X.X.X.X.}....................
Boot0003* (my linux distro systemd-boot)    HD(1,GPT,3e1eXXXX-f3XX-40XX-b1XX-569aXXXX,0x800,0x82000)/File(\EFI\DISTRONAME-SYSTEMDBOOT\systemd-bootx64.efi)

Based on my reasoning and quick search in man pages (https://linux.die.net/man/8/efibootmgr), the format of the output is:

BootNNNNA NAME WHATTOBOOT

where:

NNNN = boot number (0000 until maybe 9999)
A = * if active, no asterisk if not active
NAME = string label that will be shown on vendor/motherboard BIOS (UEFI)
WHATTOBOOT = can be
  - HD({NUMBER},{GPT/MBR},{UUID-from-blkid-PARTUUID})/File({\PATH\TO\EFI})
  - PXE ((I have no such boot option in this PC))

Now what I'm curious is about the meaning of efibootmgr -v output for Windows boot manager that shows as:

Boot0002* Windows Boot Manager  HD(1,GPT,3e1eXXXX-f3XX-40XX-b1XX-569aXXXXXXXX,0x800,0x82000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.X.X.X.X.-.5.c.X.X.-.4.e.X.X.-.a.c.X.X.-.f.3.2.b.X.X.X.X.X.X.X.X.}....................
  • Based on it's PARTUUID, it's located on my EFI partition (same with my other boot options)
  • Then it's EFI file is at \EFI\MICROSOFT\BOOT\BOOTMGFW.EFI
  • Then lastly, there's a string (or maybe binary) following:
    WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.X.X.X.X.-.5.c.X.X.-.4.e.X.X.-.a.c.X.X.-.f.3.2.b.X.X.X.X.X.X.X.X.}....................
    

What I'm asking is: what does this string mean? It seems like UUID if I remove all dot (.) characters between (which will make it into xBCOBJECT=9deaXXXX-5cXX-4eXX-acXX-f32bXXXXXXXX

I'm also curious about what is the second boot option mean: Boot0001* file or the verbose version Boot0001* file VenHw(99e2XXXX-75XX-4bXX-a2XX-c538XXXXXXXX)

  • I suspect it's a boot from flash drive / thumb drive that I forgot to delete a few years ago, is this correct? Or is it something else?

Additional information:

Version:

$ efibootmgr --version
version 17

My setup: Windows+linux dual boot, on linux I installed these boot managers: grub and systemd-boot

0
2

TL;DR:

Binary data buffer that is passed to the loaded image.

Longer description of search process

efibootmgr source contains a function which outputs EFI boot variables (file efibootmgr.c):

  static void
  show_vars(const char *prefix)
  {
          list_t *pos;
          var_entry_t *boot;
          const unsigned char *description;
          efi_load_option *load_option;

          list_for_each(pos, &entry_list) {
                  boot = list_entry(pos, var_entry_t, list);
                  load_option = (efi_load_option *)boot->data;
                  description = efi_loadopt_desc(load_option, boot->data_size);
                  if (boot->name)
                          printf("%s", boot->name);
                  else
                          printf("%s%04X", prefix, boot->num);

                  printf("%c ", (efi_loadopt_attrs(load_option)
                          ⁞      & LOAD_OPTION_ACTIVE) ? '*' : ' ');
                  printf("%s", description);

                  show_var_path(load_option, boot->data_size);

                  fflush(stdout);
          }
  }

Of interest is the line

description = efi_loadopt_desc(load_option, boot->data_size);

So, we need to find a function efi_loadopt_desc. It is not contained in efibootmgr itself. A search of include files in /usr/include gives:

$ grep -ri efi_loadopt_desc /usr/include
/usr/include/efivar/efiboot-loadopt.h:extern const unsigned char * efi_loadopt_desc(efi_load_option *opt,

If we look inside the file /usr/include/efivar/efiboot-loadopt.h states:

/*
 * libefiboot - library for the manipulation of EFI boot variables
 * Copyright 2012-2015 Red Hat, Inc.
 * Copyright (C) 2001 Dell Computer Corporation <Matt_Domsch@dell.com>
 *
 ...
 */

Further investigation leads to the efivar repository, which contains the function efi_loadopt_desc inside the file src/loadopt.c. There it simply returns opt->description field of a struct efi_load_option_s:

last_desc = ucs2_to_utf8(opt->description, limit);

That struct is defined as

typedef struct efi_load_option_s {
        uint32_t attributes;
        uint16_t file_path_list_length;
        uint16_t description[];
        // uint8_t file_path_list[];
        // uint8_t optional_data[];
} PACKED efi_load_option;

So, the part which gets output after the load option file path is called "optional data". Further investigation leads to the file src/efivarfs.c and the function efivarfs_get_variable, which shows that it reads the efivarfs (EFI var file system), which usually is located under /sys/firmware/efi/efivarfs, and exposes a number of virtual "files". Files with names beginning with Boot000 contain information about boot options, among other data, this "optional data" describing a particular boot entry. It seems the "optional data" is only loaded if the combined information from boot name, boot entry file path and "optional data" doesn't exceed opt_size.

Further information:

https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface#Services

Variable services
UEFI variables provide a way to store data, in particular non-volatile data. Some UEFI variables are shared between platform firmware and operating systems. Variable namespaces are identified by GUIDs, and variables are key/value pairs. For example, UEFI variables can be used to keep crash messages in NVRAM after a crash for the operating system to retrieve after a reboot.[45]

https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface#UEFI_booting

The boot configuration is defined by variables stored in NVRAM, including variables that indicate the file system paths to OS loaders or OS kernels.

Note: UEFI specification has this to say about "optional data":

https://uefi.org/specifications
https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_final.pdf (page 72)

OptionalData
The remaining bytes in the load option descriptor are a binary data buffer that is passed to the loaded image. If the field is zero bytes long, a NULL pointer is passed to the loaded image. The number of bytes in OptionalData can be computed by subtracting the starting offset of OptionalData from total size in bytes of the EFI_LOAD_OPTION.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.