summary refs log tree commit diff
path: root/nixos/modules/system/boot/stage-2-init.sh
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2017-04-04 23:27:51 +0200
committerJörg Thalheim <joerg@thalheim.io>2017-04-05 09:05:18 +0200
commitb42af252238d8e5a4b737ad39fda503f9d93c36f (patch)
tree74fba44c23f88d05f3920eedeb5f85d4688136e8 /nixos/modules/system/boot/stage-2-init.sh
parenta5ad8b4f69d541f1b8e456eb5d405b1558df9885 (diff)
downloadnixpkgs-b42af252238d8e5a4b737ad39fda503f9d93c36f.tar
nixpkgs-b42af252238d8e5a4b737ad39fda503f9d93c36f.tar.gz
nixpkgs-b42af252238d8e5a4b737ad39fda503f9d93c36f.tar.bz2
nixpkgs-b42af252238d8e5a4b737ad39fda503f9d93c36f.tar.lz
nixpkgs-b42af252238d8e5a4b737ad39fda503f9d93c36f.tar.xz
nixpkgs-b42af252238d8e5a4b737ad39fda503f9d93c36f.tar.zst
nixpkgs-b42af252238d8e5a4b737ad39fda503f9d93c36f.zip
stage-2: replace readonly-mountpoint by findmnt
Diffstat (limited to 'nixos/modules/system/boot/stage-2-init.sh')
-rw-r--r--nixos/modules/system/boot/stage-2-init.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/nixos/modules/system/boot/stage-2-init.sh b/nixos/modules/system/boot/stage-2-init.sh
index 99930fb95a6..b5b2acf86ab 100644
--- a/nixos/modules/system/boot/stage-2-init.sh
+++ b/nixos/modules/system/boot/stage-2-init.sh
@@ -46,7 +46,9 @@ echo "booting system configuration $systemConfig" > /dev/kmsg
 chown -f 0:30000 /nix/store
 chmod -f 1775 /nix/store
 if [ -n "@readOnlyStore@" ]; then
-    if ! readonly-mountpoint /nix/store; then
+    if ! [[ "$(findmnt --noheadings --output OPTIONS /nix/store)" =~ ro(,|$) ]]; then
+        # FIXME when linux < 4.5 is EOL, switch to atomic bind mounts
+        #mount /nix/store /nix/store -o bind,remount,ro
         mount --bind /nix/store /nix/store
         mount -o remount,ro,bind /nix/store
     fi