diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 7a6399eaa7..5d8471c51a 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -24,6 +24,7 @@ void boot_entry_free(BootEntry *entry) { assert(entry); free(entry->id); + free(entry->path); free(entry->title); free(entry->show_title); free(entry->version); @@ -57,6 +58,10 @@ int boot_entry_load(const char *path, BootEntry *entry) { if (!tmp.id) return log_oom(); + tmp.path = strdup(path); + if (!tmp.path) + return log_oom(); + f = fopen(path, "re"); if (!f) return log_error_errno(errno, "Failed to open \"%s\": %m", path); @@ -625,6 +630,7 @@ int find_default_boot_entry( } *e = &config->entries[config->default_entry]; + log_debug("Found default boot entry in file \"%s\"", (*e)->path); if (esp_where) *esp_where = TAKE_PTR(where); diff --git a/src/shared/bootspec.h b/src/shared/bootspec.h index e0fcaaea6f..c39d773cb3 100644 --- a/src/shared/bootspec.h +++ b/src/shared/bootspec.h @@ -9,7 +9,8 @@ #include "sd-id128.h" typedef struct BootEntry { - char *id; + char *id; /* This is the file basename without extension */ + char *path; /* This is the full path to the file */ char *title; char *show_title; char *version;