-
-
Notifications
You must be signed in to change notification settings - Fork 13.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/etc-overlay: avoid rebuilding the initrd every time the etc contents change #340722
base: master
Are you sure you want to change the base?
Conversation
@ofborg test activation-etc-overlay-mutable activation-etc-overlay-immutable |
6c6e66d
to
08f7609
Compare
@nikstur would you be able to give this a review? I think it would be nice to get this in before 24.11 branch-off. |
08f7609
to
fd801cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a really good idea. I'd really like to see the finding of the top-level from the commandline to be generic before merging.
… separate service
fd801cf
to
36488c1
Compare
2ca1a21
to
70dc0a1
Compare
@ofborg test activation-etc-overlay-mutable activation-etc-overlay-immutable systemd-initrd-simple |
…tents 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.
70dc0a1
to
792fd17
Compare
@ofborg test activation-etc-overlay-mutable activation-etc-overlay-immutable systemd-initrd-simple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on my machine.
Also tested the reboot now. |
Description of changes
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 rebuilt 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.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.