Conversation
|
@michalpalka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @wkennington, @dezgeg and @edolstra to be potential reviewers. |
| # if we include it. | ||
| grub-mkimage -O ${efiSystemsBuild.${stdenv.system}.target}-xen -c grub-bootstrap.cfg \ | ||
| -m memdisk.tar -o grub-${efiSystemsBuild.${stdenv.system}.target}-xen.bin \ | ||
| `ls ${grub2_xen}/lib/grub/${efiSystemsBuild.${stdenv.system}.target}-xen/ |grep 'mod''$'|grep -v '^all_video\.mod''$'` |
There was a problem hiding this comment.
Also don't use back ticks, but $().
There was a problem hiding this comment.
And add ""s pretty much everywhere.
There was a problem hiding this comment.
I have put quotes around all file names with variables in them, and addressed the other changes. Please let me know if this is what you wanted.
There was a problem hiding this comment.
Actually, I had to revert back to using ls instead of find, as find produces full paths instead of just file names. If there is some specific reason not to use ls, please let me know. Otherwise I would prefer to stay with ls, as using find will require adding one more processing step to the pipeline.
| -m memdisk.tar -o grub-${efiSystemsBuild.${stdenv.system}.target}-xen.bin \ | ||
| `ls ${grub2_xen}/lib/grub/${efiSystemsBuild.${stdenv.system}.target}-xen/ |grep 'mod''$'|grep -v '^all_video\.mod''$'` | ||
| mkdir -p $out/lib/grub-xen | ||
| cp grub-${efiSystemsBuild.${stdenv.system}.target}-xen.bin $out/lib/grub-xen/ |
There was a problem hiding this comment.
The variables also need to be quoted.
There was a problem hiding this comment.
Could you point at which braces are unbalanced here? I can't see any.
There was a problem hiding this comment.
I have put quotes around file names here too.
| @@ -0,0 +1,9 @@ | |||
| if search -s -f /boot/grub/grub.cfg ; then | |||
| echo "Reading (${root})/boot/grub/grub.cfg" | |||
There was a problem hiding this comment.
The parentheses and ${root} might make sense in a larger context, but they don't to me in this small context.
There was a problem hiding this comment.
The parentheses are here to match Grub's config file syntax. In fact, the file has been taken from here. If you think that there is a good reason to remove them, then of course I can do it.
There was a problem hiding this comment.
Why are there two paths to read grub.cfg from? One is /boot/grub/grub.cfg. If we only use one, eliminate one please.
There was a problem hiding this comment.
Regarding the parentheses, adding the comment
The parentheses around ${root} here to match Grub's config file syntax to the source code would work wonders.
There was a problem hiding this comment.
My understanding is that it is a convenience feature, which allows you to have a separate /boot partition and still use the same pre-built pvgrub image, as explained on the Xen project wiki:
Bootstrapping into this more complex grub.cfg allows us to cope with guests which have a separate /boot partition by searching for a file named /boot/grub/grub.cfg or /grub/grub.cfg on any partition. Note that ${root} is set by the search command and should be entered literally, not substituted while creating this file.
Since the Xen project wiki is advocating for this solution, I would recommend keeping it.
There was a problem hiding this comment.
I have added the comment about parentheses.
| description = "PvGrub image for use for booting PV Xen guests"; | ||
|
|
||
| longDescription = | ||
| '' This package provides a PvGrub image for booting PV Xen guests |
There was a problem hiding this comment.
It's a long description, so just state Paravirtualization (PV).
|
Thanks for the comments! I have amended the commit to address them. |
There was a problem hiding this comment.
https://wiki.xenproject.org/wiki/Xen_EFI lists all_video.mod in one particular configuration, so your statement doesn't seem precise enough.
There was a problem hiding this comment.
The comment is based on my observation that pvgrub fails when we include that module. The website that you linked to concerns booting Xen itself using EFI, which requires compiling grub as an EFI loader. The all_video.mod module is probably working in that setup, which does not contradict what I wrote. Please let me know if I should include any clarification in the comment.
There was a problem hiding this comment.
@michalpalka I like content without words like "I believe" or "probably" better than content that just guesses something.
While I understand it's hard to know everything, striving to documenting the reasons for failures makes it possible to improve things later on.
It has already been merged, which is good for continuity, but if you do have a superior understand of exactly why things happen the way they do with all_video.mod, please document it.
Add a package containing a pvgrub image for xen generated from grub2
Add a package containing a pvgrub image for xen generated from grub2
Motivation for this change
This package provides a
pvgrubimage for booting PV guests in xen. Currently, xen in NixOS also providespygrub, but it can be used only to boot guests that use older grub utilisingmenu.lst, and fails with new NixOS guests, for example.I would appreciate if someone takes a look at this before merging.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandboxinnix.confon non-NixOS)
nix-shell -p nox --run "nox-review wip"./result/bin/)