]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootspec: also process uki-url boot loader spec field
authorLennart Poettering <lennart@poettering.net>
Mon, 6 Oct 2025 06:52:21 +0000 (08:52 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 6 Oct 2025 14:12:27 +0000 (16:12 +0200)
Let's also add support for "uki-url", which was added at the same time to
the spec as "uki".

Follow-up for: 4a94a1b83f8857b906bc7924b3f853768b5499b5

src/shared/bootspec.c
src/shared/bootspec.h

index 28baab981612cd3ec63ff78ccc7676bb026173b7..290f12a9798f544e62fc0c952a713ee0266073ed 100644 (file)
@@ -94,6 +94,7 @@ static void boot_entry_free(BootEntry *entry) {
         free(entry->kernel);
         free(entry->efi);
         free(entry->uki);
+        free(entry->uki_url);
         strv_free(entry->initrd);
         free(entry->device_tree);
         strv_free(entry->device_tree_overlay);
@@ -406,6 +407,8 @@ static int boot_entry_load_type1(
                         r = parse_path_one(tmp.path, line, field, &tmp.efi, p);
                 else if (streq(field, "uki"))
                         r = parse_path_one(tmp.path, line, field, &tmp.uki, p);
+                else if (streq(field, "uki-url"))
+                        r = free_and_strdup(&tmp.uki_url, p);
                 else if (streq(field, "profile"))
                         r = safe_atou_full(p, 10, &tmp.profile);
                 else if (streq(field, "initrd"))
@@ -1905,6 +1908,8 @@ int show_boot_entry(
                 boot_entry_file_list("efi", e->root, e->efi, &status);
         if (e->uki)
                 boot_entry_file_list("uki", e->root, e->uki, &status);
+        if (e->uki_url)
+                printf("      uki-url: %s\n", e->uki_url);
         if (e->profile != UINT_MAX)
                 printf("      profile: %u\n", e->profile);
 
@@ -1969,6 +1974,7 @@ int boot_entry_to_json(const BootConfig *c, size_t i, sd_json_variant **ret) {
                         SD_JSON_BUILD_PAIR_CONDITION(!!e->kernel, "linux", SD_JSON_BUILD_STRING(e->kernel)),
                         SD_JSON_BUILD_PAIR_CONDITION(!!e->efi, "efi", SD_JSON_BUILD_STRING(e->efi)),
                         SD_JSON_BUILD_PAIR_CONDITION(!!e->uki, "uki", SD_JSON_BUILD_STRING(e->uki)),
+                        SD_JSON_BUILD_PAIR_CONDITION(!!e->uki_url, "ukiUrl", SD_JSON_BUILD_STRING(e->uki_url)),
                         SD_JSON_BUILD_PAIR_CONDITION(e->profile != UINT_MAX, "profile", SD_JSON_BUILD_UNSIGNED(e->profile)),
                         SD_JSON_BUILD_PAIR_CONDITION(!strv_isempty(e->initrd), "initrd", SD_JSON_BUILD_STRV(e->initrd)));
         if (r < 0)
index 47723689a60cfaa19b70f8cb2088b085ac33b64f..b8521f61f2f42bb55a7862f57e00801782c5670b 100644 (file)
@@ -51,6 +51,7 @@ typedef struct BootEntry {
         char *kernel;        /* linux is #defined to 1, yikes! */
         char *efi;
         char *uki;
+        char *uki_url;
         char **initrd;
         char *device_tree;
         char **device_tree_overlay;