nixos/stage-1: follow mount options

For fileSystems needed for boot which are bind mounts, busybox tend to
ignore mount options, so we remount right afterwards
This commit is contained in:
Minijackson 2022-09-29 08:33:44 +02:00
parent eedee8f9e0
commit b25259e021
No known key found for this signature in database
GPG key ID: FEA888C9F5D64F62

View file

@ -410,6 +410,11 @@ mountFS() {
n=$((n + 1))
done
# 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"
[ "$mountPoint" == "/" ] &&
[ -f "/mnt-root/etc/NIXOS_LUSTRATE" ] &&
lustrateRoot "/mnt-root"