bootspec: don't fail with EIO if searching for ESP and finding one without an envelop...
authorLennart Poettering <lennart@poettering.net>
Wed, 30 Sep 2020 09:04:08 +0000 (11:04 +0200)
committerMichael Biebl <biebl@debian.org>
Thu, 15 Oct 2020 21:48:34 +0000 (22:48 +0100)
If this happens this should just mean: we couldn't find the ESP.

Fixes: #17122
(cherry picked from commit 7ea3024b508ac7166851bd8728ac31802586d614)

Gbp-Pq: Name bootspec-don-t-fail-with-EIO-if-searching-for-ESP-and-fin.patch

src/shared/bootspec.c

index 11bba2c7edfadd737d7be627fcc26432f10f4f9b..565979e5cfc60a2d69009ce19496f4acbf101d1b 100644 (file)
@@ -842,19 +842,21 @@ static int verify_esp_blkid(
         else if (r != 0)
                 return log_error_errno(errno ?: SYNTHETIC_ERRNO(EIO), "Failed to probe file system \"%s\": %m", node);
 
-        errno = 0;
         r = blkid_probe_lookup_value(b, "TYPE", &v, NULL);
         if (r != 0)
-                return log_error_errno(errno ?: SYNTHETIC_ERRNO(EIO), "Failed to probe file system type of \"%s\": %m", node);
+                return log_full_errno(searching ? LOG_DEBUG : LOG_ERR,
+                                      SYNTHETIC_ERRNO(searching ? EADDRNOTAVAIL : ENODEV),
+                                      "No filesystem found on \"%s\": %m", node);
         if (!streq(v, "vfat"))
                 return log_full_errno(searching ? LOG_DEBUG : LOG_ERR,
                                       SYNTHETIC_ERRNO(searching ? EADDRNOTAVAIL : ENODEV),
                                       "File system \"%s\" is not FAT.", node);
 
-        errno = 0;
         r = blkid_probe_lookup_value(b, "PART_ENTRY_SCHEME", &v, NULL);
         if (r != 0)
-                return log_error_errno(errno ?: SYNTHETIC_ERRNO(EIO), "Failed to probe partition scheme of \"%s\": %m", node);
+                return log_full_errno(searching ? LOG_DEBUG : LOG_ERR,
+                                      SYNTHETIC_ERRNO(searching ? EADDRNOTAVAIL : ENODEV),
+                                      "File system \"%s\" is not located on a partitioned block device.", node);
         if (!streq(v, "gpt"))
                 return log_full_errno(searching ? LOG_DEBUG : LOG_ERR,
                                       SYNTHETIC_ERRNO(searching ? EADDRNOTAVAIL : ENODEV),