]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: do no show pixel width/height in text mode
authorLennart Poettering <lennart@amutable.com>
Thu, 26 Mar 2026 22:43:32 +0000 (23:43 +0100)
committerLennart Poettering <lennart@amutable.com>
Fri, 27 Mar 2026 09:44:14 +0000 (10:44 +0100)
When running in pure text mode (i.e. serial terminal) the pixel
width/height is zero and makes no sense to report. Suppress it.

src/boot/boot.c

index 1be098c287d1679be34b0b215028cdd3175559f1..4a5102f45c7e4895c2242e5c836174d270791250 100644 (file)
@@ -325,9 +325,13 @@ static void print_status(Config *config, char16_t *loaded_image_path) {
                         secure_boot_mode_to_string(secure));
         printf("                  shim: %ls\n", yes_no(shim_loaded()));
         printf("                   TPM: %ls\n", yes_no(tpm_present()));
-        printf("          console mode: %i/%" PRIi64 " (%zux%zu @%ux%u)\n",
-                        ST->ConOut->Mode->Mode, ST->ConOut->Mode->MaxMode - INT64_C(1),
-                        x_max, y_max, screen_width, screen_height);
+        printf("          console mode: %i/%" PRIi64 " (%zux%zu",
+               ST->ConOut->Mode->Mode, ST->ConOut->Mode->MaxMode - INT64_C(1),
+               x_max, y_max);
+        if (screen_width > 0 && screen_height > 0)
+                printf(" @ %ux%u",
+                       screen_width, screen_height);
+        printf(")\n");
 
         if (!ps_continue())
                 return;