summary refs log tree commit diff
path: root/pkgs/os-specific/linux/systemd/0008-Don-t-try-to-unmount-nix-or-nix-store.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/systemd/0008-Don-t-try-to-unmount-nix-or-nix-store.patch')
-rw-r--r--pkgs/os-specific/linux/systemd/0008-Don-t-try-to-unmount-nix-or-nix-store.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/systemd/0008-Don-t-try-to-unmount-nix-or-nix-store.patch b/pkgs/os-specific/linux/systemd/0008-Don-t-try-to-unmount-nix-or-nix-store.patch
new file mode 100644
index 00000000000..b858f3f7a45
--- /dev/null
+++ b/pkgs/os-specific/linux/systemd/0008-Don-t-try-to-unmount-nix-or-nix-store.patch
@@ -0,0 +1,53 @@
+From 5b2eafc51fa2d98f03fd341176d9a7accc0259ae Mon Sep 17 00:00:00 2001
+From: Eelco Dolstra <eelco.dolstra@logicblox.com>
+Date: Mon, 11 May 2015 15:30:46 +0200
+Subject: [PATCH 08/27] Don't try to unmount /nix or /nix/store
+
+33f458625f2a9d201263bd1b81b1c56f4a077e80 wasn't enough.
+---
+ src/core/mount.c | 22 +++++++++++++++++-----
+ 1 file changed, 17 insertions(+), 5 deletions(-)
+
+diff --git a/src/core/mount.c b/src/core/mount.c
+index 959b8fbed2..5e4c4a9767 100644
+--- a/src/core/mount.c
++++ b/src/core/mount.c
+@@ -409,7 +409,9 @@ static bool mount_is_extrinsic(Mount *m) {
+ 
+         if (PATH_IN_SET(m->where,  /* Don't bother with the OS data itself */
+                         "/",
+-                        "/usr"))
++                        "/usr",
++                        "/nix/",
++                        "/nix/store"))
+                 return true;
+ 
+         if (PATH_STARTSWITH_SET(m->where,
+@@ -439,10 +441,20 @@ static int mount_add_default_dependencies(Mount *m) {
+         if (!UNIT(m)->default_dependencies)
+                 return 0;
+ 
+-        /* We do not add any default dependencies to /, /usr or /run/initramfs/, since they are guaranteed to stay
+-         * mounted the whole time, since our system is on it.  Also, don't bother with anything mounted below virtual
+-         * file systems, it's also going to be virtual, and hence not worth the effort. */
+-        if (mount_is_extrinsic(m))
++        if (!MANAGER_IS_SYSTEM(UNIT(m)->manager))
++                return 0;
++
++        /* We do not add any default dependencies to /, /usr or
++         * /run/initramfs/, since they are guaranteed to stay
++         * mounted the whole time, since our system is on it.
++         * Also, don't bother with anything mounted below virtual
++         * file systems, it's also going to be virtual, and hence
++         * not worth the effort. */
++        if (PATH_IN_SET(m->where, "/", "/usr", "/nix", "/nix/store") ||
++            path_startswith(m->where, "/run/initramfs") ||
++            path_startswith(m->where, "/proc") ||
++            path_startswith(m->where, "/sys") ||
++            path_startswith(m->where, "/dev"))
+                 return 0;
+ 
+         p = get_mount_parameters(m);
+-- 
+2.24.1
+