From db64300b19fbc356ff352de5bf65ac2968ab743c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 30 Sep 2020 11:04:08 +0200 Subject: [PATCH] bootspec: don't fail with EIO if searching for ESP and finding one without an enveloping partition table 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 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 11bba2c7..565979e5 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -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), -- 2.30.2