all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH edk2-firmware 2/4] d/{rules,install}: build secureboot-enabled image for aarch64
Date: Wed, 20 May 2026 16:20:33 +0200	[thread overview]
Message-ID: <20260520142044.502304-3-f.ebner@proxmox.com> (raw)
In-Reply-To: <20260520142044.502304-1-f.ebner@proxmox.com>

Previously, a second copy of the CODE image was shipped as
/usr/share/pve-edk2-firmware/aarch64/QEMU_EFI.fd, but this is not
used by qemu-server and it was not yet expanded to 64MiB so it is
wouldn't even have worked with QEMU. Just drop it.

The BUILD_SHELL=FALSE flag is added for completeness. Not including
the shell is already guarded by edk2 commit f881b4d129 ("OvmfPkg: only
add shell to FV in case secure boot is disabled"), but it doesn't hurt
to be explicit and Debian does it too.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 debian/pve-edk2-firmware-aarch64.install |  4 ++--
 debian/rules                             | 14 ++++++++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/debian/pve-edk2-firmware-aarch64.install b/debian/pve-edk2-firmware-aarch64.install
index 22cb9eef27..dea6fc9fb3 100644
--- a/debian/pve-edk2-firmware-aarch64.install
+++ b/debian/pve-edk2-firmware-aarch64.install
@@ -1,2 +1,2 @@
-Build/ArmVirtQemu-AARCH64/RELEASE_*GCC*/FV/QEMU_EFI.fd /usr/share/pve-edk2-firmware/aarch64
-Build/ArmVirtQemu-AARCH64/RELEASE_*GCC*/FV/AAVMF_*.fd /usr/share/pve-edk2-firmware
+debian/aavmf-install/AAVMF_CODE*.fd	/usr/share/pve-edk2-firmware
+debian/aavmf-install/AAVMF_VARS*.fd	/usr/share/pve-edk2-firmware
diff --git a/debian/rules b/debian/rules
index 90a4f6a5cc..8abc6a7d70 100755
--- a/debian/rules
+++ b/debian/rules
@@ -44,6 +44,7 @@ AAVMF_FLAGS  = $(COMMON_FLAGS)
 AAVMF_FLAGS += -DTPM2_ENABLE=TRUE
 AAVMF_FLAGS += -DTPM2_CONFIG_ENABLE=TRUE
 AAVMF_FLAGS += -DCAVIUM_ERRATUM_27456=TRUE
+AAVMF_SECBOOT_FLAGS = $(AAVMF_FLAGS) -DBUILD_SHELL=FALSE -DSECURE_BOOT_ENABLE=TRUE
 
 RISCV64_FLAGS = $(COMMON_FLAGS)
 
@@ -108,7 +109,7 @@ AAVMF_BUILD_DIR = $(AAVMF_BUILD_ROOT)/$(BUILD_TYPE)_$(EDK2_TOOLCHAIN)
 AAVMF_ENROLL    = $(AAVMF_BUILD_DIR)/AARCH64/EnrollDefaultKeys.efi
 AAVMF_SHELL     = $(AAVMF_BUILD_DIR)/AARCH64/Shell.efi
 AAVMF_BINARIES  = $(AAVMF_ENROLL) $(AAVMF_SHELL)
-AAVMF_IMAGES    = $(addprefix $(AAVMF_INSTALL_DIR)/,AAVMF_CODE.fd AAVMF_VARS.fd)
+AAVMF_IMAGES    = $(addprefix $(AAVMF_INSTALL_DIR)/,AAVMF_CODE.fd AAVMF_CODE.secboot.fd AAVMF_VARS.fd)
 AAVMF_PREENROLLED_VARS = $(addprefix $(AAVMF_INSTALL_DIR)/,AAVMF_VARS.ms.fd AAVMF_VARS.snakeoil.fd)
 
 RISCV64_BUILD_ROOT = Build/RiscVVirtQemu
@@ -201,7 +202,7 @@ enroll_snakeoil = virt-fw-vars --input $(1) --output $(2) \
                     --add-db OvmfEnrollDefaultKeys \
                              debian/PkKek-1-snakeoil.pem
 
-%/AAVMF_VARS.ms.fd: %/AAVMF_CODE.fd %/AAVMF_VARS.fd debian/PkKek-1-vendor.pem $(AAVMF_ENROLL) $(AAVMF_SHELL)
+%/AAVMF_VARS.ms.fd: %/AAVMF_CODE.secboot.fd %/AAVMF_VARS.fd debian/PkKek-1-vendor.pem $(AAVMF_ENROLL) $(AAVMF_SHELL)
 	$(call enroll_vendor,$(AAVMF_INSTALL_DIR)/AAVMF_VARS.fd,$@,arm64)
 
 %/AAVMF_VARS.snakeoil.fd: %/AAVMF_CODE.fd %/AAVMF_VARS.fd debian/PkKek-1-snakeoil.pem $(AAVMF_ENROLL) $(AAVMF_SHELL)
@@ -241,6 +242,15 @@ build-qemu-efi: debian/setup-build-stamp
 		$(QEMU_EFI_INSTALL_DIR)/$(FW_NAME)_CODE.fd
 	cp $(QEMU_EFI_BUILD_DIR)/FV/QEMU_VARS.fd \
 		$(QEMU_EFI_INSTALL_DIR)/$(FW_NAME)_VARS.fd
+	rm -rf $(QEMU_EFI_BUILD_ROOT)
+	set -e; . ./edksetup.sh; \
+		build -a $(EDK2_HOST_ARCH) \
+			-t $(EDK2_TOOLCHAIN) \
+			-p ArmVirtPkg/ArmVirtQemu.dsc \
+			$(AAVMF_SECBOOT_FLAGS) -b $(BUILD_TYPE)
+	truncate -s 64M $(QEMU_EFI_BUILD_DIR)/FV/QEMU_EFI.fd
+	cp $(QEMU_EFI_BUILD_DIR)/FV/QEMU_EFI.fd \
+		$(QEMU_EFI_INSTALL_DIR)/$(FW_NAME)_CODE.secboot.fd
 
 build-qemu-efi-aarch64: $(AAVMF_BINARIES) $(AAVMF_IMAGES) $(AAVMF_PREENROLLED_VARS)
 $(AAVMF_BINARIES) $(AAVMF_IMAGES): BaseTools/Bin/GccLto/liblto-aarch64.a
-- 
2.47.3





  parent reply	other threads:[~2026-05-20 14:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20 14:20 [PATCH edk2-firmware/qemu-server/manager 0/4] ovmf: support pre-enrolled-keys for ARM EFI disks Fiona Ebner
2026-05-20 14:20 ` [PATCH edk2-firmware 1/4] d/rules: use dedicated install dir for AAVMF build Fiona Ebner
2026-05-20 14:20 ` Fiona Ebner [this message]
2026-05-20 14:20 ` [PATCH qemu-server 3/4] ovmf: honor pre-enrolled-keys setting for aarch64 Fiona Ebner
2026-05-20 14:20 ` [PATCH manager 4/4] ui: qemu: hardware edit: create EFI disk via asynchronous API Fiona Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260520142044.502304-3-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal