]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
booctl: do not say uuids differ if one of the uuids is unset
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 15 Jul 2022 18:46:04 +0000 (20:46 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 18 Jul 2022 08:01:27 +0000 (10:01 +0200)
We allow ESP autodetection to fail, e.g. if it is not mounted, but then we'd
say that the detected one is different than the one reported by the bootloader,
which is rather confusing.

While at it, if we actually detect a mismatch, print the two uuids.

src/boot/bootctl.c

index c09c305b3f3f1c042c0cdec7a88b7f3bb3b3f1cd..4907b3ce3deba1bf378087aa77b84524c36f0a77 100644 (file)
@@ -1784,8 +1784,11 @@ static int verb_status(int argc, char *argv[], void *userdata) {
                 bool have_bootloader_esp_uuid = efi_loader_get_device_part_uuid(&bootloader_esp_uuid) >= 0;
 
                 print_yes_no_line(false, have_bootloader_esp_uuid, "Boot loader sets ESP information");
-                if (have_bootloader_esp_uuid && !sd_id128_equal(esp_uuid, bootloader_esp_uuid))
-                        printf("WARNING: The boot loader reports a different ESP UUID than detected!\n");
+                if (have_bootloader_esp_uuid && !sd_id128_is_null(esp_uuid) &&
+                    !sd_id128_equal(esp_uuid, bootloader_esp_uuid))
+                        printf("WARNING: The boot loader reports a different ESP UUID than detected ("SD_ID128_UUID_FORMAT_STR" vs. "SD_ID128_UUID_FORMAT_STR")!\n",
+                               SD_ID128_FORMAT_VAL(bootloader_esp_uuid),
+                               SD_ID128_FORMAT_VAL(esp_uuid));
 
                 if (stub)
                         printf("         Stub: %s\n", stub);