]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
umount: /usr/ should never be unmounted regardless of HAVE_SPLIT_USR or not
authorLennart Poettering <lennart@poettering.net>
Sat, 3 Jun 2023 07:17:45 +0000 (09:17 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sat, 3 Jun 2023 15:48:00 +0000 (16:48 +0100)
Whether we put some binaries in /bin or in /usr/bin should not have any
effect on unmounting during shutdown. Even if people split /usr/ off we
should not try to unmount it, no matter what as it is simply where
binaries are placed.

src/shutdown/umount.c

index 6cbe2befa290d7452153038918e5d80c66bed2bb..1586c2e2141142195f61e2e300773ab188d17bf3 100644 (file)
@@ -168,11 +168,10 @@ int mount_points_list_get(const char *mountinfo, MountPoint **head) {
 }
 
 static bool nonunmountable_path(const char *path) {
-        return path_equal(path, "/")
-#if ! HAVE_SPLIT_USR
-                || path_equal(path, "/usr")
-#endif
-                || path_startswith(path, "/run/initramfs");
+        assert(path);
+
+        return PATH_IN_SET(path, "/", "/usr") ||
+                path_startswith(path, "/run/initramfs");
 }
 
 static void log_umount_blockers(const char *mnt) {