From fdb9ad1a4465a8c973fe85474a6b55194b4b1299 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Fri, 5 Dec 2025 11:58:34 +0000 Subject: [PATCH] pid1: do not fail if dlopen of libmount fails because it is not compiled in It is now possible to build and run without libmount. But if support is compiled in, then we need to be able to load it. Hence gracefully skip it when support is not compiled in, but fail otherwise. --- src/core/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/main.c b/src/core/main.c index f4acdb02c6c..cab8e009411 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -3311,8 +3311,9 @@ int main(int argc, char *argv[]) { goto finish; } + /* Building without libmount is allowed, but if it is compiled in, then we must be able to load it */ r = dlopen_libmount(); - if (r < 0) { + if (r < 0 && !ERRNO_IS_NEG_NOT_SUPPORTED(r)) { error_message = "Failed to load libmount.so"; goto finish; } -- 2.47.3