]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: taint if /usr is unmerged
authorLuca Boccassi <bluca@debian.org>
Tue, 5 Apr 2022 19:37:59 +0000 (20:37 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 6 Apr 2022 20:54:14 +0000 (21:54 +0100)
9afd5e7b975e8051c011ff9c07c95e80bd954469 introduced a build-time
taint, introduce a runtime one as well, in preparation for
removing support for unmerged-usr in a future release

README
src/core/manager.c

diff --git a/README b/README
index 4c9d9ae1bd864ff8bd1b771f42a32f46baea3580..6eaba9b0f1eaa390612daadbba34dfa862cf0ce2 100644 (file)
--- a/README
+++ b/README
@@ -353,6 +353,13 @@ WARNINGS and TAINT FLAGS:
         For more information on this issue consult
         https://www.freedesktop.org/wiki/Software/systemd/separate-usr-is-broken
 
+        systemd will warn if the filesystem is not usr-merged (i.e.: /bin, /sbin
+        and /lib* are not symlinks to their counterparts under /usr). Taint flag
+        'unmerged-usr' will be set when this condition is detected.
+
+        For more information on this issue consult
+        https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge
+
         systemd requires that the /run mount point exists. systemd also
         requires that /var/run is a symlink to /run. Taint flag 'var-run-bad'
         will be set when this condition is detected.
index 4b86fe15c1b8f77f18751ef8d6ebae0c9c1dba61..2f60b141590d11bd5bb1133df8286b93357f1252 100644 (file)
@@ -4377,12 +4377,16 @@ char* manager_taint_string(const Manager *m) {
 
         assert(m);
 
-        const char* stage[11] = {};
+        const char* stage[12] = {};
         size_t n = 0;
 
         if (m->taint_usr)
                 stage[n++] = "split-usr";
 
+        _cleanup_free_ char *usrbin = NULL;
+        if (readlink_malloc("/bin", &usrbin) < 0 || !PATH_IN_SET(usrbin, "usr/bin", "/usr/bin"))
+                stage[n++] = "unmerged-usr";
+
         if (access("/proc/cgroups", F_OK) < 0)
                 stage[n++] = "cgroups-missing";