Initial commit
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
# Exclude bpm archives
|
||||||
|
*.bpm
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Github repository
|
||||||
|
REPO="tianocore/edk2"
|
||||||
|
|
||||||
|
# Get tag name using Github Rest API
|
||||||
|
TAG_NAME=$(curl -s -L -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/"$REPO"/tags | jq -r '.[].name' | grep 'edk2-stable' | head -n1)
|
||||||
|
|
||||||
|
# Trim prefix
|
||||||
|
VERSION=${TAG_NAME//edk2-stable/}
|
||||||
|
|
||||||
|
echo "$VERSION"
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
name: edk2-ovmf
|
||||||
|
description: EFI Development Kit 2 - Open Virtual Machine Firmware
|
||||||
|
version: "202508.01"
|
||||||
|
revision: 1
|
||||||
|
url: https://github.com/tianocore/tianocore.github.io/wiki/EDK-II
|
||||||
|
license: BSD-2-Clause-Patent,MIT
|
||||||
|
architecture: any
|
||||||
|
type: source
|
||||||
|
make_depends:
|
||||||
|
- acpica
|
||||||
|
- dos2unix
|
||||||
|
- nasm
|
||||||
|
- python3
|
||||||
|
- util-linux
|
||||||
|
downloads:
|
||||||
|
- url: https://github.com/tianocore/edk2/archive/refs/tags/edk2-stable${BPM_PKG_VERSION}.tar.gz
|
||||||
|
extract_to: ${BPM_SOURCE}
|
||||||
|
extract_strip_components: 1
|
||||||
|
checksum: 749b2833ba15bab60ce68f25882c7b9961bbefdfed0903c4d26dba0555763013
|
||||||
|
- url: https://github.com/MIPI-Alliance/public-mipi-sys-t/archive/v1.1+edk2.tar.gz
|
||||||
|
extract_to: ${BPM_SOURCE}/MdePkg/Library/MipiSysTLib/mipisyst
|
||||||
|
extract_strip_components: 1
|
||||||
|
checksum: 473dcd46ed32b098091a2353f0ed13e69cbe773811c5551e6e766c16ac9ba464
|
||||||
|
- url: https://www.openssl.org/source/openssl-3.5.1.tar.gz
|
||||||
|
extract_to: ${BPM_SOURCE}/CryptoPkg/Library/OpensslLib/openssl
|
||||||
|
extract_strip_components: 1
|
||||||
|
checksum: 529043b15cffa5f36077a4d0af83f3de399807181d607441d734196d889b641f
|
||||||
|
- url: https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/mbedtls-3.3.0.tar.gz
|
||||||
|
extract_to: ${BPM_SOURCE}/CryptoPkg/Library/MbedTlsLib/mbedtls
|
||||||
|
extract_strip_components: 1
|
||||||
|
checksum: a22ff38512697b9cd8472faa2ea2d35e320657f6d268def3a64765548b81c3ec
|
||||||
|
- url: https://github.com/DMTF/libspdm/archive/refs/tags/3.6.0.tar.gz
|
||||||
|
extract_to: ${BPM_SOURCE}/SecurityPkg/DeviceSecurity/SpdmLib/libspdm
|
||||||
|
extract_strip_components: 1
|
||||||
|
checksum: dfadf501d23c26041c921974971953a1d4a250ed6cd2679facb781471a5f944c
|
||||||
|
- url: https://github.com/devicetree-org/pylibfdt/archive/refs/tags/v1.7.2.tar.gz
|
||||||
|
extract_to: ${BPM_SOURCE}/MdePkg/Library/BaseFdtLib/libfdt
|
||||||
|
extract_strip_components: 1
|
||||||
|
checksum: a69d41e13bedd43d991ffcd26b914912229b6c7d2022e5f0349a2acf6d65575e
|
||||||
|
- url: https://github.com/google/brotli/archive/refs/tags/v1.1.0.tar.gz
|
||||||
|
filepath: brotli.tar.gz
|
||||||
|
extract_to: ${BPM_SOURCE}/BaseTools/Source/C/BrotliCompress/brotli
|
||||||
|
extract_strip_components: 1
|
||||||
|
checksum: e720a6ca29428b803f4ad165371771f5398faba397edf6778837a18599ea13ff
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"description": "IA32 UEFI for i386, with Secure Boot and SMM, 4MB FD",
|
||||||
|
"interface-types": [
|
||||||
|
"uefi"
|
||||||
|
],
|
||||||
|
"mapping": {
|
||||||
|
"device": "flash",
|
||||||
|
"executable": {
|
||||||
|
"filename": "/usr/share/edk2/ia32/OVMF_CODE.secure.4m.fd",
|
||||||
|
"format": "raw"
|
||||||
|
},
|
||||||
|
"nvram-template": {
|
||||||
|
"filename": "/usr/share/edk2/ia32/OVMF_VARS.4m.fd",
|
||||||
|
"format": "raw"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"architecture": "i386",
|
||||||
|
"machines": [
|
||||||
|
"pc-q35-*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
"acpi-s3",
|
||||||
|
"acpi-s4",
|
||||||
|
"requires-smm",
|
||||||
|
"secure-boot",
|
||||||
|
"verbose-dynamic"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"description": "IA32 UEFI for i386, with Secure Boot and SMM",
|
||||||
|
"interface-types": [
|
||||||
|
"uefi"
|
||||||
|
],
|
||||||
|
"mapping": {
|
||||||
|
"device": "flash",
|
||||||
|
"executable": {
|
||||||
|
"filename": "/usr/share/edk2/ia32/OVMF_CODE.secure.fd",
|
||||||
|
"format": "raw"
|
||||||
|
},
|
||||||
|
"nvram-template": {
|
||||||
|
"filename": "/usr/share/edk2/ia32/OVMF_VARS.fd",
|
||||||
|
"format": "raw"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"architecture": "i386",
|
||||||
|
"machines": [
|
||||||
|
"pc-q35-*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
"acpi-s3",
|
||||||
|
"acpi-s4",
|
||||||
|
"requires-smm",
|
||||||
|
"secure-boot",
|
||||||
|
"verbose-dynamic"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"description": "x64 UEFI for x86_64, with Secure Boot and SMM, 4MB FD",
|
||||||
|
"interface-types": [
|
||||||
|
"uefi"
|
||||||
|
],
|
||||||
|
"mapping": {
|
||||||
|
"device": "flash",
|
||||||
|
"executable": {
|
||||||
|
"filename": "/usr/share/edk2/x64/OVMF_CODE.secure.4m.fd",
|
||||||
|
"format": "raw"
|
||||||
|
},
|
||||||
|
"nvram-template": {
|
||||||
|
"filename": "/usr/share/edk2/x64/OVMF_VARS.4m.fd",
|
||||||
|
"format": "raw"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"architecture": "x86_64",
|
||||||
|
"machines": [
|
||||||
|
"pc-q35-*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
"acpi-s3",
|
||||||
|
"acpi-s4",
|
||||||
|
"amd-sev",
|
||||||
|
"requires-smm",
|
||||||
|
"secure-boot",
|
||||||
|
"verbose-dynamic"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"description": "x64 UEFI for x86_64, with Secure Boot and SMM",
|
||||||
|
"interface-types": [
|
||||||
|
"uefi"
|
||||||
|
],
|
||||||
|
"mapping": {
|
||||||
|
"device": "flash",
|
||||||
|
"executable": {
|
||||||
|
"filename": "/usr/share/edk2/x64/OVMF_CODE.secure.fd",
|
||||||
|
"format": "raw"
|
||||||
|
},
|
||||||
|
"nvram-template": {
|
||||||
|
"filename": "/usr/share/edk2/x64/OVMF_VARS.fd",
|
||||||
|
"format": "raw"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"architecture": "x86_64",
|
||||||
|
"machines": [
|
||||||
|
"pc-q35-*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
"acpi-s3",
|
||||||
|
"acpi-s4",
|
||||||
|
"amd-sev",
|
||||||
|
"requires-smm",
|
||||||
|
"secure-boot",
|
||||||
|
"verbose-dynamic"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"description": "IA32 UEFI for i386, 4MB FD",
|
||||||
|
"interface-types": [
|
||||||
|
"uefi"
|
||||||
|
],
|
||||||
|
"mapping": {
|
||||||
|
"device": "flash",
|
||||||
|
"executable": {
|
||||||
|
"filename": "/usr/share/edk2/ia32/OVMF_CODE.4m.fd",
|
||||||
|
"format": "raw"
|
||||||
|
},
|
||||||
|
"nvram-template": {
|
||||||
|
"filename": "/usr/share/edk2/ia32/OVMF_VARS.4m.fd",
|
||||||
|
"format": "raw"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"architecture": "i386",
|
||||||
|
"machines": [
|
||||||
|
"pc-i440fx-*",
|
||||||
|
"pc-q35-*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
"acpi-s3",
|
||||||
|
"acpi-s4",
|
||||||
|
"verbose-dynamic"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"description": "IA32 UEFI for i386",
|
||||||
|
"interface-types": [
|
||||||
|
"uefi"
|
||||||
|
],
|
||||||
|
"mapping": {
|
||||||
|
"device": "flash",
|
||||||
|
"executable": {
|
||||||
|
"filename": "/usr/share/edk2/ia32/OVMF_CODE.fd",
|
||||||
|
"format": "raw"
|
||||||
|
},
|
||||||
|
"nvram-template": {
|
||||||
|
"filename": "/usr/share/edk2/ia32/OVMF_VARS.fd",
|
||||||
|
"format": "raw"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"architecture": "i386",
|
||||||
|
"machines": [
|
||||||
|
"pc-i440fx-*",
|
||||||
|
"pc-q35-*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
"acpi-s3",
|
||||||
|
"acpi-s4",
|
||||||
|
"verbose-dynamic"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"description": "OVMF for microvm, 4MB FD",
|
||||||
|
"interface-types": [
|
||||||
|
"uefi"
|
||||||
|
],
|
||||||
|
"mapping": {
|
||||||
|
"device": "memory",
|
||||||
|
"filename": "/usr/share/edk2/x64/MICROVM.4m.fd"
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"architecture": "x86_64",
|
||||||
|
"machines": [
|
||||||
|
"microvm"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"description": "OVMF for microvm",
|
||||||
|
"interface-types": [
|
||||||
|
"uefi"
|
||||||
|
],
|
||||||
|
"mapping": {
|
||||||
|
"device": "memory",
|
||||||
|
"filename": "/usr/share/edk2/x64/MICROVM.fd"
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"architecture": "x86_64",
|
||||||
|
"machines": [
|
||||||
|
"microvm"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"description": "x64 UEFI for x86_64, 4MB FD",
|
||||||
|
"interface-types": [
|
||||||
|
"uefi"
|
||||||
|
],
|
||||||
|
"mapping": {
|
||||||
|
"device": "flash",
|
||||||
|
"executable": {
|
||||||
|
"filename": "/usr/share/edk2/x64/OVMF_CODE.4m.fd",
|
||||||
|
"format": "raw"
|
||||||
|
},
|
||||||
|
"nvram-template": {
|
||||||
|
"filename": "/usr/share/edk2/x64/OVMF_VARS.4m.fd",
|
||||||
|
"format": "raw"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"architecture": "x86_64",
|
||||||
|
"machines": [
|
||||||
|
"pc-i440fx-*",
|
||||||
|
"pc-q35-*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
"acpi-s3",
|
||||||
|
"acpi-s4",
|
||||||
|
"amd-sev",
|
||||||
|
"verbose-dynamic"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"description": "x64 UEFI for x86_64",
|
||||||
|
"interface-types": [
|
||||||
|
"uefi"
|
||||||
|
],
|
||||||
|
"mapping": {
|
||||||
|
"device": "flash",
|
||||||
|
"executable": {
|
||||||
|
"filename": "/usr/share/edk2/x64/OVMF_CODE.fd",
|
||||||
|
"format": "raw"
|
||||||
|
},
|
||||||
|
"nvram-template": {
|
||||||
|
"filename": "/usr/share/edk2/x64/OVMF_VARS.fd",
|
||||||
|
"format": "raw"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"architecture": "x86_64",
|
||||||
|
"machines": [
|
||||||
|
"pc-i440fx-*",
|
||||||
|
"pc-q35-*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
"acpi-s3",
|
||||||
|
"acpi-s4",
|
||||||
|
"amd-sev",
|
||||||
|
"verbose-dynamic"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"description": "IA32 UEFI for x86_64, with Secure Boot and SMM, 4MB FD",
|
||||||
|
"interface-types": [
|
||||||
|
"uefi"
|
||||||
|
],
|
||||||
|
"mapping": {
|
||||||
|
"device": "flash",
|
||||||
|
"executable": {
|
||||||
|
"filename": "/usr/share/edk2/ia32/OVMF_CODE.secure.4m.fd",
|
||||||
|
"format": "raw"
|
||||||
|
},
|
||||||
|
"nvram-template": {
|
||||||
|
"filename": "/usr/share/edk2/ia32/OVMF_VARS.4m.fd",
|
||||||
|
"format": "raw"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"architecture": "x86_64",
|
||||||
|
"machines": [
|
||||||
|
"pc-q35-*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
"acpi-s3",
|
||||||
|
"acpi-s4",
|
||||||
|
"requires-smm",
|
||||||
|
"secure-boot",
|
||||||
|
"verbose-dynamic"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"description": "IA32 UEFI for x86_64, with Secure Boot and SMM",
|
||||||
|
"interface-types": [
|
||||||
|
"uefi"
|
||||||
|
],
|
||||||
|
"mapping": {
|
||||||
|
"device": "flash",
|
||||||
|
"executable": {
|
||||||
|
"filename": "/usr/share/edk2/ia32/OVMF_CODE.secure.fd",
|
||||||
|
"format": "raw"
|
||||||
|
},
|
||||||
|
"nvram-template": {
|
||||||
|
"filename": "/usr/share/edk2/ia32/OVMF_VARS.fd",
|
||||||
|
"format": "raw"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"architecture": "x86_64",
|
||||||
|
"machines": [
|
||||||
|
"pc-q35-*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
"acpi-s3",
|
||||||
|
"acpi-s4",
|
||||||
|
"requires-smm",
|
||||||
|
"secure-boot",
|
||||||
|
"verbose-dynamic"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"description": "IA32 UEFI for x86_64, 4MB FD",
|
||||||
|
"interface-types": [
|
||||||
|
"uefi"
|
||||||
|
],
|
||||||
|
"mapping": {
|
||||||
|
"device": "flash",
|
||||||
|
"executable": {
|
||||||
|
"filename": "/usr/share/edk2/ia32/OVMF_CODE.4m.fd",
|
||||||
|
"format": "raw"
|
||||||
|
},
|
||||||
|
"nvram-template": {
|
||||||
|
"filename": "/usr/share/edk2/ia32/OVMF_VARS.4m.fd",
|
||||||
|
"format": "raw"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"architecture": "x86_64",
|
||||||
|
"machines": [
|
||||||
|
"pc-i440fx-*",
|
||||||
|
"pc-q35-*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
"acpi-s3",
|
||||||
|
"acpi-s4",
|
||||||
|
"verbose-dynamic"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"description": "IA32 UEFI for x86_64",
|
||||||
|
"interface-types": [
|
||||||
|
"uefi"
|
||||||
|
],
|
||||||
|
"mapping": {
|
||||||
|
"device": "flash",
|
||||||
|
"executable": {
|
||||||
|
"filename": "/usr/share/edk2/ia32/OVMF_CODE.fd",
|
||||||
|
"format": "raw"
|
||||||
|
},
|
||||||
|
"nvram-template": {
|
||||||
|
"filename": "/usr/share/edk2/ia32/OVMF_VARS.fd",
|
||||||
|
"format": "raw"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"architecture": "x86_64",
|
||||||
|
"machines": [
|
||||||
|
"pc-i440fx-*",
|
||||||
|
"pc-q35-*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
"acpi-s3",
|
||||||
|
"acpi-s4",
|
||||||
|
"verbose-dynamic"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm
|
||||||
|
index 3d64ac9..9c3f01a 100644
|
||||||
|
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm
|
||||||
|
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm
|
||||||
|
@@ -57,7 +57,7 @@ ALIGN 8
|
||||||
|
AsmIdtVectorBegin:
|
||||||
|
%assign Vector 0
|
||||||
|
%rep 256
|
||||||
|
- push strict dword %[Vector] ; This instruction pushes sign-extended 8-byte value on stack
|
||||||
|
+ push strict qword %[Vector] ; This instruction pushes sign-extended 8-byte value on stack
|
||||||
|
push rax
|
||||||
|
%ifdef NO_ABSOLUTE_RELOCS_IN_TEXT
|
||||||
|
mov rax, strict qword 0 ; mov rax, ASM_PFX(CommonInterruptEntry)
|
||||||
|
@@ -70,7 +70,7 @@ AsmIdtVectorBegin:
|
||||||
|
AsmIdtVectorEnd:
|
||||||
|
|
||||||
|
HookAfterStubHeaderBegin:
|
||||||
|
- push strict dword 0 ; 0 will be fixed
|
||||||
|
+ push strict qword 0 ; 0 will be fixed
|
||||||
|
VectorNum:
|
||||||
|
push rax
|
||||||
|
%ifdef NO_ABSOLUTE_RELOCS_IN_TEXT
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package
|
||||||
|
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
|
||||||
|
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
# Re-extract brotli for ShellPkg
|
||||||
|
tar -xvf "$BPM_WORKDIR"/brotli.tar.gz --strip-components=1 -C "$BPM_SOURCE"/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/
|
||||||
|
|
||||||
|
cd "$BPM_SOURCE"
|
||||||
|
# fix 32-bit instruction errors
|
||||||
|
dos2unix "$BPM_SOURCE"/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm
|
||||||
|
patch -Np1 -i "$BPM_WORKDIR"/nasm3.patch
|
||||||
|
}
|
||||||
|
|
||||||
|
# The build function is executed in the source directory
|
||||||
|
# This function is used to compile the source code
|
||||||
|
build() {
|
||||||
|
local _common_args=(-b RELEASE -n $(nproc) -t GCC)
|
||||||
|
local _efi_args=(-D NETWORK_IP6_ENABLE -D TPM_CONFIG_ENABLE -D TPM1_ENABLE -D TPM2_ENABLE)
|
||||||
|
local _x86_args=(-D FD_SIZE_2MB -D HTTP_BOOT_ENABLE -D TLS_ENABLE)
|
||||||
|
local _4mb_args=(-D FD_SIZE_4MB -D FD_SIZE_IN_KB=4096 -D HTTP_BOOT_ENABLE -D TLS_ENABLE)
|
||||||
|
|
||||||
|
make -C BaseTools
|
||||||
|
source edksetup.sh
|
||||||
|
|
||||||
|
for arch in X64 IA32; do
|
||||||
|
BaseTools/BinWrappers/PosixLike/build -p ShellPkg/ShellPkg.dsc -a "$arch" "${_common_args[@]}"
|
||||||
|
done
|
||||||
|
|
||||||
|
# X64 OVMF
|
||||||
|
BaseTools/BinWrappers/PosixLike/build -p "OvmfPkg/OvmfPkgIa32X64.dsc" -a IA32 -a X64 \
|
||||||
|
"${_common_args[@]}" "${_efi_args[@]}" "${_4mb_args[@]}" \
|
||||||
|
-D SECURE_BOOT_ENABLE -D SMM_REQUIRE -D EXCLUDE_SHELL_FROM_FD
|
||||||
|
mv -v Build/Ovmf3264{,-secure-4mb}
|
||||||
|
|
||||||
|
BaseTools/BinWrappers/PosixLike/build -p "OvmfPkg/OvmfPkgIa32X64.dsc" -a IA32 -a X64 \
|
||||||
|
"${_common_args[@]}" "${_efi_args[@]}" "${_x86_args[@]}" \
|
||||||
|
-D SECURE_BOOT_ENABLE -D SMM_REQUIRE -D EXCLUDE_SHELL_FROM_FD
|
||||||
|
mv -v Build/Ovmf3264{,-secure}
|
||||||
|
|
||||||
|
BaseTools/BinWrappers/PosixLike/build -p "OvmfPkg/OvmfPkgX64.dsc" -a X64 "${_common_args[@]}" "${_efi_args[@]}" "${_4mb_args[@]}"
|
||||||
|
mv -v Build/OvmfX64{,-4mb}
|
||||||
|
|
||||||
|
BaseTools/BinWrappers/PosixLike/build -p "OvmfPkg/OvmfPkgX64.dsc" -a X64 "${_common_args[@]}" "${_efi_args[@]}" "${_x86_args[@]}"
|
||||||
|
|
||||||
|
BaseTools/BinWrappers/PosixLike/build -p "OvmfPkg/Microvm/MicrovmX64.dsc" -a X64 "${_common_args[@]}" "${_efi_args[@]}" "${_4mb_args[@]}"
|
||||||
|
mv -v Build/MicrovmX64{,-4mb}
|
||||||
|
|
||||||
|
BaseTools/BinWrappers/PosixLike/build -p "OvmfPkg/Microvm/MicrovmX64.dsc" -a X64 "${_common_args[@]}" "${_efi_args[@]}" "${_x86_args[@]}"
|
||||||
|
|
||||||
|
# IA32 OVMF
|
||||||
|
BaseTools/BinWrappers/PosixLike/build -p "OvmfPkg/OvmfPkgIa32.dsc" -a IA32 \
|
||||||
|
"${_common_args[@]}" "${_efi_args[@]}" "${_4mb_args[@]}" \
|
||||||
|
-D SECURE_BOOT_ENABLE -D SMM_REQUIRE -D EXCLUDE_SHELL_FROM_FD -D LOAD_X64_ON_IA32_ENABLE
|
||||||
|
mv -v Build/Ovmf{Ia32,IA32-secure-4mb}
|
||||||
|
|
||||||
|
BaseTools/BinWrappers/PosixLike/build -p "OvmfPkg/OvmfPkgIa32.dsc" -a IA32 \
|
||||||
|
"${_common_args[@]}" "${_efi_args[@]}" "${_x86_args[@]}" \
|
||||||
|
-D SECURE_BOOT_ENABLE -D SMM_REQUIRE -D EXCLUDE_SHELL_FROM_FD -D LOAD_X64_ON_IA32_ENABLE
|
||||||
|
mv -v Build/Ovmf{Ia32,IA32-secure}
|
||||||
|
|
||||||
|
BaseTools/BinWrappers/PosixLike/build -p "OvmfPkg/OvmfPkgIa32.dsc" -a IA32 \
|
||||||
|
"${_common_args[@]}" "${_efi_args[@]}" "${_4mb_args[@]}" \
|
||||||
|
-D LOAD_X64_ON_IA32_ENABLE
|
||||||
|
mv -v Build/Ovmf{Ia32,IA32-4mb}
|
||||||
|
|
||||||
|
BaseTools/BinWrappers/PosixLike/build -p "OvmfPkg/OvmfPkgIa32.dsc" -a IA32 \
|
||||||
|
"${_common_args[@]}" "${_efi_args[@]}" "${_x86_args[@]}" \
|
||||||
|
-D LOAD_X64_ON_IA32_ENABLE
|
||||||
|
mv -v Build/Ovmf{Ia32,IA32}
|
||||||
|
}
|
||||||
|
|
||||||
|
# The package function is executed in the source directory
|
||||||
|
# This function is used to move the compiled files into the output directory
|
||||||
|
package() {
|
||||||
|
install -d "$BPM_OUTPUT"/usr/share/qemu/firmware
|
||||||
|
install -d "$BPM_OUTPUT"/usr/share/AAVMF
|
||||||
|
|
||||||
|
for arch in X64 IA32; do
|
||||||
|
install -d "$BPM_OUTPUT"/usr/share/edk2/${arch,,}
|
||||||
|
|
||||||
|
install -Dm644 Build/Shell/RELEASE_GCC/${arch}/Shell_7C04A583-9E3E-4f1c-AD65-E05268D0B4D1.efi usr/share/edk2/${arch,,}/Shell.efi
|
||||||
|
install -Dm644 Build/Shell/RELEASE_GCC/${arch}/Shell_EA4BB293-2D7F-4456-A681-1F22F42CD0BC.efi usr/share/edk2/${arch,,}/Shell_Full.efi
|
||||||
|
done
|
||||||
|
|
||||||
|
# X64 OVMF
|
||||||
|
install -Dm644 Build/OvmfX64/RELEASE_GCC/FV/OVMF.fd "$BPM_OUTPUT"/usr/share/edk2/x64
|
||||||
|
install -Dm644 Build/OvmfX64/RELEASE_GCC/FV/OVMF_CODE.fd "$BPM_OUTPUT"/usr/share/edk2/x64
|
||||||
|
install -Dm644 Build/OvmfX64/RELEASE_GCC/FV/OVMF_VARS.fd "$BPM_OUTPUT"/usr/share/edk2/x64
|
||||||
|
install -Dm644 Build/OvmfX64-4mb/RELEASE_GCC/FV/OVMF.fd "$BPM_OUTPUT"/usr/share/edk2/x64/OVMF.4m.fd
|
||||||
|
install -Dm644 Build/OvmfX64-4mb/RELEASE_GCC/FV/OVMF_CODE.fd "$BPM_OUTPUT"/usr/share/edk2/x64/OVMF_CODE.4m.fd
|
||||||
|
install -Dm644 Build/OvmfX64-4mb/RELEASE_GCC/FV/OVMF_VARS.fd "$BPM_OUTPUT"/usr/share/edk2/x64/OVMF_VARS.4m.fd
|
||||||
|
install -Dm644 Build/Ovmf3264-secure/RELEASE_GCC/FV/OVMF_CODE.fd "$BPM_OUTPUT"/usr/share/edk2/x64/OVMF_CODE.secure.fd
|
||||||
|
install -Dm644 Build/Ovmf3264-secure-4mb/RELEASE_GCC/FV/OVMF_CODE.fd "$BPM_OUTPUT"/usr/share/edk2/x64/OVMF_CODE.secure.4m.fd
|
||||||
|
install -Dm644 Build/MicrovmX64/RELEASE_GCC/FV/MICROVM.fd "$BPM_OUTPUT"/usr/share/edk2/x64/MICROVM.fd
|
||||||
|
install -Dm644 Build/MicrovmX64-4mb/RELEASE_GCC/FV/MICROVM.fd "$BPM_OUTPUT"/usr/share/edk2/x64/MICROVM.4m.fd
|
||||||
|
install -Dm644 "$BPM_WORKDIR"/*x86_64*.json -t "$BPM_OUTPUT"/usr/share/qemu/firmware
|
||||||
|
install -Dm644 "$BPM_WORKDIR"/*microvm*.json -t "$BPM_OUTPUT"/usr/share/qemu/firmware
|
||||||
|
|
||||||
|
# IA32 OVMF
|
||||||
|
install -Dm644 Build/OvmfIA32/RELEASE_GCC/FV/OVMF.fd "$BPM_OUTPUT"/usr/share/edk2/ia32
|
||||||
|
install -Dm644 Build/OvmfIA32/RELEASE_GCC/FV/OVMF_CODE.fd "$BPM_OUTPUT"/usr/share/edk2/ia32
|
||||||
|
install -Dm644 Build/OvmfIA32/RELEASE_GCC/FV/OVMF_VARS.fd "$BPM_OUTPUT"/usr/share/edk2/ia32
|
||||||
|
install -Dm644 Build/OvmfIA32-4mb/RELEASE_GCC/FV/OVMF.fd "$BPM_OUTPUT"/usr/share/edk2/ia32/OVMF.4m.fd
|
||||||
|
install -Dm644 Build/OvmfIA32-4mb/RELEASE_GCC/FV/OVMF_CODE.fd "$BPM_OUTPUT"/usr/share/edk2/ia32/OVMF_CODE.4m.fd
|
||||||
|
install -Dm644 Build/OvmfIA32-4mb/RELEASE_GCC/FV/OVMF_VARS.fd "$BPM_OUTPUT"/usr/share/edk2/ia32/OVMF_VARS.4m.fd
|
||||||
|
install -Dm644 Build/OvmfIA32-secure/RELEASE_GCC/FV/OVMF_CODE.fd "$BPM_OUTPUT"/usr/share/edk2/ia32/OVMF_CODE.secure.fd
|
||||||
|
install -Dm644 Build/OvmfIA32-secure-4mb/RELEASE_GCC/FV/OVMF_CODE.fd "$BPM_OUTPUT"/usr/share/edk2/ia32/OVMF_CODE.secure.4m.fd
|
||||||
|
install -Dm644 "$BPM_WORKDIR"/*i386*.json -t "$BPM_OUTPUT"/usr/share/qemu/firmware
|
||||||
|
|
||||||
|
ln -s ./edk2 "$BPM_OUTPUT"/usr/share/OVMF
|
||||||
|
|
||||||
|
# Install package licenses
|
||||||
|
install -Dm644 "$BPM_SOURCE"/License.txt "$BPM_OUTPUT"/usr/share/licenses/edk2-ovmf/License.txt
|
||||||
|
install -Dm644 "$BPM_SOURCE"/OvmfPkg/License.txt "$BPM_OUTPUT"/usr/share/licenses/edk2-ovmf/OvmfPkg-License.txt
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user