grub module: add extraInitrd option#22969
Merged
fpletz merged 1 commit intoNixOS:masterfrom Feb 20, 2017
Merged
Conversation
|
@symphorien, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @wkennington and @obadz to be potential reviewers. |
joachifm
reviewed
Feb 19, 2017
Contributor
There was a problem hiding this comment.
The example needs to be quoted, otherwise the evaluator will try to actually read it.
52b7524 to
9ed2846
Compare
Member
Author
|
Sorry, this is now fixed. |
Member
|
Wow, awesome. Didn't know you could add a second initrd. What are the semantics here? Does the kernel just mount the second initrd over the first one are the contents copied? Seems a bit weird at first glance that the contents of both initrds are available at /. |
Contributor
|
The contents are copied. The cpio format that's used for initrds cannot be mounted as it doesn't support efficient random access. |
Member
|
Thanks for the explanation @dezgeg! |
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for this change
This adds a NixOS option which enables to configure grub to give the kernel a second ,additional initramfs.
My use case is the following:
I have a LUKS encrypted root filesystem, and no /boot partition. Grub asks me a passphrase to open /, read its configuration in /boot and then loads the kernel.
The initramfs then asks me the same passphrase a second time to mount /.
The solution is to create a LUKS keyfile, readable by root only, and put it in the initramfs so that stage1 doesn't need the passphrase anymore. But because of issue #8 one cannot but secret files in the store and thus in the initramfs.
So I have a second, static initramfs in
/boot/custom_initramfs/initramfs.gz, readable by root only, and containing only the keyfile/keyand the following setup:Things done
(nix.useSandbox on NixOS,
or option
build-use-sandboxinnix.confon non-NixOS)
nix-shell -p nox --run "nox-review wip"./result/bin/)Only tested on grub2, although the syntax should be the same with grub1.