diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/basic/def.h | 2 | ||||
-rw-r--r-- | src/core/main.c | 10 | ||||
-rw-r--r-- | src/core/manager.c | 9 |
3 files changed, 20 insertions, 1 deletions
diff --git a/src/basic/def.h b/src/basic/def.h index ffd462c456..54a82c7c49 100644 --- a/src/basic/def.h +++ b/src/basic/def.h @@ -73,3 +73,5 @@ #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" diff --git a/src/core/main.c b/src/core/main.c index f39c7b0e37..6567cdfb28 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -6,6 +6,7 @@ #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> @@ -2009,6 +2010,7 @@ static void log_execution_mode(bool *ret_first_boot) { assert(ret_first_boot); if (arg_system) { + struct utsname uts; int v; log_info("systemd " GIT_VERSION " running in %ssystem mode (%s)", @@ -2046,6 +2048,14 @@ static void log_execution_mode(bool *ret_first_boot) { 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; diff --git a/src/core/manager.c b/src/core/manager.c index 4493103298..768977dc3a 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -8,6 +8,7 @@ #include <sys/ioctl.h> #include <sys/reboot.h> #include <sys/timerfd.h> +#include <sys/utsname.h> #include <sys/wait.h> #include <unistd.h> @@ -4351,6 +4352,7 @@ int manager_dispatch_user_lookup_fd(sd_event_source *source, int fd, uint32_t re char *manager_taint_string(Manager *m) { _cleanup_free_ char *destination = NULL, *overflowuid = NULL, *overflowgid = NULL; + struct utsname uts; char *buf, *e; int r; @@ -4367,7 +4369,8 @@ char *manager_taint_string(Manager *m) { "local-hwclock:" "var-run-bad:" "overflowuid-not-65534:" - "overflowgid-not-65534:")); + "overflowgid-not-65534:" + "old-kernel:")); if (!buf) return NULL; @@ -4398,6 +4401,10 @@ char *manager_taint_string(Manager *m) { 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; |