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

fix missing ovmf file for debian image generation #279

Merged
merged 1 commit into from
Dec 2, 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
7 changes: 7 additions & 0 deletions debian/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ ifeq ($(strip $(ARCH)),arm64)
boot = uefi
endif

ifeq ($(wildcard /usr/share/OVMF/OVMF_CODE.fd),)
OVMF_SFX ?= _4M
else
OVMF_SFX ?=
endif

.PHONY: all clean

all: debian
Expand All @@ -47,6 +53,7 @@ debian: check-deps clean
-var debian_series=${SERIES} \
-var debian_version=${VERSION} \
-var architecture=${ARCH} \
-var ovmf_suffix=${OVMF_SFX} \
-var boot_mode=${BOOT} \
-var timeout=${TIMEOUT} .

Expand Down
4 changes: 2 additions & 2 deletions debian/debian-cloudimg.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ source "qemu" "cloudimg" {
["-machine", "${lookup(local.qemu_machine, var.architecture, "")}"],
["-cpu", "${lookup(local.qemu_cpu, var.architecture, "")}"],
["-device", "virtio-gpu-pci"],
["-drive", "if=pflash,format=raw,id=ovmf_code,readonly=on,file=/usr/share/${lookup(local.uefi_imp, var.architecture, "")}/${lookup(local.uefi_imp, var.architecture, "")}_CODE.fd"],
["-drive", "if=pflash,format=raw,id=ovmf_code,readonly=on,file=/usr/share/${lookup(local.uefi_imp, var.architecture, "")}/${lookup(local.uefi_imp, var.architecture, "")}_CODE${var.ovmf_suffix}.fd"],
["-drive", "if=pflash,format=raw,id=ovmf_vars,file=${lookup(local.uefi_imp, var.architecture, "")}_VARS.fd"],
["-drive", "file=output-cloudimg/packer-cloudimg,format=qcow2"],
["-drive", "file=seeds-cloudimg.iso,format=raw"]
Expand All @@ -66,7 +66,7 @@ build {

provisioner "shell-local" {
inline = [
"cp /usr/share/${lookup(local.uefi_imp, var.architecture, "")}/${lookup(local.uefi_imp, var.architecture, "")}_VARS.fd ${lookup(local.uefi_imp, var.architecture, "")}_VARS.fd",
"cp /usr/share/${lookup(local.uefi_imp, var.architecture, "")}/${lookup(local.uefi_imp, var.architecture, "")}_VARS${var.ovmf_suffix}.fd ${lookup(local.uefi_imp, var.architecture, "")}_VARS.fd",
"cloud-localds seeds-cloudimg.iso user-data-cloudimg meta-data"
]
inline_shebang = "/bin/bash -e"
Expand Down
6 changes: 6 additions & 0 deletions debian/debian-cloudimg.variables.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@ variable "architecture" {
default = "amd64"
description = "The architecture to build the image for (amd64 or arm64)"
}

variable "ovmf_suffix" {
type = string
default = ""
description = "Suffix for OVMF CODE and VARS files. Newer systems such as Noble use _4M."
}