shared/bootspec: remember the full path to boot entry and use it in logging

It's much easier to understand what is going on when the full path is
logged.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2018-10-08 17:05:17 +02:00
parent 1b20d88987
commit 2d3bfb6904
2 changed files with 8 additions and 1 deletions
+6
View File
@@ -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);
+2 -1
View File
@@ -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;