Skip to content

Commit

Permalink
OvmfPkg: Make OVMF buildable again
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
miczyg1 committed Nov 26, 2024
1 parent 64af06c commit 15f7619
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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
Expand All @@ -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: |
Expand Down
119 changes: 119 additions & 0 deletions OvmfPkg/Library/QemuParseLib/QemuParseLib.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/** @file
Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
Copyright (c) 2010 The Chromium OS Authors. All rights reserved.<BR>
SPDX-License-Identifier: BSD-3-Clause
**/

#include <Uefi/UefiBaseType.h>
#include <Library/BaseLib.h>
#include <Library/BlParseLib.h>

/**
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;
}
32 changes: 32 additions & 0 deletions OvmfPkg/Library/QemuParseLib/QemuParseLib.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## @file
# Coreboot Table Parse Library.
#
# Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
# 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
2 changes: 1 addition & 1 deletion OvmfPkg/OvmfPkgIa32X64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion OvmfPkg/OvmfPkgX64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf

DasharoVariablesLib|DasharoModulePkg/Library/DasharoVariablesLib/DasharoVariablesLib.inf

BlParseLib|OvmfPkg/Library/QemuParseLib/QemuParseLib.inf

#
# Network libraries
Expand Down

0 comments on commit 15f7619

Please sign in to comment.