Skip to content

Commit

Permalink
debian/rules: Add build-ovmf-csv target to build OVMF.CSV.fd
Browse files Browse the repository at this point in the history
===
Prerequisite:

See the `Prerequisite 1.` in the previous commit's message.

===
Build OVMF.CSV.fd:

Actually, the OVMF.CSV.fd mentioned here is the OVMF.fd mentioned in the
previous commit's message. In order build the OVMF.fd and save it, we
rename it to OVMF.CSV.fd.

When we build the OVMF.CSV.fd which support full-disk encryption, we
should delete stale grub.efi in the source tree:
  $ rm OvmfPkg/AmdSev/Grub/grub.efi
And specify build target:
  $ dpkg-buildpackage -us -uc -b -T build-ovmf-csv

After completion of the build process, the OVMF.CSV.fd will be saved to
debian/ovmf-install/OVMF.CSV.fd.

Signed-off-by: hanliyang <[email protected]>
  • Loading branch information
hanliyang authored and Zeno-sole committed Nov 28, 2024
1 parent 26bf6f0 commit 4f8c878
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,13 @@ debian/setup-build-stamp:
OVMF_INSTALL_DIR = debian/ovmf-install
OVMF64_BUILD_ROOT = Build/OvmfX64
OVMF64_BUILD_DIR = $(OVMF64_BUILD_ROOT)/$(BUILD_TYPE)_$(EDK2_TOOLCHAIN)
OVMF64_BUILD_ROOT_CSV = Build/AmdSev
OVMF64_BUILD_DIR_CSV = $(OVMF64_BUILD_ROOT_CSV)/$(BUILD_TYPE)_$(EDK2_TOOLCHAIN)
OVMF_ENROLL = $(OVMF_INSTALL_DIR)/EnrollDefaultKeys.efi
OVMF_SHELL = $(OVMF_INSTALL_DIR)/Shell.efi
OVMF_BINARIES = $(OVMF_ENROLL) $(OVMF_SHELL)
OVMF_IMAGES := $(addprefix $(OVMF_INSTALL_DIR)/,OVMF_CODE_4M.fd OVMF_CODE_4M.secboot.fd OVMF_VARS_4M.fd)
OVMF_IMAGES_CSV := $(addprefix $(OVMF_INSTALL_DIR)/,OVMF.CSV.fd)
OVMF_PREENROLLED_VARS := $(addprefix $(OVMF_INSTALL_DIR)/,OVMF_VARS_4M.ms.fd OVMF_VARS_4M.snakeoil.fd)

OVMF32_INSTALL_DIR = debian/ovmf32-install
Expand Down Expand Up @@ -154,6 +157,17 @@ $(OVMF_BINARIES) $(OVMF_IMAGES): debian/setup-build-stamp
cp $(OVMF64_BUILD_DIR)/FV/OVMF_CODE.fd \
$(OVMF_INSTALL_DIR)/OVMF_CODE_4M.secboot.fd

build-ovmf-csv: build-ovmf $(OVMF_IMAGES_CSV)
$(OVMF_IMAGES_CSV): debian/setup-build-stamp
rm -f OvmfPkg/AmdSev/Grub/grub.efi
set -e; . ./edksetup.sh; \
build -a X64 \
-t $(EDK2_TOOLCHAIN) \
-p OvmfPkg/AmdSev/AmdSevX64.dsc \
$(OVMF_COMMON_FLAGS) -b $(BUILD_TYPE)
cp $(OVMF64_BUILD_DIR_CSV)/FV/OVMF.fd \
$(OVMF_INSTALL_DIR)/OVMF.CSV.fd

ifeq ($(call dpkg_vendor_derives_from_v1,ubuntu),yes)
debian/PkKek-1-vendor.pem: debian/PkKek-1-Ubuntu.pem
else
Expand Down Expand Up @@ -321,4 +335,4 @@ get-orig-source:
edk2-$(DEB_VERSION_UPSTREAM)
rm -rf edk2.tmp edk2-$(DEB_VERSION_UPSTREAM)

.PHONY: build-ovmf build-ovmf32 build-qemu-efi build-qemu-efi-aarch64 build-qemu-efi-arm build-qemu-efi-riscv64
.PHONY: build-ovmf build-ovmf32 build-qemu-efi build-qemu-efi-aarch64 build-qemu-efi-arm build-qemu-efi-riscv64 build-ovmf-csv

0 comments on commit 4f8c878

Please sign in to comment.