Commit Graph

5 Commits

Author SHA1 Message Date
r-vdp
65f375d172
etc: extend tests to ensure that temporary dirs are cleaned up 2024-10-16 22:24:46 +02:00
r-vdp
24bf6e9cb8
nixos/etc-overlay: avoid rebuilding the initrd every time the etc contents change
Before this change, the hash of the etc metadata image was included in
the mount unit that's responsible for mounting this metadata image in the
initrd.
And because this metadata image changes with every change to the etc
contents, the initrd would be rebuild every time as well.
This can lead to a lot of rebuilds (especially when revision info is
included in /etc/os-release) and all these initrd archives use up a lot of
space on the ESP.

With this change, we instead include a symlink to the metadata image in the
top-level directory, in the same way as we already do for things like init and
prepare-root, and we deduce the store path from the init= kernel parameter,
in the same way as we already do to find the path to init and prepare-root.

Doing so avoids rebuilding the initrd all the time.
2024-10-16 17:42:58 +02:00
nikstur
6abbe725ca nixos/etc: handle mountpoints on top of /etc when switching
The activation script that remounts the /etc overlay now handles other
mount points on top of /etc by bind mounting them to the new temporary
/etc overlay and then atomically revealing it.
2024-07-18 21:28:53 +02:00
nikstur
5df8caced4 nixos/etc: make re-mounting /etc overlay idempotent 2024-02-21 22:54:00 +01:00
nikstur
60f529fc82 nixos/etc: optionally mount etc as an overlay 2024-01-22 00:54:13 +01:00