]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Parse a new profile key in Type 1 boot entries
authorItxaka <itxaka@kairos.io>
Tue, 23 Sep 2025 10:07:21 +0000 (12:07 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 26 Sep 2025 08:00:43 +0000 (10:00 +0200)
This allows Type 1 entries to take advantage of multiprofile efi files
by allowing the configuration of the profile associated with that entry.

It will now parse the profile key in a Type 1 config to select that
profile when booting that efi file instead of relaying in the cmdline

Signed-off-by: Itxaka <itxaka@kairos.io>
src/boot/boot.c

index 06d0e8ead1e54b8f4489222f8ba64387155d9157..ea8d426c08482618389b0b986ef91768a548ce21 100644 (file)
@@ -1299,6 +1299,12 @@ static void boot_entry_add_type1(
                 } else if (streq8(key, "sort-key")) {
                         free(entry->sort_key);
                         entry->sort_key = xstr8_to_16(value);
+                } else if (streq8(key, "profile")) {
+                        uint64_t u;
+                        if (parse_number8(value, &u, NULL) && u <= UINT_MAX)
+                                entry->profile = (unsigned)u;
+                        else
+                                log_warning("Error parsing 'profile' entry option, ignoring: %s", value);
 
                 } else if (streq8(key, "version")) {
                         free(entry->version);