Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:vlefebvre:unified
systemd
2004-bootctl-support-for-add-on-stanza-in-type-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2004-bootctl-support-for-add-on-stanza-in-type-1.patch of Package systemd
From 6fef47e104a22cdf103ffbb95dcf5f35c18a5048 Mon Sep 17 00:00:00 2001 From: Raito Bezarius <masterancpp@gmail.com> Date: Mon, 19 Jun 2023 00:39:06 +0200 Subject: [PATCH 4/7] bootctl: support for `add-on` stanza in type 1 - implements cleanup - show boot entry with addons in JSON and text --- src/boot/bootctl-status.c | 5 +++++ src/shared/bootspec.c | 10 ++++++++++ src/shared/bootspec.h | 1 + 3 files changed, 16 insertions(+) Index: systemd-v255.3+suse.15.g96edf7ad18/src/boot/bootctl-status.c =================================================================== --- systemd-v255.3+suse.15.g96edf7ad18.orig/src/boot/bootctl-status.c +++ systemd-v255.3+suse.15.g96edf7ad18/src/boot/bootctl-status.c @@ -634,6 +634,11 @@ static int count_known_files(const BootC if (r < 0) return r; } + STRV_FOREACH(s, e->addons) { + r = ref_file(known_files, *s, +1); + if (r < 0) + return r; + } r = ref_file(known_files, e->device_tree, +1); if (r < 0) return r; Index: systemd-v255.3+suse.15.g96edf7ad18/src/shared/bootspec.c =================================================================== --- systemd-v255.3+suse.15.g96edf7ad18.orig/src/shared/bootspec.c +++ systemd-v255.3+suse.15.g96edf7ad18/src/shared/bootspec.c @@ -60,6 +60,7 @@ static void boot_entry_free(BootEntry *e free(entry->kernel); free(entry->efi); strv_free(entry->initrd); + strv_free(entry->addons); free(entry->device_tree); strv_free(entry->device_tree_overlay); } @@ -376,6 +377,8 @@ static int boot_entry_load_type1( r = parse_path_one(tmp.path, line, field, &tmp.efi, p); else if (streq(field, "initrd")) r = parse_path_strv(tmp.path, line, field, &tmp.initrd, p); + else if (streq(field, "addon")) + r = parse_path_strv(tmp.path, line, field, &tmp.addons, p); else if (streq(field, "devicetree")) r = parse_path_one(tmp.path, line, field, &tmp.device_tree, p); else if (streq(field, "devicetree-overlay")) @@ -1323,6 +1326,12 @@ int show_boot_entry( *s, &status); + STRV_FOREACH(s, e->addons) + boot_entry_file_list(s == e->addons ? "addons" : NULL, + e->root, + *s, + &status); + if (!strv_isempty(e->options)) { _cleanup_free_ char *t = NULL, *t2 = NULL; _cleanup_strv_free_ char **ts = NULL; @@ -1389,6 +1398,7 @@ int show_boot_entries(const BootConfig * JSON_BUILD_PAIR_CONDITION(e->kernel, "linux", JSON_BUILD_STRING(e->kernel)), JSON_BUILD_PAIR_CONDITION(e->efi, "efi", JSON_BUILD_STRING(e->efi)), JSON_BUILD_PAIR_CONDITION(!strv_isempty(e->initrd), "initrd", JSON_BUILD_STRV(e->initrd)), + JSON_BUILD_PAIR_CONDITION(!strv_isempty(e->addons), "addons", JSON_BUILD_STRV(e->addons)), JSON_BUILD_PAIR_CONDITION(e->device_tree, "devicetree", JSON_BUILD_STRING(e->device_tree)), JSON_BUILD_PAIR_CONDITION(!strv_isempty(e->device_tree_overlay), "devicetreeOverlay", JSON_BUILD_STRV(e->device_tree_overlay)))); if (r < 0) Index: systemd-v255.3+suse.15.g96edf7ad18/src/shared/bootspec.h =================================================================== --- systemd-v255.3+suse.15.g96edf7ad18.orig/src/shared/bootspec.h +++ systemd-v255.3+suse.15.g96edf7ad18/src/shared/bootspec.h @@ -37,6 +37,7 @@ typedef struct BootEntry { char *kernel; /* linux is #defined to 1, yikes! */ char *efi; char **initrd; + char **addons; char *device_tree; char **device_tree_overlay; unsigned tries_left;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor