stage2: use atomic bind mounts
This commit is contained in:
committed by
Jonathan Ringer
parent
726da12d8b
commit
cb3a0f55e8
@@ -62,9 +62,11 @@ chown -f 0:30000 /nix/store
|
|||||||
chmod -f 1775 /nix/store
|
chmod -f 1775 /nix/store
|
||||||
if [ -n "@readOnlyStore@" ]; then
|
if [ -n "@readOnlyStore@" ]; then
|
||||||
if ! [[ "$(findmnt --noheadings --output OPTIONS /nix/store)" =~ ro(,|$) ]]; then
|
if ! [[ "$(findmnt --noheadings --output OPTIONS /nix/store)" =~ ro(,|$) ]]; then
|
||||||
# FIXME when linux < 4.5 is EOL, switch to atomic bind mounts
|
if [ -z "$container" ]; then
|
||||||
#mount /nix/store /nix/store -o bind,remount,ro
|
|
||||||
mount --bind /nix/store /nix/store
|
mount --bind /nix/store /nix/store
|
||||||
|
else
|
||||||
|
mount --rbind /nix/store /nix/store
|
||||||
|
fi
|
||||||
mount -o remount,ro,bind /nix/store
|
mount -o remount,ro,bind /nix/store
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user