From 18f9ecd40c67147590cad1f3bc30924b2de0562c Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Mon, 11 Mar 2024 15:27:04 +0800 Subject: [PATCH 1/2] fstab-util: remove unreachable return --- src/shared/fstab-util.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/shared/fstab-util.c b/src/shared/fstab-util.c index 0a3b2ce5d3..eac5bb8d3b 100644 --- a/src/shared/fstab-util.c +++ b/src/shared/fstab-util.c @@ -164,8 +164,6 @@ int fstab_is_mount_point_full(const char *where, const char *path) { if (r > 0 || (r < 0 && !ERRNO_IS_DEVICE_ABSENT(r))) return r; } - - return false; } int fstab_filter_options( From 622f2dcc71629d9cf2b6b698e90f68022de807fa Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Mon, 11 Mar 2024 15:29:41 +0800 Subject: [PATCH 2/2] gpt-auto: ignore fstab_has_node failure After 8a1326581d9b066377f8d9f2d58e1bdfd8b645d0, we always check whether there're mounts under /boot/ or /efi/ first. Let's relax the check for fstab_has_node hence, since on initrd-less systems it might produce wrong results. --- src/gpt-auto-generator/gpt-auto-generator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c index c42736cd69..e2b0033eb8 100644 --- a/src/gpt-auto-generator/gpt-auto-generator.c +++ b/src/gpt-auto-generator/gpt-auto-generator.c @@ -533,8 +533,8 @@ static int add_partition_esp(DissectedPartition *p, bool has_xbootldr) { /* Check if there's an existing fstab entry for ESP. If so, we just skip the gpt-auto logic. */ r = fstab_has_node(p->node); if (r < 0) - return log_error_errno(r, - "Failed to check if fstab entry for device '%s' exists: %m", p->node); + log_warning_errno(r, "Failed to check if fstab entry for device '%s' exists, ignoring: %m", + p->node); if (r > 0) return 0;