Skip to content

Commit a67f22c

Browse files
committed
boot: add three new boot loader feature flags
Report whether the devicetree + sort-key boot loader spec type #1 fields are supported, and whether the "@saved" pseudo-entry is supported. Strictly speaking, thes features have been added in versions that are already released (250+), so by adding this those version even though they support the features will be considered not supporting them, but that should be OK (the opposite would be a problem though, i.e. if we'd assume a boot loader had a feature it actually does not). These three features are features relevant to userspace, as it allows userspace to tweak/genereate BLS entries or set EFI vars correctly. Other features (i.e. that have no impliciations to userspace) are not reported.
1 parent 6977ea9 commit a67f22c

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/boot/bootctl.c

+3
Original file line numberDiff line numberDiff line change
@@ -1723,6 +1723,9 @@ static int verb_status(int argc, char *argv[], void *userdata) {
17231723
{ EFI_LOADER_FEATURE_XBOOTLDR, "Support for XBOOTLDR partition" },
17241724
{ EFI_LOADER_FEATURE_RANDOM_SEED, "Support for passing random seed to OS" },
17251725
{ EFI_LOADER_FEATURE_LOAD_DRIVER, "Load drop-in drivers" },
1726+
{ EFI_LOADER_FEATURE_SORT_KEY, "Support Type #1 sort-key field" },
1727+
{ EFI_LOADER_FEATURE_SAVED_ENTRY, "Support @saved pseudo-entry" },
1728+
{ EFI_LOADER_FEATURE_DEVICETREE, "Support Type #1 devicetree field" },
17261729
};
17271730
static const struct {
17281731
uint64_t flag;

src/boot/efi/boot.c

+3
Original file line numberDiff line numberDiff line change
@@ -2443,6 +2443,9 @@ static void export_variables(
24432443
EFI_LOADER_FEATURE_XBOOTLDR |
24442444
EFI_LOADER_FEATURE_RANDOM_SEED |
24452445
EFI_LOADER_FEATURE_LOAD_DRIVER |
2446+
EFI_LOADER_FEATURE_SORT_KEY |
2447+
EFI_LOADER_FEATURE_SAVED_ENTRY |
2448+
EFI_LOADER_FEATURE_DEVICETREE |
24462449
0;
24472450

24482451
_cleanup_free_ char16_t *infostr = NULL, *typestr = NULL;

src/fundamental/efivars-fundamental.h

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
#define EFI_LOADER_FEATURE_XBOOTLDR (UINT64_C(1) << 5)
1414
#define EFI_LOADER_FEATURE_RANDOM_SEED (UINT64_C(1) << 6)
1515
#define EFI_LOADER_FEATURE_LOAD_DRIVER (UINT64_C(1) << 7)
16+
#define EFI_LOADER_FEATURE_SORT_KEY (UINT64_C(1) << 8)
17+
#define EFI_LOADER_FEATURE_SAVED_ENTRY (UINT64_C(1) << 9)
18+
#define EFI_LOADER_FEATURE_DEVICETREE (UINT64_C(1) << 10)
1619

1720
/* Features of the stub, i.e. systemd-stub */
1821
#define EFI_STUB_FEATURE_REPORT_BOOT_PARTITION (UINT64_C(1) << 0)

0 commit comments

Comments
 (0)