The usual pattern of using colors to distinguish the mount path (/efi/)
and the rest is used. If the file cannot be read for reasons other than
-ENOENT, the error message is highlighted.
I considered a few places where to add this, but this section seems the
most reaosonable. We already print the 'token' there, which is also part of
the configuration.
Boot Loader Entry Locations:
ESP: /efi (/dev/disk/by-partuuid/
31659406-5a17-46ec-8195-
0dea1667db58)
config: /efi//loader/loader.conf
XBOOTLDR: /boot (/dev/disk/by-partuuid/
4f8a8fe9-4b45-4070-9e9b-
a681be51c902, $BOOT)
token: fedora
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))
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)
}
typedef struct BootConfig {
+ int loader_conf_status; /* 0 → before loading, 1 → loaded, negative → error. */
+
char *default_pattern;
char *entry_oneshot;