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
fix the vmWithBootloader attribute of nixos #65133
base: master
Are you sure you want to change the base?
Conversation
you can test it with: nix-build ./nixos/ -A vmWithBootLoader --arg configuration '{ virtualisation.qemu.diskInterface = "virtio"; }' && ./result/bin/run-nixos-vm
Is this suitable for a backport since it used to work? |
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.
Minor changes, though it looks fine otherwise.
@@ -172,6 +175,7 @@ let | |||
# This is needed for GRUB 0.97, which doesn't know about virtio devices. | |||
mkdir /boot/grub | |||
echo '(hd0) /dev/vda' > /boot/grub/device.map | |||
ln -sv /dev/vda /dev/sda |
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.
Could we add a comment explaining why this is required?
Additionally, are there situations where VMs would need /dev/sd[^a]
to be available?
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.
when using the ide
backend it configures the grub device to /dev/sda
but the initial vm when installing the bootloader is still using virtio
(an existing bug that i'm not fixing), so it only has vda
and grub-install
fails
args = "-drive ${commonArgs},if=none -device lsi53c895a -device ${devArgs}"; | ||
in if isSCSI then args else "-drive ${commonArgs},if=${diskInterface}"; | ||
devArgs = [ "drive=${drvId}" ] ++ deviceArgs; | ||
cfgMap = { |
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.
👍
${mkDiskIfaceDriveFlag "0" "file=$NIX_DISK_IMAGE,cache=writeback,werror=report"} \ | ||
${mkDiskIfaceDriveFlag "1" "file=$TMPDIR/disk.img,media=disk"} \ | ||
${mkDiskIfaceDriveFlag "0" "file=$NIX_DISK_IMAGE,cache=writeback,werror=report" []} \ | ||
${mkDiskIfaceDriveFlag "1" "file=$TMPDIR/disk.img,media=disk" [ "bootindex=1" ]} \ |
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.
(note) if you wondered what this meant:
→ https://github.com/qemu/qemu/blob/master/docs/bootindex.txt
No need to add a comment. Just helping other reviewers.
If the bootindex property is not set for a device, it gets lowest boot priority. There is no particular order in which devices with unset bootindex property will be considered for booting, but they will still be bootable.
@@ -142,7 +145,7 @@ let | |||
buildInputs = [ pkgs.utillinux ]; | |||
QEMU_OPTS = if cfg.useEFIBoot | |||
then "-pflash $out/bios.bin -nographic -serial pty" | |||
else "-nographic -serial pty"; | |||
else "-nographic -serial mon:stdio"; |
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.
Why is only this side of the branch needing mon:stdio
?
And what's up with pty
, does it fail?
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.
pty
silently fails, making debug much more difficult
and yeah, i should probably fix the other branch also
ping @cleverca22. This is a pretty good contender to have in the release. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nixos-20-03-feature-freeze/5655/13 |
Interface "virtio" (the default) and "ide" works fine here (master @ 2020-02-24, 804fbc9). "scsi" still fails though. However, the reason I'm here is that
The failure mode for systemd-boot and the issue in the original post (reproducible now with
What's going on there? UPDATE: So my build problems above were fixed by upgrading from NixOS 19.09 to 20.03 (51d115a). |
Hello, I'm a bot and I thank you in the name of the community for your contributions. Nixpkgs is a busy repository, and unfortunately sometimes PRs get left behind for too long. Nevertheless, we'd like to help committers reach the PRs that are still important. This PR has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human. If this is still important to you and you'd like to remove the stale label, we ask that you leave a comment. Your comment can be as simple as "still important to me". But there's a bit more you can do: If you received an approval by an unprivileged maintainer and you are just waiting for a merge, you can @ mention someone with merge permissions and ask them to help. You might be able to find someone relevant by using Git blame on the relevant files, or via GitHub's web interface. You can see if someone's a member of the nixpkgs-committers team, by hovering with the mouse over their username on the web interface, or by searching them directly on the list. If your PR wasn't reviewed at all, it might help to find someone who's perhaps a user of the package or module you are changing, or alternatively, ask once more for a review by the maintainer of the package/module this is about. If you don't know any, you can use Git blame on the relevant files, or GitHub's web interface to find someone who touched the relevant files in the past. If your PR has had reviews and nevertheless got stale, make sure you've responded to all of the reviewer's requests / questions. Usually when PR authors show responsibility and dedication, reviewers (privileged or not) show dedication as well. If you've pushed a change, it's possible the reviewer wasn't notified about your push via email, so you can always officially request them for a review, or just @ mention them and say you've addressed their comments. Lastly, you can always ask for help at our Discourse Forum, or more specifically, at this thread or at #nixos' IRC channel. |
Still important to me. |
I marked this as stale due to inactivity. → More info |
you can test it with:
nix-build ./nixos/ -A vmWithBootLoader --arg configuration '{ virtualisation.qemu.diskInterface = "virtio"; }' && ./result/bin/run-nixos-vm
Motivation for this change
boot order was broken in f148c5c and the
vmWithBootloader
ceased to bootThings done
tested
vmWithBootloader
onvirtio
,scsi
andide
diskInterface
valuessandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)