From 9de112cd09018f1c06b16ed427147d04da366512 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Mon, 27 Nov 2023 00:47:57 -0500 Subject: [PATCH] New package: edk2-ovmf-202311 --- .../files/50-edk2-ovmf-i386-secure-4m.json | 35 +++ .../files/50-edk2-ovmf-i386-secure.json | 35 +++ .../files/50-edk2-ovmf-x86_64-secure-4m.json | 36 +++ .../files/50-edk2-ovmf-x86_64-secure.json | 36 +++ .../edk2-ovmf/files/60-edk2-ovmf-aarch64.json | 31 +++ srcpkgs/edk2-ovmf/files/60-edk2-ovmf-arm.json | 31 +++ .../edk2-ovmf/files/60-edk2-ovmf-i386-4m.json | 34 +++ .../edk2-ovmf/files/60-edk2-ovmf-i386.json | 34 +++ .../files/60-edk2-ovmf-microvm-4m.json | 22 ++ .../edk2-ovmf/files/60-edk2-ovmf-microvm.json | 22 ++ .../files/60-edk2-ovmf-x86_64-4m.json | 35 +++ .../edk2-ovmf/files/60-edk2-ovmf-x86_64.json | 35 +++ ...80-edk2-ovmf-ia32-on-x86_64-secure-4m.json | 35 +++ .../80-edk2-ovmf-ia32-on-x86_64-secure.json | 35 +++ .../files/81-edk2-ovmf-ia32-on-x86_64-4m.json | 34 +++ .../files/81-edk2-ovmf-ia32-on-x86_64.json | 34 +++ srcpkgs/edk2-ovmf/patches/brotli.patch | 92 +++++++ srcpkgs/edk2-ovmf/template | 227 ++++++++++++++++++ srcpkgs/edk2-ovmf/update | 2 + srcpkgs/edk2-shell | 1 + 20 files changed, 846 insertions(+) create mode 100644 srcpkgs/edk2-ovmf/files/50-edk2-ovmf-i386-secure-4m.json create mode 100644 srcpkgs/edk2-ovmf/files/50-edk2-ovmf-i386-secure.json create mode 100644 srcpkgs/edk2-ovmf/files/50-edk2-ovmf-x86_64-secure-4m.json create mode 100644 srcpkgs/edk2-ovmf/files/50-edk2-ovmf-x86_64-secure.json create mode 100644 srcpkgs/edk2-ovmf/files/60-edk2-ovmf-aarch64.json create mode 100644 srcpkgs/edk2-ovmf/files/60-edk2-ovmf-arm.json create mode 100644 srcpkgs/edk2-ovmf/files/60-edk2-ovmf-i386-4m.json create mode 100644 srcpkgs/edk2-ovmf/files/60-edk2-ovmf-i386.json create mode 100644 srcpkgs/edk2-ovmf/files/60-edk2-ovmf-microvm-4m.json create mode 100644 srcpkgs/edk2-ovmf/files/60-edk2-ovmf-microvm.json create mode 100644 srcpkgs/edk2-ovmf/files/60-edk2-ovmf-x86_64-4m.json create mode 100644 srcpkgs/edk2-ovmf/files/60-edk2-ovmf-x86_64.json create mode 100644 srcpkgs/edk2-ovmf/files/80-edk2-ovmf-ia32-on-x86_64-secure-4m.json create mode 100644 srcpkgs/edk2-ovmf/files/80-edk2-ovmf-ia32-on-x86_64-secure.json create mode 100644 srcpkgs/edk2-ovmf/files/81-edk2-ovmf-ia32-on-x86_64-4m.json create mode 100644 srcpkgs/edk2-ovmf/files/81-edk2-ovmf-ia32-on-x86_64.json create mode 100644 srcpkgs/edk2-ovmf/patches/brotli.patch create mode 100644 srcpkgs/edk2-ovmf/template create mode 100644 srcpkgs/edk2-ovmf/update create mode 120000 srcpkgs/edk2-shell diff --git a/srcpkgs/edk2-ovmf/files/50-edk2-ovmf-i386-secure-4m.json b/srcpkgs/edk2-ovmf/files/50-edk2-ovmf-i386-secure-4m.json new file mode 100644 index 00000000000..f556449645a --- /dev/null +++ b/srcpkgs/edk2-ovmf/files/50-edk2-ovmf-i386-secure-4m.json @@ -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": [ + + ] +} diff --git a/srcpkgs/edk2-ovmf/files/50-edk2-ovmf-i386-secure.json b/srcpkgs/edk2-ovmf/files/50-edk2-ovmf-i386-secure.json new file mode 100644 index 00000000000..fd244f0e01c --- /dev/null +++ b/srcpkgs/edk2-ovmf/files/50-edk2-ovmf-i386-secure.json @@ -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": [ + + ] +} diff --git a/srcpkgs/edk2-ovmf/files/50-edk2-ovmf-x86_64-secure-4m.json b/srcpkgs/edk2-ovmf/files/50-edk2-ovmf-x86_64-secure-4m.json new file mode 100644 index 00000000000..d1678cb4fe2 --- /dev/null +++ b/srcpkgs/edk2-ovmf/files/50-edk2-ovmf-x86_64-secure-4m.json @@ -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": [ + + ] +} diff --git a/srcpkgs/edk2-ovmf/files/50-edk2-ovmf-x86_64-secure.json b/srcpkgs/edk2-ovmf/files/50-edk2-ovmf-x86_64-secure.json new file mode 100644 index 00000000000..5adc4db7fb4 --- /dev/null +++ b/srcpkgs/edk2-ovmf/files/50-edk2-ovmf-x86_64-secure.json @@ -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": [ + + ] +} diff --git a/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-aarch64.json b/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-aarch64.json new file mode 100644 index 00000000000..b95bdc8c964 --- /dev/null +++ b/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-aarch64.json @@ -0,0 +1,31 @@ +{ + "description": "AA64 UEFI for aarch64", + "interface-types": [ + "uefi" + ], + "mapping": { + "device": "flash", + "executable": { + "filename": "/usr/share/edk2/aarch64/QEMU_CODE.fd", + "format": "raw" + }, + "nvram-template": { + "filename": "/usr/share/edk2/aarch64/QEMU_VARS.fd", + "format": "raw" + } + }, + "targets": [ + { + "architecture": "aarch64", + "machines": [ + "virt-*" + ] + } + ], + "features": [ + "verbose-static" + ], + "tags": [ + + ] +} diff --git a/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-arm.json b/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-arm.json new file mode 100644 index 00000000000..f7006a2254a --- /dev/null +++ b/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-arm.json @@ -0,0 +1,31 @@ +{ + "description": "ARM UEFI for armv7", + "interface-types": [ + "uefi" + ], + "mapping": { + "device": "flash", + "executable": { + "filename": "/usr/share/edk2/arm/QEMU_CODE.fd", + "format": "raw" + }, + "nvram-template": { + "filename": "/usr/share/edk2/arm/QEMU_VARS.fd", + "format": "raw" + } + }, + "targets": [ + { + "architecture": "arm", + "machines": [ + "virt-*" + ] + } + ], + "features": [ + "verbose-static" + ], + "tags": [ + + ] +} diff --git a/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-i386-4m.json b/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-i386-4m.json new file mode 100644 index 00000000000..2a070767f6a --- /dev/null +++ b/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-i386-4m.json @@ -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": [ + + ] +} diff --git a/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-i386.json b/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-i386.json new file mode 100644 index 00000000000..18cb255a320 --- /dev/null +++ b/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-i386.json @@ -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": [ + + ] +} diff --git a/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-microvm-4m.json b/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-microvm-4m.json new file mode 100644 index 00000000000..1639f336f17 --- /dev/null +++ b/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-microvm-4m.json @@ -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": [ + ] +} diff --git a/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-microvm.json b/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-microvm.json new file mode 100644 index 00000000000..78b900eb564 --- /dev/null +++ b/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-microvm.json @@ -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": [ + ] +} diff --git a/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-x86_64-4m.json b/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-x86_64-4m.json new file mode 100644 index 00000000000..fe8e2639b1c --- /dev/null +++ b/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-x86_64-4m.json @@ -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": [ + + ] +} diff --git a/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-x86_64.json b/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-x86_64.json new file mode 100644 index 00000000000..ca02ef0831b --- /dev/null +++ b/srcpkgs/edk2-ovmf/files/60-edk2-ovmf-x86_64.json @@ -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": [ + + ] +} diff --git a/srcpkgs/edk2-ovmf/files/80-edk2-ovmf-ia32-on-x86_64-secure-4m.json b/srcpkgs/edk2-ovmf/files/80-edk2-ovmf-ia32-on-x86_64-secure-4m.json new file mode 100644 index 00000000000..63a827684c0 --- /dev/null +++ b/srcpkgs/edk2-ovmf/files/80-edk2-ovmf-ia32-on-x86_64-secure-4m.json @@ -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": [ + + ] +} diff --git a/srcpkgs/edk2-ovmf/files/80-edk2-ovmf-ia32-on-x86_64-secure.json b/srcpkgs/edk2-ovmf/files/80-edk2-ovmf-ia32-on-x86_64-secure.json new file mode 100644 index 00000000000..6d28f397151 --- /dev/null +++ b/srcpkgs/edk2-ovmf/files/80-edk2-ovmf-ia32-on-x86_64-secure.json @@ -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": [ + + ] +} diff --git a/srcpkgs/edk2-ovmf/files/81-edk2-ovmf-ia32-on-x86_64-4m.json b/srcpkgs/edk2-ovmf/files/81-edk2-ovmf-ia32-on-x86_64-4m.json new file mode 100644 index 00000000000..d871ed1c566 --- /dev/null +++ b/srcpkgs/edk2-ovmf/files/81-edk2-ovmf-ia32-on-x86_64-4m.json @@ -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": [ + + ] +} diff --git a/srcpkgs/edk2-ovmf/files/81-edk2-ovmf-ia32-on-x86_64.json b/srcpkgs/edk2-ovmf/files/81-edk2-ovmf-ia32-on-x86_64.json new file mode 100644 index 00000000000..3d7532ef04c --- /dev/null +++ b/srcpkgs/edk2-ovmf/files/81-edk2-ovmf-ia32-on-x86_64.json @@ -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": [ + + ] +} diff --git a/srcpkgs/edk2-ovmf/patches/brotli.patch b/srcpkgs/edk2-ovmf/patches/brotli.patch new file mode 100644 index 00000000000..b7a58023251 --- /dev/null +++ b/srcpkgs/edk2-ovmf/patches/brotli.patch @@ -0,0 +1,92 @@ +From dca56cf4d28bbbb1d3be029ce9a6710cb3f6cd2f Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Thu, 4 Jun 2020 13:34:12 +0200 +Subject: BaseTools: do not build BrotliCompress (RH only) + +Notes about the RHEL-8.3/20200603-ca407c7246bf [edk2-stable202005] -> +RHEL-8.5/20210520-e1999b264f1f [edk2-stable202105] rebase: + +- no change + +Notes about the RHEL-8.2/20190904-37eef91017ad [edk2-stable201908] -> +RHEL-8.3/20200603-ca407c7246bf [edk2-stable202005] rebase: + +- New patch. + +BrotliCompress is not used for building ArmVirtPkg or OvmfPkg platforms. +It depends on one of the upstream Brotli git submodules that we removed +earlier in this rebase series. (See patch "remove upstream edk2's Brotli +submodules (RH only"). + +Do not attempt to build BrotliCompress. + +Signed-off-by: Laszlo Ersek +(cherry picked from commit db8ccca337e2c5722c1d408d2541cf653d3371a2) +--- + BaseTools/Source/C/GNUmakefile | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/BaseTools/Source/C/GNUmakefile b/BaseTools/Source/C/GNUmakefile +index 8c191e0c38..3eae824a1c 100644 +--- a/BaseTools/Source/C/GNUmakefile ++++ b/BaseTools/Source/C/GNUmakefile +@@ -48,7 +48,6 @@ all: makerootdir subdirs + LIBRARIES = Common + VFRAUTOGEN = VfrCompile/VfrLexer.h + APPLICATIONS = \ +- BrotliCompress \ + VfrCompile \ + EfiRom \ + GenFfs \ +-- +2.27.0 + +From 9729dd1d6b83961d531e29777d0cc4a610b108be Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Thu, 4 Jun 2020 13:39:08 +0200 +Subject: MdeModulePkg: remove package-private Brotli include path (RH only) + +Notes about the RHEL-8.3/20200603-ca407c7246bf [edk2-stable202005] -> +RHEL-8.5/20210520-e1999b264f1f [edk2-stable202105] rebase: + +- no change + +Notes about the RHEL-8.2/20190904-37eef91017ad [edk2-stable201908] -> +RHEL-8.3/20200603-ca407c7246bf [edk2-stable202005] rebase: + +- New patch. + +Originating from upstream commit 58802e02c41b +("MdeModulePkg/BrotliCustomDecompressLib: Make brotli a submodule", +2020-04-16), "MdeModulePkg/MdeModulePkg.dec" contains a package-internal +include path into a Brotli submodule. + +The edk2 build system requires such include paths to resolve successfully, +regardless of the firmware platform being built. Because +BrotliCustomDecompressLib is not consumed by any OvmfPkg or ArmVirtPkg +platforms, and we've removed the submodule earlier in this patch set, +remove the include path too. + +Signed-off-by: Laszlo Ersek +(cherry picked from commit e05e0de713c4a2b8adb6ff9809611f222bfe50ed) +--- + MdeModulePkg/MdeModulePkg.dec | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec +index 8d38383915..ba2d0290e7 100644 +--- a/MdeModulePkg/MdeModulePkg.dec ++++ b/MdeModulePkg/MdeModulePkg.dec +@@ -24,9 +24,6 @@ + [Includes] + Include + +-[Includes.Common.Private] +- Library/BrotliCustomDecompressLib/brotli/c/include +- + [LibraryClasses] + ## @libraryclass Defines a set of methods to reset whole system. + ResetSystemLib|Include/Library/ResetSystemLib.h +-- +2.27.0 + diff --git a/srcpkgs/edk2-ovmf/template b/srcpkgs/edk2-ovmf/template new file mode 100644 index 00000000000..3109841814f --- /dev/null +++ b/srcpkgs/edk2-ovmf/template @@ -0,0 +1,227 @@ +# Template file for 'edk2-ovmf' +pkgname=edk2-ovmf +version=202311 +revision=1 +_mipi_commit=370b5944c046bab043dd8b133727b2135af7747a +_openssl_version=3.0.9 +_mbedtls_commit=8c89224991adff88d53cd380f42a2baa36f91454 +_softfloat_commit=b64af41c3276f97f0e181920400ee056b9c88037 +hostmakedepends="acpica-utils nasm python3 cross-arm-none-eabi-gcc" +makedepends="libuuid-devel" +short_desc="EFI Development Kit II - Open Virtual Machine Firmware" +maintainer="classabbyamp " +license="BSD-2-Clause-Patent, MIT" +homepage="https://github.com/tianocore/tianocore.github.io/wiki/EDK-II" +changelog="https://github.com/tianocore/edk2/releases" +distfiles="https://github.com/tianocore/edk2/archive/refs/tags/edk2-stable${version}.tar.gz + https://github.com/MIPI-Alliance/public-mipi-sys-t/archive/${_mipi_commit}.tar.gz + https://www.openssl.org/source/openssl-${_openssl_version}.tar.gz + https://github.com/Mbed-TLS/mbedtls/archive/${_mbedtls_commit}.tar.gz + https://github.com/ucb-bar/berkeley-softfloat-3/archive/${_softfloat_commit}.tar.gz" +checksum="d26258942e9fb166488df029fdb0b1e60729329a9efb2da49fe4c5e9e1e354ee + 9fda3b9a78343ab2be6f06ce6396536e7e065abac29b47c8eb2e42cbb4c4f00b + eb1ab04781474360f77c318ab89d8c5a03abc38e63d65a603cabbf1b00a1dc90 + b5c7e7c54e013c168f4aae036e59912785f11b4aeebd57f6165a14e879b9a82c + faae889814ea6a292f7ca03d9b36e6c7e95bab2a64777804883cc822b8d48757" +skip_extraction="${_mipi_commit}.tar.gz + openssl-${_openssl_version}.tar.gz + ${_mbedtls_commit}.tar.gz + ${_softfloat_commit}.tar.gz" +nocross="probably possible, but complex" + +case "$XBPS_TARGET_LIBC" in + glibc) + hostmakedepends+=" cross-aarch64-linux-gnu" + _pfx="gnu" + ;; + musl) + hostmakedepends+=" cross-aarch64-linux-musl" + _pfx="musl" + ;; +esac + +case "$XBPS_MACHINE" in + x86_64*) _archs=(X64 IA32 AARCH64 ARM) ;; + i686*) _archs=(IA32 AARCH64 ARM) ;; +esac + +post_extract() { + vsrcextract -C MdePkg/Library/MipiSysTLib/mipisyst "${_mipi_commit}.tar.gz" + vsrcextract -C CryptoPkg/Library/OpensslLib/openssl "openssl-${_openssl_version}.tar.gz" + vsrcextract -C CryptoPkg/Library/MbedTlsLib/mbedtls "${_mbedtls_commit}.tar.gz" + vsrcextract -C ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 "${_softfloat_commit}.tar.gz" +} + +do_build() { + local PATH="BaseTools/BinWrappers/PosixLike:$PATH" + local _common_args=(-b RELEASE -n "$XBPS_MAKEJOBS" -t GCC5) + 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) + + export GCC5_AARCH64_PREFIX="aarch64-linux-${_pfx}-" + export GCC5_ARM_PREFIX="arm-none-eabi-" + + for _arch in "" AARCH64 ARM; do + ARCH="$_arch" make "${makejobs}" -C BaseTools + done + . edksetup.sh + + for _arch in "${_archs[@]}"; do + msg_normal "$pkgver: building shell ($_arch)\n" + build -p ShellPkg/ShellPkg.dsc -a "$_arch" "${_common_args[@]}" + + case "${_arch}" in + X64) + msg_normal "$pkgver: building ovmf ($_arch) with secure boot support (4MB FD)\n" + build -p "OvmfPkg/OvmfPkgIa32X64.dsc" -a IA32 -a "$_arch" \ + "${_common_args[@]}" "${_efi_args[@]}" "${_4mb_args[@]}" \ + -D SECURE_BOOT_ENABLE -D SMM_REQUIRE -D EXCLUDE_SHELL_FROM_FD + mv -v Build/Ovmf3264{,-secure-4mb} + + msg_normal "$pkgver: building ovmf ($_arch) with secure boot support\n" + build -p "OvmfPkg/OvmfPkgIa32X64.dsc" -a IA32 -a "$_arch" \ + "${_common_args[@]}" "${_efi_args[@]}" "${_x86_args[@]}" \ + -D SECURE_BOOT_ENABLE -D SMM_REQUIRE -D EXCLUDE_SHELL_FROM_FD + mv -v Build/Ovmf3264{,-secure} + + msg_normal "$pkgver: building ovmf ($_arch) default (4MB FD)\n" + build -p "OvmfPkg/OvmfPkg${_arch}.dsc" -a "$_arch" \ + "${_common_args[@]}" "${_efi_args[@]}" "${_4mb_args[@]}" + mv -v Build/OvmfX64{,-4mb} + + msg_normal "$pkgver: building ovmf ($_arch) default\n" + build -p "OvmfPkg/OvmfPkg${_arch}.dsc" -a "$_arch" \ + "${_common_args[@]}" "${_efi_args[@]}" "${_x86_args[@]}" + + msg_normal "$pkgver: building ovmf ($_arch) with microvm support (4MB FD)\n" + build -p "OvmfPkg/Microvm/Microvm${_arch}.dsc" -a "$_arch" \ + "${_common_args[@]}" "${_efi_args[@]}" "${_4mb_args[@]}" + mv -v Build/MicrovmX64{,-4mb} + + msg_normal "$pkgver: building ovmf ($_arch) with microvm support\n" + build -p "OvmfPkg/Microvm/Microvm${_arch}.dsc" -a "$_arch" \ + "${_common_args[@]}" "${_efi_args[@]}" "${_x86_args[@]}" + ;; + IA32) + msg_normal "$pkgver: building ovmf ($_arch) with secure boot support (4MB FD)\n" + build -p "OvmfPkg/OvmfPkgIa32.dsc" -a "$_arch" \ + "${_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} + + msg_normal "$pkgver: building ovmf ($_arch) with secure boot support\n" + build -p "OvmfPkg/OvmfPkgIa32.dsc" -a "$_arch" \ + "${_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} + + msg_normal "$pkgver: building ovmf ($_arch) default (4MB FD)\n" + build -p "OvmfPkg/OvmfPkgIa32.dsc" -a "$_arch" \ + "${_common_args[@]}" "${_efi_args[@]}" "${_4mb_args[@]}" \ + -D LOAD_X64_ON_IA32_ENABLE + mv -v Build/Ovmf{Ia32,IA32-4mb} + + msg_normal "$pkgver: building ovmf ($_arch) default\n" + build -p "OvmfPkg/OvmfPkgIa32.dsc" -a "$_arch" \ + "${_common_args[@]}" "${_efi_args[@]}" "${_x86_args[@]}" \ + -D LOAD_X64_ON_IA32_ENABLE + mv -v Build/Ovmf{Ia32,IA32} + ;; + A*) + msg_normal "Building ArmVirtPkg ($_arch) with secure boot\n" + build -p "ArmVirtPkg/ArmVirtQemu.dsc" -a "${_arch}" \ + "${_common_args[@]}" "${_efi_args[@]}" \ + -D NETWORK_HTTP_BOOT_ENABLE -D NETWORK_TLS_ENABLE -D SECURE_BOOT_ENABLE + + dd if=/dev/zero of="Build/ArmVirtQemu-$_arch/RELEASE_GCC5/FV/QEMU_CODE.fd" bs=1M count=64 + dd if="Build/ArmVirtQemu-$_arch/RELEASE_GCC5/FV/QEMU_EFI.fd" \ + of="Build/ArmVirtQemu-$_arch/RELEASE_GCC5/FV/QEMU_CODE.fd" conv=notrunc + dd if=/dev/zero of="Build/ArmVirtQemu-$_arch/RELEASE_GCC5/FV/QEMU_VARS.fd" bs=1M count=64 + ;; + esac + done +} + +do_install() { + vmkdir usr/share/qemu/firmware + vmkdir usr/share/AAVMF + + for _arch in "${_archs[@]}"; do + vmkdir "usr/share/edk2/${_arch,,}" + + vinstall "Build/Shell/RELEASE_GCC5/${_arch}/Shell_7C04A583-9E3E-4f1c-AD65-E05268D0B4D1.efi" 644 \ + "usr/share/edk2/${_arch,,}" Shell.efi + vinstall "Build/Shell/RELEASE_GCC5/${_arch}/Shell_EA4BB293-2D7F-4456-A681-1F22F42CD0BC.efi" 644 \ + "usr/share/edk2/${_arch,,}" Shell_Full.efi + + case "$_arch" in + X64) + vinstall "Build/Ovmf${_arch}/RELEASE_GCC5/FV/OVMF.fd" 644 "usr/share/edk2/${_arch,,}" + vinstall "Build/Ovmf${_arch}/RELEASE_GCC5/FV/OVMF_CODE.fd" 644 "usr/share/edk2/${_arch,,}" + vinstall "Build/Ovmf${_arch}/RELEASE_GCC5/FV/OVMF_VARS.fd" 644 "usr/share/edk2/${_arch,,}" + + vinstall "Build/Ovmf${_arch}-4mb/RELEASE_GCC5/FV/OVMF.fd" 644 "usr/share/edk2/${_arch,,}" OVMF.4m.fd + vinstall "Build/Ovmf${_arch}-4mb/RELEASE_GCC5/FV/OVMF_CODE.fd" 644 "usr/share/edk2/${_arch,,}" OVMF_CODE.4m.fd + vinstall "Build/Ovmf${_arch}-4mb/RELEASE_GCC5/FV/OVMF_VARS.fd" 644 "usr/share/edk2/${_arch,,}" OVMF_VARS.4m.fd + + vinstall "Build/Ovmf3264-secure/RELEASE_GCC5/FV/OVMF_CODE.fd" 644 "usr/share/edk2/${_arch,,}" OVMF_CODE.secure.fd + vinstall "Build/Ovmf3264-secure-4mb/RELEASE_GCC5/FV/OVMF_CODE.fd" 644 "usr/share/edk2/${_arch,,}" OVMF_CODE.secure.4m.fd + + vinstall "Build/MicrovmX64/RELEASE_GCC5/FV/MICROVM.fd" 644 "usr/share/edk2/${_arch,,}" MICROVM.fd + vinstall "Build/MicrovmX64-4mb/RELEASE_GCC5/FV/MICROVM.fd" 644 "usr/share/edk2/${_arch,,}" MICROVM.4m.fd + + vcopy "${FILESDIR}/*x86_64*.json" usr/share/qemu/firmware + vcopy "${FILESDIR}/*microvm*.json" usr/share/qemu/firmware + ;; + IA32) + vinstall "Build/Ovmf${_arch}/RELEASE_GCC5/FV/OVMF.fd" 644 "usr/share/edk2/${_arch,,}" + vinstall "Build/Ovmf${_arch}/RELEASE_GCC5/FV/OVMF_CODE.fd" 644 "usr/share/edk2/${_arch,,}" + vinstall "Build/Ovmf${_arch}/RELEASE_GCC5/FV/OVMF_VARS.fd" 644 "usr/share/edk2/${_arch,,}" + + vinstall "Build/Ovmf${_arch}-4mb/RELEASE_GCC5/FV/OVMF.fd" 644 "usr/share/edk2/${_arch,,}" OVMF.4m.fd + vinstall "Build/Ovmf${_arch}-4mb/RELEASE_GCC5/FV/OVMF_CODE.fd" 644 "usr/share/edk2/${_arch,,}" OVMF_CODE.4m.fd + vinstall "Build/Ovmf${_arch}-4mb/RELEASE_GCC5/FV/OVMF_VARS.fd" 644 "usr/share/edk2/${_arch,,}" OVMF_VARS.4m.fd + + vinstall "Build/Ovmf${_arch}-secure/RELEASE_GCC5/FV/OVMF_CODE.fd" 644 "usr/share/edk2/${_arch,,}" OVMF_CODE.secure.fd + vinstall "Build/Ovmf${_arch}-secure-4mb/RELEASE_GCC5/FV/OVMF_CODE.fd" 644 "usr/share/edk2/${_arch,,}" OVMF_CODE.secure.4m.fd + + vcopy "${FILESDIR}/*i386*.json" usr/share/qemu/firmware + ;; + AARCH64) + vcopy "Build/ArmVirtQemu-${_arch}/RELEASE_GCC5/FV/*.fd" "usr/share/edk2/${_arch,,}" + + # libvirt hardcodes this + ln -s ../edk2/aarch64/QEMU_CODE.fd "${DESTDIR}/usr/share/AAVMF/AAVMF_CODE.fd" + ln -s ../edk2/aarch64/QEMU_VARS.fd "${DESTDIR}/usr/share/AAVMF/AAVMF_VARS.fd" + + vcopy "${FILESDIR}/*aarch64*.json" usr/share/qemu/firmware + ;; + ARM) + vcopy "Build/ArmVirtQemu-${_arch}/RELEASE_GCC5/FV/*.fd" "usr/share/edk2/${_arch,,}" + + # libvirt hardcodes this + ln -s ../edk2/arm/QEMU_CODE.fd "${DESTDIR}/usr/share/AAVMF/AAVMF32_CODE.fd" + ln -s ../edk2/arm/QEMU_VARS.fd "${DESTDIR}/usr/share/AAVMF/AAVMF32_VARS.fd" + + vcopy "${FILESDIR}/*arm*.json" usr/share/qemu/firmware + ;; + esac + done + + # lxd hardcodes this + ln -s ./edk2 "${DESTDIR}/usr/share/OVMF" + + vlicense License.txt + vlicense OvmfPkg/License.txt OvmfPkg.License.txt +} + +edk2-shell_package() { + short_desc="EFI Development Kit II - Shell" + pkg_install() { + for _arch in "${_archs[@]}"; do + vmove "usr/share/edk2/${_arch,,}/Shell*.efi" + done + vlicense License.txt + } +} diff --git a/srcpkgs/edk2-ovmf/update b/srcpkgs/edk2-ovmf/update new file mode 100644 index 00000000000..35be97e5701 --- /dev/null +++ b/srcpkgs/edk2-ovmf/update @@ -0,0 +1,2 @@ +site="https://github.com/tianocore/edk2/tags" +pkgname="edk2-stable" diff --git a/srcpkgs/edk2-shell b/srcpkgs/edk2-shell new file mode 120000 index 00000000000..cc069ef22a0 --- /dev/null +++ b/srcpkgs/edk2-shell @@ -0,0 +1 @@ +edk2-ovmf \ No newline at end of file