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

nixos/proxmox-image: allow building UEFI images #182759

Merged
merged 1 commit into from Nov 21, 2022

Conversation

otopetrik
Copy link
Contributor

Description of changes

Allow building other than Legacy-BIOS-only Proxmox images.
Default remains unchanged.

To build UEFI proxmox image use:
proxmox.qemuConf.bios = "ovmf";
(default is "seabios")

To build image bootable using both "seabios" and "ovmf" use:
diskPartitioning = "hybrid";
BIOS can be switched in Proxmox between "seabios" and "ovmf" and VM still boots.
(GRUB2-only, systemd-boot does not boot under "seabios")

To build systemd-boot UEFI image:
proxmox.qemuConf.bios = "ovmf";
boot.loader.systemd-boot.enable = true;

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@otopetrik
Copy link
Contributor Author

Example flake building different image types: https://github.com/otopetrik/proxmox-nixos-image-build-check

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/1024

Copy link
Member

@RaitoBezarius RaitoBezarius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@otopetrik
Copy link
Contributor Author

Hello @illustris, it looks like you have committed the latest change to this file and authored almost all the changes since this pull request was created.
Could you please merge it or provide feedback ? Thanks.

Copy link
Contributor

@illustris illustris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been trying to find time to do this myself. Thanks! I tried building and booting different combinations of bios and partitionTableType. Looks good.

In addition to the (optional) changes in this review, please mention this change in the release notes.

nixos/modules/virtualisation/proxmox-image.nix Outdated Show resolved Hide resolved
nixos/modules/virtualisation/proxmox-image.nix Outdated Show resolved Hide resolved
@otopetrik
Copy link
Contributor Author

Thanks for the review.
Option renamed to partitionTableType, release notes updated.

Example repository updated to use cloud-init and terraform to check that resulting images are working.

@otopetrik
Copy link
Contributor Author

Hello @SuperSandro2000, it looks like you are the last one to merge a proxmox-image pull request.
Could you please merge this one or provide feedback ? Thanks.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/670

nixos/modules/virtualisation/proxmox-image.nix Outdated Show resolved Hide resolved
nixos/modules/virtualisation/proxmox-image.nix Outdated Show resolved Hide resolved
nixos/modules/virtualisation/proxmox-image.nix Outdated Show resolved Hide resolved
nixos/modules/virtualisation/proxmox-image.nix Outdated Show resolved Hide resolved
Allow building other than Legacy-BIOS-only Proxmox images.
Default is unchanged.

To build UEFI proxmox image use:
  proxmox.qemuConf.bios = "ovmf";
(default is "seabios")

To build image bootable using both "seabios" and "ovmf" use:
  partitionTableType = "hybrid";
BIOS can be switched in Proxmox between "seabios" and "ovmf" and VM still boots.
(GRUB2-only, systemd-boot does not boot under "seabios")

To build systemd-boot UEFI image:
  proxmox.qemuConf.bios = "ovmf";
  boot.loader.systemd-boot.enable = true;
@otopetrik
Copy link
Contributor Author

Changes applied.
Thanks for the review.

@otopetrik
Copy link
Contributor Author

It has been two weeks since the last revision, and no new comments.
I'm assuming that the current version is acceptable.
@SuperSandro2000 could you please merge this pull-request ? Thanks.

@SuperSandro2000 SuperSandro2000 merged commit caf13a5 into NixOS:master Nov 21, 2022
@mweinelt
Copy link
Member

mweinelt commented Nov 30, 2022

Should have received the backport label, since it touched the release notes post branch-off. Caused conflicts.... Backported in #203777.

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

Successfully merging this pull request may close these issues.

None yet

8 participants