From: Lennart Poettering Date: Wed, 23 Jan 2019 15:59:28 +0000 (+0100) Subject: bootctl: output where we found $BOOT X-Git-Tag: v242-rc1~218^2~29 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=81fed855d972c0077730304a1717a3925893b718;p=thirdparty%2Fsystemd.git bootctl: output where we found $BOOT --- diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index 482189f9898..5cc187f5ab2 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -351,10 +351,33 @@ static int boot_entry_show(const BootEntry *e, bool show_as_default) { return 0; } -static int status_entries(const char *esp_path, const char *xbootldr_path) { +static int status_entries( + const char *esp_path, + sd_id128_t esp_partition_uuid, + const char *xbootldr_path, + sd_id128_t xbootldr_partition_uuid) { + _cleanup_(boot_config_free) BootConfig config = {}; + sd_id128_t dollar_boot_partition_uuid; + const char *dollar_boot_path; int r; + assert(esp_path || xbootldr_path); + + if (xbootldr_path) { + dollar_boot_path = xbootldr_path; + dollar_boot_partition_uuid = xbootldr_partition_uuid; + } else { + dollar_boot_path = esp_path; + dollar_boot_partition_uuid = esp_partition_uuid; + } + + printf("Boot Loader Entries:\n" + " $BOOT: %s", dollar_boot_path); + if (!sd_id128_is_null(dollar_boot_partition_uuid)) + printf(" (/dev/disk/by-partuuid/%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x)", SD_ID128_FORMAT_VAL(dollar_boot_partition_uuid)); + printf("\n\n"); + r = boot_entries_load_config(esp_path, xbootldr_path, &config); if (r < 0) return r; @@ -1138,7 +1161,7 @@ static int verb_status(int argc, char *argv[], void *userdata) { } if (arg_esp_path || arg_xbootldr_path) { - k = status_entries(arg_esp_path, arg_xbootldr_path); + k = status_entries(arg_esp_path, esp_uuid, arg_xbootldr_path, xbootldr_uuid); if (k < 0) r = k; }