Reapply "pid1: pull in libmount unconditionally"

It was actually intended to load libmount very early, as it is
needed by more than just mount units, such as umount_recursive(),
bind_remount_recursive(), get_sub_mounts(), etc.

Fixes https://github.com/systemd/systemd/issues/39994

This reverts commit 46b4b33c25.
This commit is contained in:
Luca Boccassi
2025-12-05 11:54:27 +00:00
committed by Yu Watanabe
parent 405a58752e
commit 64ba571576
2 changed files with 8 additions and 0 deletions

View File

@@ -59,6 +59,7 @@
#include "killall.h"
#include "kmod-setup.h"
#include "label-util.h"
#include "libmount-util.h"
#include "limits-util.h"
#include "load-fragment.h"
#include "log.h"
@@ -3310,6 +3311,12 @@ int main(int argc, char *argv[]) {
goto finish;
}
r = dlopen_libmount();
if (r < 0) {
error_message = "Failed to load libmount.so";
goto finish;
}
r = initialize_runtime(skip_setup,
first_boot,
&saved_rlimit_nofile,

View File

@@ -201,6 +201,7 @@ executables += [
'dependencies' : [
libapparmor_cflags,
libkmod_cflags,
libmount_cflags,
libseccomp_cflags,
libselinux_cflags,
],