nixpkgs/nixos/modules/system/boot
Klemens Nanni 9553106832 nixos/stage-1: Ensure correct ZFS mount options
Consider ZFS filesystems meant to be mounted with zfs.mount(8), e.g.
```
config.fileSystems."/media".options = [ "zfsutil" ];
config.fileSystems."/nix".options = [ "zfsutil" ];
```

`zfsutil` uses dataset properties as mount options such that zfsprops(7)
do not have to be duplicated in fstab(5) entries or manual mount(8)
invocations.

Given the example configuation above, /media is correctly mounted with
`setuid=off` translated into `nosuid`:

```
$ zfs get -Ho value setuid /media
off
$ findmnt -t zfs -no options /media
rw,nosuid,nodev,noexec,noatime,xattr,posixacl
```

/nix however was mounted with default mount(8) options:
```
$ zfs get -Ho value setuid /nix
off
$ findmnt -t zfs -no options /nix
rw,relatime,xattr,noacl
```

This holds true for all other ZFS properties/mount options, including
`exec/[no]exec`, `devices/[no]dev`, `atime/[no]atime`, etc.

/nix is mounted using BusyBox's `mount` during stage 1 init while /media
is mounted later using proper systemd and/or util-linux's `mount`.

Tracing stage 1 init showed that BusyBox never tried to execute
mount.zfs(8) as intended by `zfsutil`.

Replacing it with util-linux's `mount` and adding the mount helper
showed attempts to execute mount.zfs(8).

Ensure ZFS filesystems are mounted with correct options iff `zfsutil` is
used.
2022-05-26 22:16:53 +02:00
..
loader systemd-boot: use mktemp from coreutils in installer 2022-05-02 15:44:55 +03:00
systemd nixos/systemd: Package only built component units 2022-05-16 16:52:25 +02:00
binfmt.nix nixos/nix-daemon: use structural settings 2022-01-26 21:04:50 -05:00
emergency-mode.nix nixos/*: editorconfig fixes 2020-08-08 10:54:16 +10:00
grow-partition.nix utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
initrd-network.nix nixos/initrd-network: fix /etc/resolv.conf when multiple dns servers from DHCP 2020-10-19 21:32:58 -07:00
initrd-openvpn.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
initrd-ssh.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
kernel.nix nixos: don't put non-firmware in hardware.firmware 2022-05-12 15:17:51 +00:00
kernel_config.nix nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
kexec.nix kexec-tools: rename from kexectools to match the project name 2021-09-03 10:17:21 -04:00
luksroot.nix nixos/systemd-stage-1: Remove unnecessary binaries 2022-04-30 14:50:02 +02:00
modprobe.nix treewide: pkgs.systemd -> config.systemd.package 2022-05-05 20:00:31 +02:00
networkd.nix nixos/networkd: allow RouteMetric for IPv6AcceptRA 2022-04-30 00:30:04 +02:00
pbkdf2-sha512.c nixos/boot: add final newline to pbkdf2-sha512.c 2020-11-09 11:39:28 +00:00
plymouth.nix nixos/plymouth: Fix non-systemd initrd boot 2022-05-23 11:17:21 +02:00
resolved.nix nixos/*: add trivial defaultText for options with simple defaults 2021-12-02 22:35:04 +01:00
shutdown.nix utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
stage-1-init.sh nixos/stage-1: remove dead code 2022-05-03 16:15:51 +02:00
stage-1.nix nixos/stage-1: Ensure correct ZFS mount options 2022-05-26 22:16:53 +02:00
stage-2-init.sh nixos/stage-1-systemd: Handover between the systemds directly 2022-04-11 20:04:33 +01:00
stage-2.nix Merge pull request #165453 from helsinki-systems/feat/systemd-manager-environment 2022-03-31 01:35:09 +02:00
systemd.nix nixos/systemd: Package only built component units 2022-05-16 16:52:25 +02:00
timesyncd.nix nixos/timesyncd: initialize clock file with current time 2022-03-05 21:27:45 +01:00
tmp.nix nixos/tmp: Fix format of /tmp mount options 2022-01-31 12:49:29 +01:00