summaryrefslogtreecommitdiffstats
path: root/src/shared/bootspec.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-12-08 15:11:18 +0100
committerGitHub <noreply@github.com>2022-12-08 15:11:18 +0100
commita5799902771dd8601dd933afae6cb6b5307a5d0e (patch)
treeab3d9adedec3dffddb368984eac6010d5330d25d /src/shared/bootspec.c
parentcryptsetup: retry TPM2 unseal operation if it fails with TPM2_RC_PCR_CHANGED (diff)
parentukify: allow multiple initrds (diff)
downloadsystemd-a5799902771dd8601dd933afae6cb6b5307a5d0e.tar.xz
systemd-a5799902771dd8601dd933afae6cb6b5307a5d0e.zip
Merge pull request #25180 from keszybz/ukify
ukify: add helper to create UKIs
Diffstat (limited to 'src/shared/bootspec.c')
-rw-r--r--src/shared/bootspec.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c
index 83960b99d3..4cced23adc 100644
--- a/src/shared/bootspec.c
+++ b/src/shared/bootspec.c
@@ -1404,6 +1404,8 @@ int show_boot_entries(const BootConfig *config, JsonFormatFlags json_format) {
assert(config);
if (!FLAGS_SET(json_format, JSON_FORMAT_OFF)) {
+ _cleanup_(json_variant_unrefp) JsonVariant *array = NULL;
+
for (size_t i = 0; i < config->n_entries; i++) {
_cleanup_free_ char *opts = NULL;
const BootEntry *e = config->entries + i;
@@ -1443,9 +1445,13 @@ int show_boot_entries(const BootConfig *config, JsonFormatFlags json_format) {
if (r < 0)
return log_oom();
- json_variant_dump(v, json_format, stdout, NULL);
+ r = json_variant_append_array(&array, v);
+ if (r < 0)
+ return log_oom();
}
+ json_variant_dump(array, json_format | JSON_FORMAT_EMPTY_ARRAY, NULL, NULL);
+
} else {
for (size_t n = 0; n < config->n_entries; n++) {
r = show_boot_entry(