Print location of loader.conf in bootctl status and related updates (#38389)

This commit is contained in:
Yu Watanabe
2025-07-29 22:34:16 +09:00
committed by GitHub
6 changed files with 90 additions and 58 deletions
+11
View File
@@ -83,6 +83,17 @@ static int status_entries(
printf(", %s$BOOT%s", ansi_green(), ansi_normal());
printf(")");
if (config->loader_conf_status != 0) {
assert(esp_path);
printf("\n config: %s%s/%s%s",
ansi_grey(), esp_path, ansi_normal(), "/loader/loader.conf");
if (config->loader_conf_status < 0)
printf(": %s%s%s",
config->loader_conf_status == -ENOENT ? ansi_grey() : ansi_highlight_yellow(),
STRERROR(config->loader_conf_status),
ansi_normal());
}
if (xbootldr_path) {
printf("\n XBOOTLDR: %s (", xbootldr_path);
if (!sd_id128_is_null(xbootldr_partition_uuid))
+1
View File
@@ -533,6 +533,7 @@ static int boot_loader_read_conf_path(BootConfig *config, const char *root, cons
assert(path);
r = chase_and_fopen_unlocked(path, root, CHASE_PREFIX_ROOT|CHASE_PROHIBIT_SYMLINKS, "re", &full, &f);
config->loader_conf_status = r < 0 ? r : true;
if (r == -ENOENT)
return 0;
if (r < 0)
+2
View File
@@ -67,6 +67,8 @@ typedef struct BootEntry {
}
typedef struct BootConfig {
int loader_conf_status; /* 0 → before loading, 1 → loaded, negative → error. */
char *default_pattern;
char *entry_oneshot;