2022-06-30 11:54:47 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2023-06-19 02:40:27 +02:00
|
|
|
From: Raito Bezarius <masterancpp@gmail.com>
|
|
|
|
Date: Mon, 19 Jun 2023 02:11:35 +0200
|
2022-06-30 11:54:47 +02:00
|
|
|
Subject: [PATCH] Don't try to unmount /nix or /nix/store
|
2020-01-26 14:56:41 +01:00
|
|
|
|
|
|
|
They'll still be remounted read-only.
|
|
|
|
|
|
|
|
https://github.com/NixOS/nixos/issues/126
|
2023-06-19 02:40:27 +02:00
|
|
|
|
|
|
|
Original-Author: Eelco Dolstra <eelco.dolstra@logicblox.com>
|
2020-01-26 14:56:41 +01:00
|
|
|
---
|
2020-06-14 14:18:30 +02:00
|
|
|
src/shared/fstab-util.c | 2 ++
|
2023-06-19 02:40:27 +02:00
|
|
|
src/shutdown/umount.c | 6 ++++--
|
|
|
|
2 files changed, 6 insertions(+), 2 deletions(-)
|
2020-01-26 14:56:41 +01:00
|
|
|
|
2020-06-14 14:18:30 +02:00
|
|
|
diff --git a/src/shared/fstab-util.c b/src/shared/fstab-util.c
|
2023-11-19 02:35:57 +01:00
|
|
|
index 55e76b6e16..015a608035 100644
|
2020-06-14 14:18:30 +02:00
|
|
|
--- a/src/shared/fstab-util.c
|
|
|
|
+++ b/src/shared/fstab-util.c
|
2023-11-19 02:35:57 +01:00
|
|
|
@@ -66,6 +66,8 @@ bool fstab_is_extrinsic(const char *mount, const char *opts) {
|
2020-06-14 14:18:30 +02:00
|
|
|
/* Don't bother with the OS data itself */
|
|
|
|
if (PATH_IN_SET(mount,
|
|
|
|
"/",
|
2020-03-07 23:47:22 +01:00
|
|
|
+ "/nix",
|
|
|
|
+ "/nix/store",
|
|
|
|
"/usr",
|
|
|
|
"/etc"))
|
2020-03-07 22:31:45 +01:00
|
|
|
return true;
|
2020-01-26 14:56:41 +01:00
|
|
|
diff --git a/src/shutdown/umount.c b/src/shutdown/umount.c
|
2023-11-19 02:35:57 +01:00
|
|
|
index 1a9b99d761..04ef9af1ea 100644
|
2020-01-26 14:56:41 +01:00
|
|
|
--- a/src/shutdown/umount.c
|
|
|
|
+++ b/src/shutdown/umount.c
|
2023-06-19 02:40:27 +02:00
|
|
|
@@ -170,8 +170,10 @@ int mount_points_list_get(const char *mountinfo, MountPoint **head) {
|
2020-01-26 14:56:41 +01:00
|
|
|
static bool nonunmountable_path(const char *path) {
|
2023-06-19 02:40:27 +02:00
|
|
|
assert(path);
|
|
|
|
|
|
|
|
- return PATH_IN_SET(path, "/", "/usr") ||
|
|
|
|
- path_startswith(path, "/run/initramfs");
|
|
|
|
+ return PATH_IN_SET(path, "/", "/usr")
|
2020-01-26 14:56:41 +01:00
|
|
|
+ || path_equal(path, "/nix")
|
|
|
|
+ || path_equal(path, "/nix/store")
|
2023-06-19 02:40:27 +02:00
|
|
|
+ || path_startswith(path, "/run/initramfs");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void log_umount_blockers(const char *mnt) {
|