Skip to content
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

[WIP]: initialRamdisk: Use systemd for initrd's /init #74842

wants to merge 1 commit into
base: master


Copy link

ElvishJerricco commented Dec 2, 2019

Motivation for this change
  • This parallelizes early boot.
  • Systemd generators like the cryptsetup and fstab ones can be used to handle mounting and prompting for passwords.
  • Plymouth can start much earlier, in early boot, making the boot graphics much cleaner.
  • Systemd services from other packages can be used.
  • systemd-ask-password can be used.

NOTE: This is a WIP. I'm opening this PR now mostly for feedback on the concept.

Things done
  • Set initrd's /init to the systemd binary.
  • Use systemctl switch-root instead of switch_root.
  • Minimize the size inflation. Currently this only inflates a base initrd by 1M. I'd like to get this down further though.
  • Switch to fstab and crypttab generators.
  • Make sure none of the NixOS tests have broken.
  • Start plymouth in initrd.
  • Use systemd for setting up the initrd network stack.
  • Offer a trivial NixOS module interface for adding packages' systemd services to initrd.
  • Use systemd's on failure to boot.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits

This comment has been minimized.

Copy link

flokli commented Dec 2, 2019

Very nice! Tackling this is on my todo list for quite some time, I'm happy to see this happening now :-)

As far as lvm and cryptsetup foo is concerned, I just polished #66856.


This comment has been minimized.

Copy link

bjornfor commented Dec 3, 2019

Cross referencing #72401 and #72802.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.