mirror of
https://github.com/systemd/systemd.git
synced 2025-03-31 14:50:15 +03:00
Merge pull request #13009 from keszybz/efi-feature-xbootldr
sd-boot feature xbootldr
This commit is contained in:
commit
bdd0f4b6d1
@ -1368,6 +1368,7 @@ config_h = configure_file(
|
||||
meson_apply_m4 = find_program('tools/meson-apply-m4.sh')
|
||||
|
||||
includes = include_directories('src/basic',
|
||||
'src/boot',
|
||||
'src/shared',
|
||||
'src/systemd',
|
||||
'src/journal',
|
||||
|
@ -1156,11 +1156,12 @@ static int verb_status(int argc, char *argv[], void *userdata) {
|
||||
uint64_t flag;
|
||||
const char *name;
|
||||
} flags[] = {
|
||||
{ EFI_LOADER_FEATURE_BOOT_COUNTING, "Boot counting" },
|
||||
{ EFI_LOADER_FEATURE_CONFIG_TIMEOUT, "Menu timeout control" },
|
||||
{ EFI_LOADER_FEATURE_CONFIG_TIMEOUT_ONE_SHOT, "One-shot menu timeout control" },
|
||||
{ EFI_LOADER_FEATURE_ENTRY_DEFAULT, "Default entry control" },
|
||||
{ EFI_LOADER_FEATURE_ENTRY_ONESHOT, "One-shot entry control" },
|
||||
{ EFI_LOADER_FEATURE_BOOT_COUNTING, "Boot counting" },
|
||||
{ EFI_LOADER_FEATURE_CONFIG_TIMEOUT, "Menu timeout control" },
|
||||
{ EFI_LOADER_FEATURE_CONFIG_TIMEOUT_ONE_SHOT, "One-shot menu timeout control" },
|
||||
{ EFI_LOADER_FEATURE_ENTRY_DEFAULT, "Default entry control" },
|
||||
{ EFI_LOADER_FEATURE_ENTRY_ONESHOT, "One-shot entry control" },
|
||||
{ EFI_LOADER_FEATURE_XBOOTLDR, "Support for XBOOTLDR partition" },
|
||||
};
|
||||
|
||||
_cleanup_free_ char *fw_type = NULL, *fw_info = NULL, *loader = NULL, *loader_path = NULL, *stub = NULL;
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "disk.h"
|
||||
#include "graphics.h"
|
||||
#include "linux.h"
|
||||
#include "loader-features.h"
|
||||
#include "measure.h"
|
||||
#include "pe.h"
|
||||
#include "shim.h"
|
||||
@ -2277,11 +2278,12 @@ static VOID config_write_entries_to_variable(Config *config) {
|
||||
|
||||
EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
|
||||
static const UINT64 loader_features =
|
||||
(1ULL << 0) | /* I honour the LoaderConfigTimeout variable */
|
||||
(1ULL << 1) | /* I honour the LoaderConfigTimeoutOneShot variable */
|
||||
(1ULL << 2) | /* I honour the LoaderEntryDefault variable */
|
||||
(1ULL << 3) | /* I honour the LoaderEntryOneShot variable */
|
||||
(1ULL << 4) | /* I support boot counting */
|
||||
EFI_LOADER_FEATURE_CONFIG_TIMEOUT |
|
||||
EFI_LOADER_FEATURE_CONFIG_TIMEOUT_ONE_SHOT |
|
||||
EFI_LOADER_FEATURE_ENTRY_DEFAULT |
|
||||
EFI_LOADER_FEATURE_ENTRY_ONESHOT |
|
||||
EFI_LOADER_FEATURE_BOOT_COUNTING |
|
||||
EFI_LOADER_FEATURE_XBOOTLDR |
|
||||
0;
|
||||
|
||||
_cleanup_freepool_ CHAR16 *infostr = NULL, *typestr = NULL;
|
||||
|
13
src/boot/efi/loader-features.h
Normal file
13
src/boot/efi/loader-features.h
Normal file
@ -0,0 +1,13 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1+ */
|
||||
#pragma once
|
||||
|
||||
#ifndef UINT64_C
|
||||
# define UINT64_C(c) (c ## ULL)
|
||||
#endif
|
||||
|
||||
#define EFI_LOADER_FEATURE_CONFIG_TIMEOUT (UINT64_C(1) << 0)
|
||||
#define EFI_LOADER_FEATURE_CONFIG_TIMEOUT_ONE_SHOT (UINT64_C(1) << 1)
|
||||
#define EFI_LOADER_FEATURE_ENTRY_DEFAULT (UINT64_C(1) << 2)
|
||||
#define EFI_LOADER_FEATURE_ENTRY_ONESHOT (UINT64_C(1) << 3)
|
||||
#define EFI_LOADER_FEATURE_BOOT_COUNTING (UINT64_C(1) << 4)
|
||||
#define EFI_LOADER_FEATURE_XBOOTLDR (UINT64_C(1) << 5)
|
@ -10,6 +10,7 @@
|
||||
|
||||
#include "sd-id128.h"
|
||||
|
||||
#include "efi/loader-features.h"
|
||||
#include "time-util.h"
|
||||
|
||||
#define EFI_VENDOR_LOADER SD_ID128_MAKE(4a,67,b0,82,0a,4c,41,cf,b6,c7,44,0b,29,bb,8c,4f)
|
||||
@ -18,12 +19,6 @@
|
||||
#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x0000000000000002
|
||||
#define EFI_VARIABLE_RUNTIME_ACCESS 0x0000000000000004
|
||||
|
||||
#define EFI_LOADER_FEATURE_CONFIG_TIMEOUT (UINT64_C(1) << 0)
|
||||
#define EFI_LOADER_FEATURE_CONFIG_TIMEOUT_ONE_SHOT (UINT64_C(1) << 1)
|
||||
#define EFI_LOADER_FEATURE_ENTRY_DEFAULT (UINT64_C(1) << 2)
|
||||
#define EFI_LOADER_FEATURE_ENTRY_ONESHOT (UINT64_C(1) << 3)
|
||||
#define EFI_LOADER_FEATURE_BOOT_COUNTING (UINT64_C(1) << 4)
|
||||
|
||||
#if ENABLE_EFI
|
||||
|
||||
bool is_efi_boot(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user