+11
−2
Loading
This module disables the activation scripts that would normally create
`/usr/bin/env` and `/bin/sh` (and their parent directories). When
systemd is used in the initrd, the absence of these directories causes
2 problems:
- During switch-root, base_filesystem_create_fd() creates an empty /usr
directory. Later at stage2, systemd's initialize_runtime() aborts
booting with "Refusing to run in unsupported environment where /usr/
is not populated."
- Once /usr/bin is restored (by the fix above), base_filesystem_create_fd()
creates a symlink /bin -> /usr/bin. systemd-fstab-generator then
canonicalizes the /bin fstab entry through this symlink, producing a
duplicate usr-bin.mount.
We create both /sysroot/usr/bin and /sysroot/bin via initrd tmpfiles
to prevent both issues.
Resolves NixOS#462556
Co-authored-by:
Lin Yinfeng <lin.yinfeng@outlook.com>