From 15f7619c240d52d1b63db921adb9f03a6b3b4969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=BBygowski?= Date: Tue, 26 Nov 2024 10:15:48 +0100 Subject: [PATCH] OvmfPkg: Make OVMF buildable again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the OVMF build again by copying CbParseLib from DasharoModulePkg and stripping the coreboot specific code. BlParseLib is required by LogoDxe. Signed-off-by: Michał Żygowski --- .github/workflows/build.yml | 8 +- OvmfPkg/Library/QemuParseLib/QemuParseLib.c | 119 ++++++++++++++++++ OvmfPkg/Library/QemuParseLib/QemuParseLib.inf | 32 +++++ OvmfPkg/OvmfPkgIa32X64.dsc | 2 +- OvmfPkg/OvmfPkgX64.dsc | 2 +- 5 files changed, 157 insertions(+), 6 deletions(-) create mode 100644 OvmfPkg/Library/QemuParseLib/QemuParseLib.c create mode 100644 OvmfPkg/Library/QemuParseLib/QemuParseLib.inf diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 97ab29877f..b86b6d4193 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: run: | git clone https://git.ipxe.org/ipxe.git && \ cd ipxe && \ - git checkout 77b07ea4fdc259d7253c6f9df2beda6e6c7a9d85 && \ + git checkout e9a23a5b394f40c1525c40416105eaaa1787f749 && \ sed -i 's|//#define\s*IMAGE_SCRIPT.*|#define IMAGE_SCRIPT|' "src/config/general.h" && \ sed -i 's|.*DOWNLOAD_PROTO_HTTPS|#define DOWNLOAD_PROTO_HTTPS|g' "src/config/general.h" && \ wget https://raw.githubusercontent.com/Dasharo/dasharo-blobs/main/dasharo/dasharo.ipxe && \ @@ -42,14 +42,14 @@ jobs: docker run --rm -i -v $PWD/ipxe:/home/coreboot/ipxe:rw \ -v $PWD/.github:/home/coreboot/ipxe/.github \ -u $(id -u):$(id -g) -w /home/coreboot/ipxe \ - coreboot/coreboot-sdk:2021-09-23_b0d87f753c \ + coreboot/coreboot-sdk:2024-02-18_732134932b \ ./.github/scripts/build-ipxe.sh - name: Build OVMF Firmware Image run: | docker run --rm -i -v $PWD:/home/coreboot/coreboot:rw \ -u $(id -u):$(id -g) -w /home/coreboot/coreboot \ - coreboot/coreboot-sdk:2021-09-23_b0d87f753c \ + coreboot/coreboot-sdk:2024-02-18_732134932b \ ./.github/scripts/build-qemu.sh - name: Check RELEASE build Artifacts @@ -75,7 +75,7 @@ jobs: fi - name: Upload Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ovmf-artifacts # Name for the artifact path: | diff --git a/OvmfPkg/Library/QemuParseLib/QemuParseLib.c b/OvmfPkg/Library/QemuParseLib/QemuParseLib.c new file mode 100644 index 0000000000..c09524d040 --- /dev/null +++ b/OvmfPkg/Library/QemuParseLib/QemuParseLib.c @@ -0,0 +1,119 @@ +/** @file + Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + + Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+ SPDX-License-Identifier: BSD-3-Clause +**/ + +#include +#include +#include + +/** + Find the SMM store information + + @param SMMSTOREInfo Pointer to the SMMSTORE_INFO structure + + @retval RETURN_SUCCESS Successfully find the SMM store buffer information. + @retval RETURN_NOT_FOUND Failed to find the SMM store buffer information . + +**/ +RETURN_STATUS +EFIAPI +ParseSMMSTOREInfo ( + OUT SMMSTORE_INFO *SMMSTOREInfo + ) +{ + return RETURN_UNSUPPORTED; +} + +/** + Find the Tcg Physical Presence store information + + @param PPIInfo Pointer to the TCG_PHYSICAL_PRESENCE_INFO structure + + @retval RETURN_SUCCESS Successfully find the SMM store buffer information. + @retval RETURN_NOT_FOUND Failed to find the SMM store buffer information . + +**/ +RETURN_STATUS +EFIAPI +ParseTPMPPIInfo ( + OUT TCG_PHYSICAL_PRESENCE_INFO *PPIInfo + ) +{ + return RETURN_UNSUPPORTED; +} + +/** + Acquire Vboot recovery information from coreboot + + @param RecoveryCode Recovery reason code, zero if not in recovery mode. + @param RecoveryReason Why are we in recovery boot as a string. + + @retval RETURN_SUCCESS Successfully found VBoot data. + @retval RETURN_NOT_FOUND Failed to find VBoot data. + +**/ +RETURN_STATUS +EFIAPI +ParseVBootWorkbuf ( + OUT UINT8 *RecoveryCode, + OUT CONST CHAR8 **RecoveryReason + ) +{ + return RETURN_UNSUPPORTED; +} + +/** + Parse the coreboot timestamps + + @retval RETURN_SUCCESS Successfully find the timestamps information. + @retval RETURN_NOT_FOUND Failed to find the tiemstamps information . + +**/ +RETURN_STATUS +EFIAPI +ParseTimestampTable ( + OUT FIRMWARE_SEC_PERFORMANCE *Performance + ) +{ + return RETURN_UNSUPPORTED; +} + +/** + Parse update capsules passed in by coreboot + + @param CapsuleCallback The callback routine invoked for each capsule. + + @retval RETURN_SUCCESS Successfully parsed capsules. + @retval RETURN_NOT_FOUND coreboot table is missing. +**/ +RETURN_STATUS +EFIAPI +ParseCapsules ( + IN BL_CAPSULE_CALLBACK CapsuleCallback + ) +{ + return RETURN_UNSUPPORTED; +} + +/** + Acquire boot logo from coreboot + + @param BmpAddress Pointer to the bitmap file + @param BmpSize Size of the image + + @retval RETURN_SUCCESS Successfully find the boot logo. + @retval RETURN_NOT_FOUND Failed to find the boot logo. +**/ +RETURN_STATUS +EFIAPI +ParseBootLogo ( + OUT UINT64 *BmpAddress, + OUT UINT32 *BmpSize + ) +{ + return RETURN_UNSUPPORTED; +} diff --git a/OvmfPkg/Library/QemuParseLib/QemuParseLib.inf b/OvmfPkg/Library/QemuParseLib/QemuParseLib.inf new file mode 100644 index 0000000000..a6d6f14fb8 --- /dev/null +++ b/OvmfPkg/Library/QemuParseLib/QemuParseLib.inf @@ -0,0 +1,32 @@ +## @file +# Coreboot Table Parse Library. +# +# Copyright (c) 2014, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = QemuParseLib + FILE_GUID = 49EDFC9E-5945-4386-9C0B-C9B60CD45BB1 + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = BlParseLib + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 +# + +[Sources] + QemuParseLib.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + DasharoPayloadPkg/DasharoPayloadPkg.dec + +[LibraryClasses] + BaseLib diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 5e9eee628a..1b04a902ff 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -231,7 +231,7 @@ VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf - + BlParseLib|OvmfPkg/Library/QemuParseLib/QemuParseLib.inf # # Network libraries diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 7051477712..3710af15a0 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -274,7 +274,7 @@ VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf DasharoVariablesLib|DasharoModulePkg/Library/DasharoVariablesLib/DasharoVariablesLib.inf - + BlParseLib|OvmfPkg/Library/QemuParseLib/QemuParseLib.inf # # Network libraries