Let's make this detectable explicitly.
#define VARLINK_ADDR_PATH_MANAGED_OOM_SYSTEM "/run/systemd/io.system.ManagedOOM"
/* Path where systemd-oomd listens for varlink connections from user managers to report changes in ManagedOOM settings. */
#define VARLINK_ADDR_PATH_MANAGED_OOM_USER "/run/systemd/oom/io.system.ManagedOOM"
+
+#define KERNEL_BASELINE_VERSION "3.15"
#include <linux/oom.h>
#include <sys/mount.h>
#include <sys/prctl.h>
+#include <sys/utsname.h>
#include <unistd.h>
#if HAVE_SECCOMP
#include <seccomp.h>
assert(ret_first_boot);
if (arg_system) {
+ struct utsname uts;
int v;
log_info("systemd " GIT_VERSION " running in %ssystem mode (%s)",
log_debug("Detected initialized system, this is not the first boot.");
}
}
+
+ assert(uname(&uts) >= 0);
+
+ if (strverscmp_improved(uts.release, KERNEL_BASELINE_VERSION) < 0)
+ log_warning("Warning! Reported kernel version %s is older than systemd's required baseline kernel version %s. "
+ "Your mileage may vary.", uts.release, KERNEL_BASELINE_VERSION);
+ else
+ log_debug("Kernel version %s, our baseline is %s", uts.release, KERNEL_BASELINE_VERSION);
} else {
if (DEBUG_LOGGING) {
_cleanup_free_ char *t = NULL;
#include <sys/ioctl.h>
#include <sys/reboot.h>
#include <sys/timerfd.h>
+#include <sys/utsname.h>
#include <sys/wait.h>
#include <unistd.h>
char *manager_taint_string(Manager *m) {
_cleanup_free_ char *destination = NULL, *overflowuid = NULL, *overflowgid = NULL;
+ struct utsname uts;
char *buf, *e;
int r;
"local-hwclock:"
"var-run-bad:"
"overflowuid-not-65534:"
- "overflowgid-not-65534:"));
+ "overflowgid-not-65534:"
+ "old-kernel:"));
if (!buf)
return NULL;
if (r >= 0 && !streq(overflowgid, "65534"))
e = stpcpy(e, "overflowgid-not-65534:");
+ assert_se(uname(&uts) >= 0);
+ if (strverscmp_improved(uts.release, KERNEL_BASELINE_VERSION) < 0)
+ e = stpcpy(e, "old-kernel:");
+
/* remove the last ':' */
if (e != buf)
e[-1] = 0;