mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
nixos/stage-1.init.sh: only remount bind fsType
We should not remount all filesystem types since not all filesystems are safe to remount and some (nfs) return errors if remounted with certain mount options.
This commit is contained in:
parent
07f46bea64
commit
57c6e3bbe4
1 changed files with 10 additions and 2 deletions
|
@ -423,8 +423,16 @@ mountFS() {
|
|||
|
||||
# For bind mounts, busybox has a tendency to ignore options, which can be a
|
||||
# security issue (e.g. "nosuid"). Remounting the partition seems to fix the
|
||||
# issue.
|
||||
mount "/mnt-root$mountPoint" -o "remount,$optionsPrefixed"
|
||||
# issue. This should only be done for bind and rbind mountpoints because other
|
||||
# filesystems may have limitations or may not support remount.
|
||||
local IFS=,
|
||||
for opt in $options; do
|
||||
if [[ "$opt" = bind || "$opt" = rbind ]]; then
|
||||
mount "/mnt-root$mountPoint" -o "remount,$optionsPrefixed"
|
||||
break
|
||||
fi
|
||||
done
|
||||
unset IFS
|
||||
|
||||
[ "$mountPoint" == "/" ] &&
|
||||
[ -f "/mnt-root/etc/NIXOS_LUSTRATE" ] &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue