From 78e9bb837c258ac0ec7712b3d612cc2f407e731e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 05:50:42 +0200 Subject: Merging upstream version 256. Signed-off-by: Daniel Baumann --- src/shared/bootspec.h | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/shared/bootspec.h') diff --git a/src/shared/bootspec.h b/src/shared/bootspec.h index ddd149e..1885a88 100644 --- a/src/shared/bootspec.h +++ b/src/shared/bootspec.h @@ -20,6 +20,18 @@ typedef enum BootEntryType { _BOOT_ENTRY_TYPE_INVALID = -EINVAL, } BootEntryType; +typedef struct BootEntryAddon { + char *location; + char *cmdline; +} BootEntryAddon; + +typedef struct BootEntryAddons { + BootEntryAddon *items; + size_t n_items; +} BootEntryAddons; + +BootEntryAddon* boot_entry_addon_free(BootEntryAddon *t); + typedef struct BootEntry { BootEntryType type; bool reported_by_loader; @@ -34,6 +46,7 @@ typedef struct BootEntry { char *machine_id; char *architecture; char **options; + BootEntryAddons local_addons; char *kernel; /* linux is #defined to 1, yikes! */ char *efi; char **initrd; @@ -52,12 +65,6 @@ typedef struct BootEntry { typedef struct BootConfig { char *default_pattern; - char *timeout; - char *editor; - char *auto_entries; - char *auto_firmware; - char *console_mode; - char *beep; char *entry_oneshot; char *entry_default; @@ -66,6 +73,8 @@ typedef struct BootConfig { BootEntry *entries; size_t n_entries; + BootEntryAddons global_addons; + ssize_t default_entry; ssize_t selected_entry; @@ -119,6 +128,7 @@ static inline const char* boot_entry_title(const BootEntry *entry) { int show_boot_entry( const BootEntry *e, + const BootEntryAddons *global_addons, bool show_as_default, bool show_as_selected, bool show_reported); @@ -127,3 +137,5 @@ int show_boot_entries( JsonFormatFlags json_format); int boot_filename_extract_tries(const char *fname, char **ret_stripped, unsigned *ret_tries_left, unsigned *ret_tries_done); + +int boot_entry_to_json(const BootConfig *c, size_t i, JsonVariant **ret); -- cgit v1.2.3