2020-04-30 00:08:05 +01:00
|
|
|
From bdd3ff777dd8253ff5732118dd6de0fa9a9b95fe Mon Sep 17 00:00:00 2001
|
2020-01-26 13:56:41 +00:00
|
|
|
From: Eelco Dolstra <eelco.dolstra@logicblox.com>
|
|
|
|
Date: Fri, 12 Apr 2013 13:16:57 +0200
|
2020-04-30 00:03:18 +01:00
|
|
|
Subject: [PATCH 02/18] Don't try to unmount /nix or /nix/store
|
2020-01-26 13:56:41 +00:00
|
|
|
|
|
|
|
They'll still be remounted read-only.
|
|
|
|
|
|
|
|
https://github.com/NixOS/nixos/issues/126
|
|
|
|
---
|
2020-04-30 00:03:18 +01:00
|
|
|
src/core/mount.c | 2 ++
|
2020-01-26 13:56:41 +00:00
|
|
|
src/shutdown/umount.c | 2 ++
|
2020-04-30 00:03:18 +01:00
|
|
|
2 files changed, 4 insertions(+)
|
2020-01-26 13:56:41 +00:00
|
|
|
|
2020-03-07 21:31:45 +00:00
|
|
|
diff --git a/src/core/mount.c b/src/core/mount.c
|
2020-04-30 00:03:18 +01:00
|
|
|
index 1c4aefd734..a5553226f8 100644
|
2020-03-07 21:31:45 +00:00
|
|
|
--- a/src/core/mount.c
|
|
|
|
+++ b/src/core/mount.c
|
2020-04-30 00:03:18 +01:00
|
|
|
@@ -412,6 +412,8 @@ static bool mount_is_extrinsic(Mount *m) {
|
2020-03-07 21:31:45 +00:00
|
|
|
|
|
|
|
if (PATH_IN_SET(m->where, /* Don't bother with the OS data itself */
|
2020-03-07 22:47:22 +00:00
|
|
|
"/", /* (strictly speaking redundant: should already be covered by the perpetual flag check above) */
|
|
|
|
+ "/nix",
|
|
|
|
+ "/nix/store",
|
|
|
|
"/usr",
|
|
|
|
"/etc"))
|
2020-03-07 21:31:45 +00:00
|
|
|
return true;
|
2020-01-26 13:56:41 +00:00
|
|
|
diff --git a/src/shutdown/umount.c b/src/shutdown/umount.c
|
2020-04-30 00:03:18 +01:00
|
|
|
index 8a5e80eeaa..fab35ed6f3 100644
|
2020-01-26 13:56:41 +00:00
|
|
|
--- a/src/shutdown/umount.c
|
|
|
|
+++ b/src/shutdown/umount.c
|
2020-04-30 00:03:18 +01:00
|
|
|
@@ -414,6 +414,8 @@ static int delete_dm(dev_t devnum) {
|
2020-01-26 13:56:41 +00:00
|
|
|
|
|
|
|
static bool nonunmountable_path(const char *path) {
|
|
|
|
return path_equal(path, "/")
|
|
|
|
+ || path_equal(path, "/nix")
|
|
|
|
+ || path_equal(path, "/nix/store")
|
|
|
|
#if ! HAVE_SPLIT_USR
|
|
|
|
|| path_equal(path, "/usr")
|
|
|
|
#endif
|
|
|
|
--
|
2020-04-30 00:03:18 +01:00
|
|
|
2.26.2
|
2020-01-26 13:56:41 +00:00
|
|
|
|