summary refs log blame commit diff
path: root/pkgs/os-specific/linux/systemd/0002-Don-t-try-to-unmount-nix-or-nix-store.patch
blob: e9fedd239f473c821b51795c3190c88fc2669a73 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                                      

                                                 
                                                              




                                         

                               
                                 
 
                                                              
                                   





                                                                                



                                      
                             
                                                          
                                   

                           
                                                         








                                                    
      
 
From 41edb381df0326e216b3c569d2cd5764591267d9 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Fri, 12 Apr 2013 13:16:57 +0200
Subject: [PATCH 02/19] Don't try to unmount /nix or /nix/store

They'll still be remounted read-only.

https://github.com/NixOS/nixos/issues/126
---
 src/shared/fstab-util.c | 2 ++
 src/shutdown/umount.c   | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/shared/fstab-util.c b/src/shared/fstab-util.c
index f683f05981..5a04c2c2a6 100644
--- a/src/shared/fstab-util.c
+++ b/src/shared/fstab-util.c
@@ -40,6 +40,8 @@ bool fstab_is_extrinsic(const char *mount, const char *opts) {
         /* Don't bother with the OS data itself */
         if (PATH_IN_SET(mount,
                         "/",
+                        "/nix",
+                        "/nix/store",
                         "/usr",
                         "/etc"))
                 return true;
diff --git a/src/shutdown/umount.c b/src/shutdown/umount.c
index 1f945b7875..6df9d383ba 100644
--- a/src/shutdown/umount.c
+++ b/src/shutdown/umount.c
@@ -508,6 +508,8 @@ static int delete_md(MountPoint *m) {
 
 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
-- 
2.33.1