From: Zbigniew Jędrzejewski-Szmek Date: Tue, 20 May 2025 13:03:35 +0000 (+0200) Subject: bootctl: rework Boot Loader Entries section in status X-Git-Tag: v258-rc1~562^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e18745064831ed79fedb003bb6ca63b90b059760;p=thirdparty%2Fsystemd.git bootctl: rework Boot Loader Entries section in status Kernels are loaded from two partitions (XBOOTLDR and ESP). In the past this wasn't always so, but a while ago the docs and the code were updated to load from both locations. The $BOOT location specifies where to install only. So rework the status output to print both locations and indicate which one is $BOOT by appending ", $BOOT". Also change the section title to "… Locations". We don't show *entries* here, so the old title could be a bit confusing. Example: Boot Loader Entry Locations: ESP: /efi (/dev/disk/by-partuuid/31659406-5a17-46ec-8195-0dea1667db58) XBOOTLDR: /boot (/dev/disk/by-partuuid/4f8a8fe9-4b45-4070-9e9b-a681be51c902, $BOOT) token: fedora --- diff --git a/src/bootctl/bootctl-status.c b/src/bootctl/bootctl-status.c index 1804558bf7d..0fc86acc841 100644 --- a/src/bootctl/bootctl-status.c +++ b/src/bootctl/bootctl-status.c @@ -63,26 +63,31 @@ static int status_entries( const char *xbootldr_path, sd_id128_t xbootldr_partition_uuid) { - sd_id128_t dollar_boot_partition_uuid; - const char *dollar_boot_path; int r; assert(config); assert(esp_path || xbootldr_path); + printf("%sBoot Loader Entry Locations:%s\n", ansi_underline(), ansi_normal()); + + printf(" ESP: %s (", esp_path); + if (!sd_id128_is_null(esp_partition_uuid)) + printf("/dev/disk/by-partuuid/" SD_ID128_UUID_FORMAT_STR "", + SD_ID128_FORMAT_VAL(esp_partition_uuid)); + if (!xbootldr_path) + /* ESP is $BOOT if XBOOTLDR not present. */ + printf(", %s$BOOT%s", ansi_green(), ansi_normal()); + printf(")"); + 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("\n XBOOTLDR: %s (", xbootldr_path); + if (!sd_id128_is_null(xbootldr_partition_uuid)) + printf("/dev/disk/by-partuuid/" SD_ID128_UUID_FORMAT_STR ", ", + SD_ID128_FORMAT_VAL(xbootldr_partition_uuid)); + /* XBOOTLDR is always $BOOT if present. */ + printf("%s$BOOT%s)", ansi_green(), ansi_normal()); } - printf("%sBoot Loader Entries:%s\n" - " $BOOT: %s", ansi_underline(), ansi_normal(), dollar_boot_path); - if (!sd_id128_is_null(dollar_boot_partition_uuid)) - printf(" (/dev/disk/by-partuuid/" SD_ID128_UUID_FORMAT_STR ")", - SD_ID128_FORMAT_VAL(dollar_boot_partition_uuid)); if (settle_entry_token() >= 0) printf("\n token: %s", arg_entry_token); printf("\n\n");