Merge pull request #28761 from esposem/cmdline_manager

bootctl: handle UKI cmdline addons
This commit is contained in:
Luca Boccassi
2024-02-14 13:56:31 +00:00
committed by GitHub
3 changed files with 371 additions and 43 deletions

View File

@@ -92,6 +92,7 @@ static int status_entries(
r = show_boot_entry(
boot_config_default_entry(config),
&config->global_addons,
/* show_as_default= */ false,
/* show_as_selected= */ false,
/* show_discovered= */ false);

File diff suppressed because it is too large Load Diff

View File

@@ -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 count;
} 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;
@@ -66,6 +79,8 @@ typedef struct BootConfig {
BootEntry *entries;
size_t n_entries;
BootEntryAddons global_addons;
ssize_t default_entry;
ssize_t selected_entry;
@@ -119,6 +134,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);