nixos/qemu-vm: refactor bootDisk using make-disk-image#207039
nixos/qemu-vm: refactor bootDisk using make-disk-image#207039RaitoBezarius merged 5 commits intomasterfrom
Conversation
0102cdc to
486bf1e
Compare
486bf1e to
b2ac559
Compare
|
@RaitoBezarius The comments sound like you still want to work on this. What's the status here? |
Didn't have time to fix my own comments yet, but it's open to additional comments. |
b2ac559 to
b82c8f9
Compare
b82c8f9 to
5b082f5
Compare
3fde81c to
371d377
Compare
|
Latest evaluation: https://hydra.nixos.org/eval/1793584?compare=-172800&full=0#tabs-now-fail |
fd8d369 to
5724827
Compare
There was a problem hiding this comment.
I'm not the most knowledgeable about the qemu-vm test stuff, but this change feels sane to me
Since it changes some semantics it could have some fallout for downstream users, but I don't imagine there are many and it should hopefully be easy for them to understand and update
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
5724827 to
792fd0a
Compare
|
It looks like |
If I remember well, the failure is alas unrelated. It's because GRUB tries to install legacy for a UEFI only target. |
Yeah the error message sounded like that was the issue It looks like the NixOS GRUB module assumes that it needs to install legacy unless |
Thank you for going in the rabbit hole, I rediscover this each time. :) |
So I don't know if this is "correct" necessarily, but this diff on top of this PR does allow a number of grub tests to pass again (those which currently pass on master and fail on this PR): diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix
index f85567c42f2..fa928a1ba2f 100644
--- a/nixos/modules/virtualisation/qemu-vm.nix
+++ b/nixos/modules/virtualisation/qemu-vm.nix
@@ -849,7 +849,7 @@ in
${opt.writableStore} = false;
'';
- boot.loader.grub.device = mkVMOverride cfg.bootLoaderDevice;
+ boot.loader.grub.device = mkVMOverride (if cfg.useEFIBoot then "nodev" else cfg.bootLoaderDevice);
boot.loader.grub.gfxmodeBios = with cfg.resolution; "${toString x}x${toString y}";
virtualisation.rootDevice = mkDefault suggestedRootDevice;
|
792fd0a to
07f5a70
Compare
|
@lilyinstarlight Adressed and latest evaluation shows that it fixes the GRUB tests: https://hydra.nixos.org/eval/1793709 |
nikstur
left a comment
There was a problem hiding this comment.
Very cool change. The comments and descriptions could use some more editing. Most of my comments are either nitpicks or revolve around naming. Although I think naming is very important, I think it is more important to get this PR across the finish line. We can still improve the naming later.
318c68b to
58f7c4e
Compare
58f7c4e to
e81f8d2
Compare
This option has been introduced in 678eed3 without realizing there was this PR inflight, unfortunately, it collide with what this PR does and make it irrelevant. Therefore, I remove it here.
I do a lot of work on QEMU VM and make-disk-image and I was bitten by an unnotified change recently, so I want to chime in the future changes of this file.
e81f8d2 to
76f1b63
Compare
|
Finally, this will be merged once ofborg CI passes. |
|
Thanks to everyone involved in this journey. :) |
|
This PR broke nixosTests.kexec. It seems like the final Hydra eval had that test as broken, so maybe it's worth a look to see if any other tests were found to be broken during that eval and overlooked? |
|
Hmm, I will investigate this further. I remember that some of the stuff
seemed already broken on master but I may have done mistakes. Thank you for
the heads-up!
Le ven. 19 mai 2023 à 23:45, Alyssa Ross ***@***.***> a
écrit :
… This PR broke nixosTests.kexec. It seems like the final Hydra eval had
that test as broken, so maybe it's worth a look to see if any other tests
were found to be broken during that eval and overlooked?
—
Reply to this email directly, view it on GitHub
<#207039 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACMZRE4RFCHNMRJXUHLYU3XG7SZBANCNFSM6AAAAAATE4LUVY>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Description of changes
Depends on #207038.
A small cover letter on the changes:
We remove the
bootDiskad-hoc generation and rewire it up withmake-disk-image, this unlocks various features:make-disk-image)rootDevice,bootDeviceandbootPartitionwhich clarify further the different roles of the disk in the VM world we use, to cater for legacy (disk-level) and UEFI (partition-level) needs.persistBootDeviceintroduced in 678eed3Testing is done on https://hydra.nixos.org/jobset/nixos/python-test-refactoring on a recent enough: nixos-unstable-small and treewide cleanups are done.
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes