`udevCheckHook` relies on `udevadm` from systemd to
check udev rules outputs of packages at build time.
Previously, we had no tests in systemd itself which
assured `udevadm` runs correctly. Neither did we
check udev rules output of the systemd package.
We can not use `udevCheckHook` to check systemd, as
that would introduce infinite recursion. So, instead,
we simply check the installed rule output explicitly
in systemd's `installCheckPhase`. Be aware `doInstallCheck`
will be disabled if the buildPlatform can not execute
the hostPlatform, so while `udevCheckHook` can check
udev rules on Linux -> Linux cross compilation,
systemd itself will have its udev rules checked for
native builds only.
This reverts commit 65a333600d.
This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.
It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).
A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.
[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e458
This makes it much easier to run tests for systemd updates.
The only test from `nixosTests.systemd-*` that's omitted is
`nixosTests.systemd-initrd-bridge` as it fails to evaluate.
As of this revision, the following tests fail:
- `nixosTests.systemd-initrd-vconsole`. Fails because it is looking
for the machine to spit back `arstneio` but instead it responds with
`rstneio` (no `a`). Hangs until it times out.
- `nixosTests.systemd-journal-gateway`. Fails because
`Option --trust= is not available.` in `systemd-journal-gatewayd`.
- `nixosTests.systemd-journal`. Fails because the test auditd enabled
errors: grep 'unit=systemd-journald' /var/log/audit/audit.log failed
- `nixosTests.installer-systemd-stage-1.clevisZfsParentDatasetFallback`.
Hangs waiting for a password prompt.
- `nixosTests.installer-systemd-stage-1.bcachefsSimple` and
`nixosTests.installer-systemd-stage-1.bcachefsEncrypted`. Fails to boot.
I suspect this is a real issue, but I haven't dug in further.
Co-authored-by: Philip Taron <philip.taron@gmail.com>
Enable building the systemd-firstboot executable.
Regarding the previous comment:
> conflicts with the NixOS /etc management
For conflicts to occur with /etc management, systemd-firstboot would
have to be used. However activating the build flag only makes the
executable available but it isn't used anywhere yet.
We need to patch systemd to make systemd-ssh-generator(8) work:
- systemd doesn't follow symlinks when checking for a packaged
sshd@.service unit
- systemd tries to link the ssh config dropins by default with tmpfiles
to /usr, that is not possible, so we include the snippet manually.
The previous URL is no longer accessible, presumably because the
branch was rebased. Happily, they're now in master. I've added a
note to make sure we don't accidentally use unstable URLs again in
future.