From c1d3da9ca87c414100b1cb969e36b8d7d05b9a74 Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 10 Aug 2022 09:16:34 +0100 Subject: added ovmf, lolcat, spice, and squashfstools --- ...Tools-do-not-build-BrotliCompress-RH-only.patch | 43 +++++++++++ ...g-remove-package-private-Brotli-include-p.patch | 49 +++++++++++++ repo/edk2/build-hack.patch | 13 ++++ repo/edk2/disable-werror.patch | 11 +++ repo/edk2/edk2-ovmf.xibuild | 19 +++++ repo/edk2/edk2.xibuild | 84 ++++++++++++++++++++++ 6 files changed, 219 insertions(+) create mode 100644 repo/edk2/0008-BaseTools-do-not-build-BrotliCompress-RH-only.patch create mode 100644 repo/edk2/0009-MdeModulePkg-remove-package-private-Brotli-include-p.patch create mode 100644 repo/edk2/build-hack.patch create mode 100644 repo/edk2/disable-werror.patch create mode 100644 repo/edk2/edk2-ovmf.xibuild create mode 100644 repo/edk2/edk2.xibuild (limited to 'repo/edk2') diff --git a/repo/edk2/0008-BaseTools-do-not-build-BrotliCompress-RH-only.patch b/repo/edk2/0008-BaseTools-do-not-build-BrotliCompress-RH-only.patch new file mode 100644 index 0000000..78d65ea --- /dev/null +++ b/repo/edk2/0008-BaseTools-do-not-build-BrotliCompress-RH-only.patch @@ -0,0 +1,43 @@ +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 + diff --git a/repo/edk2/0009-MdeModulePkg-remove-package-private-Brotli-include-p.patch b/repo/edk2/0009-MdeModulePkg-remove-package-private-Brotli-include-p.patch new file mode 100644 index 0000000..6046944 --- /dev/null +++ b/repo/edk2/0009-MdeModulePkg-remove-package-private-Brotli-include-p.patch @@ -0,0 +1,49 @@ +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/repo/edk2/build-hack.patch b/repo/edk2/build-hack.patch new file mode 100644 index 0000000..98d7c12 --- /dev/null +++ b/repo/edk2/build-hack.patch @@ -0,0 +1,13 @@ +VfrCompile seg.faults with fortify enabled. It's probably broken. + +diff -ru a/edk2-e242cdfb307a6dfe2c0f75c4719f5c1f6b418625/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/edk2-e242cdfb307a6dfe2c0f75c4719f5c1f6b418625/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp +--- edk2-e242cdfb307a6dfe2c0f75c4719f5c1f6b418625/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp 2016-11-16 10:01:14.000000000 +0200 ++++ edk2-e242cdfb307a6dfe2c0f75c4719f5c1f6b418625/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp 2016-11-16 14:47:30.211978076 +0200 +@@ -13,6 +13,7 @@ + + **/ + ++#define _FORTIFY_SOURCE 0 + #include "stdio.h" + #include "stdlib.h" + #include "CommonLib.h" diff --git a/repo/edk2/disable-werror.patch b/repo/edk2/disable-werror.patch new file mode 100644 index 0000000..73f19d4 --- /dev/null +++ b/repo/edk2/disable-werror.patch @@ -0,0 +1,11 @@ +--- ./BaseTools/Source/C/Makefiles/header.makefile.orig ++++ ./BaseTools/Source/C/Makefiles/header.makefile +@@ -73,7 +73,7 @@ + -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -g + else + BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \ +--fno-delete-null-pointer-checks -Wall -Werror \ ++-fno-delete-null-pointer-checks -Wall \ + -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict \ + -Wno-unused-result -nostdlib -g + endif diff --git a/repo/edk2/edk2-ovmf.xibuild b/repo/edk2/edk2-ovmf.xibuild new file mode 100644 index 0000000..eec9426 --- /dev/null +++ b/repo/edk2/edk2-ovmf.xibuild @@ -0,0 +1,19 @@ +#!/bin/sh + +DESC="Open Virtual Machine Firmware (OVMF) BIOS" + +build () { + echo "skip" +} + +package () { + for fw in "$BUILD_ROOT"/Build/*/"$RELEASE"_"$TOOLCHAIN"/FV/*.fd; do + install -D $fw "$PKG_DEST"/usr/share/OVMF/${fw##*/} + done + + # dont ship memfd for now to save space + rm -f "$PKG_DEST"/usr/share/OVMF/MEMFD.fd + + install -d "$PKG_DEST"/usr/share/ovmf + ln -sf ../OVMF/OVMF.fd "$PKG_DEST"/usr/share/ovmf/bios.bin +} diff --git a/repo/edk2/edk2.xibuild b/repo/edk2/edk2.xibuild new file mode 100644 index 0000000..d4deb4a --- /dev/null +++ b/repo/edk2/edk2.xibuild @@ -0,0 +1,84 @@ +#!/bin/sh + +NAME="edk2" +DESC="EFI Development Kit II" + +MAKEDEPS=" bash python iasl nasm util-linux util-linux-misc" + +PKG_VER=0.0.202202 +_realver=edk2-stable${PKG_VER##*.} +_sslver=1.1.1n +_sfver=3e +SOURCE="https://github.com/tianocore/edk2/archive/$_realver.tar.gz" + +ADDITIONAL=" +https://www.openssl.org/source/openssl-$_sslver.tar.gz +http://www.jhauser.us/arithmetic/SoftFloat-$_sfver.zip +0008-BaseTools-do-not-build-BrotliCompress-RH-only.patch +0009-MdeModulePkg-remove-package-private-Brotli-include-p.patch +build-hack.patch +disable-werror.patch +" + +TARGET_ARCH=X64 +PLATFORM=OvmfPkg/OvmfPkgX64.dsc + +TOOLCHAIN=GCC5 +RELEASE=RELEASE + + +prepare() { + # unix line endings for the files to be patched + sed -e 's/\r$//' -i BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp \ + BaseTools/Source/C/VolInfo/VolInfo.c + rm -rf CryptoPkg/Library/OpensslLib/openssl + ln -s "$BUILD_ROOT"/openssl-$_sslver CryptoPkg/Library/OpensslLib/openssl + rm -rf ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 + ln -s "$BUILD_ROOT"/SoftFloat-$_sfver \ + ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 + apply_patches +} + +build() { + export WORKSPACE=$PWD + export PACKAGES_PATH=$PWD + export EDK_TOOLS_PATH=$PWD/BaseTools/ + export PATH=$PWD/BaseTools/BinWrappers/PosixLike/:$PATH + # parallel build fails + unset MAKEFLAGS + + bash -c ". edksetup.sh" + make -C BaseTools + + msg "Building Plaform Files" + command build -b $RELEASE \ + -a $TARGET_ARCH \ + -t $TOOLCHAIN \ + -p $PLATFORM \ + -n ${JOBS:-2} +} + +package() { + mkdir -p "$PKG_DEST"/usr/bin \ + "$PKG_DEST"/usr/share/edk2/Conf \ + "$PKG_DEST"/usr/share/edk2/Scripts + + install BaseTools/Source/C/bin/* BaseTools/BinWrappers/PosixLike/LzmaF86Compress \ + "$PKG_DEST"/usr/bin + install BaseTools/BuildEnv "$PKG_DEST"/usr/share/edk2/ + install BaseTools/Conf/*.template "$PKG_DEST"/usr/share/edk2/Conf + install BaseTools/Scripts/GccBase.lds "$PKG_DEST"/usr/share/edk2/Scripts + + for i in $(find BaseTools/Source/Python -type d -maxdepth 1); do + local mod=${i##*/} + test -f "$i/$mod.py" || continue + cp -R BaseTools/Source/Python/"$mod" "$PKG_DEST"/usr/share/edk2/Python/ + cat <<- EOF > "$PKG_DEST"/usr/bin/"$mod".py + #!/bin/sh + export PYTHONPATH=/usr/share/edk2/Python + exec $PYTHON_COMMAND /usr/share/edk2/Python/$mod/$mod.py "\$@" + EOF + chmod +x "$PKG_DEST"/usr/bin/"$mod".py + done +} + -- cgit v1.2.1