From a462280c9a6a668b0515fffc94dd1e4a69c1b601 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 12 Mar 2025 21:59:49 +0100 Subject: [PATCH] bootctl: tweak status output when operating on --image= files Let's not claim the system was not booted with UEFI if we use --image=. The system wasn't booted at all, after all. Hence supress the whole section altogether in this case. --- src/bootctl/bootctl-status.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/bootctl/bootctl-status.c b/src/bootctl/bootctl-status.c index 798c86dba29..bf29a957601 100644 --- a/src/bootctl/bootctl-status.c +++ b/src/bootctl/bootctl-status.c @@ -370,7 +370,13 @@ int verb_status(int argc, char *argv[], void *userdata) { pager_open(arg_pager_flags); - if (!arg_root && is_efi_boot()) { + if (arg_root) + log_debug("Skipping 'System' section, operating offline."); + else if (!is_efi_boot()) + printf("%sSystem:%s\n" + "Not booted with EFI\n\n", + ansi_underline(), ansi_normal()); + else { static const struct { uint64_t flag; const char *name; @@ -567,10 +573,7 @@ int verb_status(int argc, char *argv[], void *userdata) { } printf("\n"); - } else - printf("%sSystem:%s\n" - "Not booted with EFI\n\n", - ansi_underline(), ansi_normal()); + } if (arg_esp_path) RET_GATHER(r, status_binaries(arg_esp_path, esp_uuid)); -- 2.47.3