]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bpf-dlopen: degrade log_level to LOG_DEBUG in initrd
authorChristian Hesse <mail@eworm.de>
Fri, 1 Aug 2025 14:56:25 +0000 (16:56 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 1 Aug 2025 17:02:33 +0000 (02:02 +0900)
That's what it used to behave before
4d2b9abbe11131d25aea4966a9c25a06703c6183.

src/shared/bpf-dlopen.c

index 5f5402609bff01c7ac1bddcbcf3fea8aa8b033b2..e84b435f4882ae6975acc002534993f0d61d10c2 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "bpf-dlopen.h"
 #include "dlfcn-util.h"
+#include "initrd-util.h"
 #include "log.h"
 
 #if HAVE_LIBBPF
@@ -92,7 +93,7 @@ int dlopen_bpf_full(int log_level) {
                  * list for both files, and when we assume 1.0+ is present we can remove this dlopen */
                 dl = dlopen("libbpf.so.0", RTLD_NOW|RTLD_NODELETE);
                 if (!dl)
-                        return cached = log_full_errno(log_level, SYNTHETIC_ERRNO(EOPNOTSUPP),
+                        return cached = log_full_errno(in_initrd() ? LOG_DEBUG : log_level, SYNTHETIC_ERRNO(EOPNOTSUPP),
                                                        "Neither libbpf.so.1 nor libbpf.so.0 are installed, cgroup BPF features disabled: %s",
                                                        dlerror());