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

Add efi_format options to efi_config #272

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .web-docs/components/builder/clone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ Usage example (JSON):
{
"efi_storage_pool": "local",
"pre_enrolled_keys": true,
"efi_format": "raw",
"efi_type": "4m"
}

Expand All @@ -786,6 +787,10 @@ Usage example (JSON):

- `efi_storage_pool` (string) - Name of the Proxmox storage pool to store the EFI disk on.

- `efi_format` (string) - The format of the file backing the disk. Can be
`raw`, `cow`, `qcow`, `qed`, `qcow2`, `vmdk` or `cloop`. Defaults to
`raw`.

- `pre_enrolled_keys` (bool) - Whether Microsoft Standard Secure Boot keys should be pre-loaded on
the EFI disk. Defaults to `false`.

Expand Down
5 changes: 5 additions & 0 deletions .web-docs/components/builder/iso/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ Usage example (JSON):
{
"efi_storage_pool": "local",
"pre_enrolled_keys": true,
"efi_format": "raw",
"efi_type": "4m"
}

Expand All @@ -700,6 +701,10 @@ Usage example (JSON):

- `efi_storage_pool` (string) - Name of the Proxmox storage pool to store the EFI disk on.

- `efi_format` (string) - The format of the file backing the disk. Can be
`raw`, `cow`, `qcow`, `qed`, `qcow2`, `vmdk` or `cloop`. Defaults to
`raw`.

- `pre_enrolled_keys` (bool) - Whether Microsoft Standard Secure Boot keys should be pre-loaded on
the EFI disk. Defaults to `false`.

Expand Down
5 changes: 5 additions & 0 deletions builder/proxmox/common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,13 +361,18 @@ type diskConfig struct {
// {
// "efi_storage_pool": "local",
// "pre_enrolled_keys": true,
// "efi_format": "raw",
// "efi_type": "4m"
// }
//
// ```
type efiConfig struct {
// Name of the Proxmox storage pool to store the EFI disk on.
EFIStoragePool string `mapstructure:"efi_storage_pool"`
// The format of the file backing the disk. Can be
// `raw`, `cow`, `qcow`, `qed`, `qcow2`, `vmdk` or `cloop`. Defaults to
// `raw`.
EFIFormat string `mapstructure:"efi_format"`
// Whether Microsoft Standard Secure Boot keys should be pre-loaded on
// the EFI disk. Defaults to `false`.
PreEnrolledKeys bool `mapstructure:"pre_enrolled_keys"`
Expand Down
2 changes: 2 additions & 0 deletions builder/proxmox/common/config.hcl2spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions builder/proxmox/common/step_start_vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ func generateProxmoxEfi(efi efiConfig) proxmox.QemuDevice {
dev := make(proxmox.QemuDevice)
setDeviceParamIfDefined(dev, "storage", efi.EFIStoragePool)
setDeviceParamIfDefined(dev, "efitype", efi.EFIType)
setDeviceParamIfDefined(dev, "format", efi.EFIFormat)
// efi.PreEnrolledKeys can be false, but we only want to set pre-enrolled-keys=0
// when other EFI options are set.
if len(dev) > 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

- `efi_storage_pool` (string) - Name of the Proxmox storage pool to store the EFI disk on.

- `efi_format` (string) - The format of the file backing the disk. Can be
`raw`, `cow`, `qcow`, `qed`, `qcow2`, `vmdk` or `cloop`. Defaults to
`raw`.

- `pre_enrolled_keys` (bool) - Whether Microsoft Standard Secure Boot keys should be pre-loaded on
the EFI disk. Defaults to `false`.

Expand Down
1 change: 1 addition & 0 deletions docs-partials/builder/proxmox/common/efiConfig.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Usage example (JSON):
{
"efi_storage_pool": "local",
"pre_enrolled_keys": true,
"efi_format": "raw",
"efi_type": "4m"
}

Expand Down