[arch-commits] Commit in edk2/trunk (PKGBUILD edk2-202005-openssl-1.1.1g.patch)

David Runge dvzrv at archlinux.org
Wed Jun 17 20:33:38 UTC 2020


    Date: Wednesday, June 17, 2020 @ 20:33:37
  Author: dvzrv
Revision: 389452

upgpkg: edk2 202005-1: Upgrading to 202005.

Adding brotli 1.0.7 sources and symlinking them into place, as upstream doesn't bundle them properly.
Updating openssl to 1.1.1.g and providing a patch to successfully build against it.
Minor cleanups.

Added:
  edk2/trunk/edk2-202005-openssl-1.1.1g.patch
Modified:
  edk2/trunk/PKGBUILD

----------------------------------+
 PKGBUILD                         |   34 +++--
 edk2-202005-openssl-1.1.1g.patch |  233 +++++++++++++++++++++++++++++++++++++
 2 files changed, 256 insertions(+), 11 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-06-17 19:44:04 UTC (rev 389451)
+++ PKGBUILD	2020-06-17 20:33:37 UTC (rev 389452)
@@ -1,11 +1,11 @@
 # Maintainer: David Runge <dvzrv at archlinux.org>
 
-# openssl > 1.1.1d is not yet compatible with edk2-ovmf
-_openssl_ver=1.1.1d
+_brotli_ver=1.0.7
+_openssl_ver=1.1.1g
 pkgbase=edk2
 pkgname=('edk2-shell' 'edk2-ovmf')
-pkgver=202002
-pkgrel=9
+pkgver=202005
+pkgrel=1
 pkgdesc="Modern, feature-rich firmware development environment for the UEFI specifications"
 arch=('any')
 url="https://github.com/tianocore/edk2"
@@ -14,13 +14,17 @@
 options=(!makeflags)
 source=("$pkgbase-$pkgver.tar.gz::https://github.com/tianocore/${pkgbase}/archive/${pkgbase}-stable${pkgver}.tar.gz"
         "https://www.openssl.org/source/openssl-${_openssl_ver}.tar.gz"{,.asc}
+        "brotli-${_brotli_ver}.tar.gz::https://github.com/google/brotli/archive/v${_brotli_ver}.tar.gz"
+        "${pkgbase}-202005-openssl-1.1.1g.patch"
         "50-edk2-ovmf-i386-secure.json"
         "50-edk2-ovmf-x86_64-secure.json"
         "60-edk2-ovmf-i386.json"
         "60-edk2-ovmf-x86_64.json")
-sha512sums=('e43090f9c0916b48452fa14bbcd9cd125330304c44b904502ef4ac035bbfb1b0529336f76a0512c0cdbcb4092722839e70b07866e845e76280f6a90b7fb093ab'
-            '2bc9f528c27fe644308eb7603c992bac8740e9f0c3601a130af30c9ffebbf7e0f5c28b76a00bbb478bad40fbe89b4223a58d604001e1713da71ff4b7fe6a08a7'
+sha512sums=('864e5b8babb28eea05f59e17581209c853c004993842a7a6b104e96bd1fd29d9dd3a1545fb44639f2442acc51b078c4996621e1f927fbf449dc1b86421b432ac'
+            '01e3d0b1bceeed8fb066f542ef5480862001556e0f612e017442330bbd7e5faee228b2de3513d7fc347446b7f217e27de1003dc9d7214d5833b97593f3ec25ab'
             'SKIP'
+            'a82362aa36d2f2094bca0b2808d9de0d57291fb3a4c29d7c0ca0a37e73087ec5ac4df299c8c363e61106fccf2fe7f58b5cf76eb97729e2696058ef43b1d3930a'
+            '3605c67d9c8870562086f63e96ffe8039cb394266298b382df61e12c777b6c37a2d2eb3fd5147cb3f00fabddc6dba139ba53da42ea81b1cbeb8f587c6d4cc251'
             '55e4187b11b27737f61e528c02ff43b9381c0cb09140e803531616766f9cb9401115d88d946b56171784cc028f9571279640eb39b6a9fa8e02ec0c8d1b036a3e'
             'a1236585b30d720540de2e9527d8c90ff2d428e800b3da545b23461dc698dc91fe441b62bb8cbca76e08f4ec1eb485619e9ab26157deb06e7fb33e7f5f9dd8b6'
             'c81e072aabfb01d29cf5194111524e2c4c8684979de6b6793db10299c95bb94f7b1d0a98b057df0664d7a894a2b40e9b4c3576112fae400a95eaf5fe5fc9369b'
@@ -33,12 +37,20 @@
 prepare() {
   mv -v "$pkgbase-$pkgbase-stable$pkgver" "$pkgbase-$pkgver"
   cd "$pkgbase-$pkgver"
+
+  # applying fixes to build against openssl-1.1.1g
+  patch -Np1 -i "../${pkgbase}-202005-openssl-1.1.1g.patch"
   # symlinking openssl into place
   rm -rfv CryptoPkg/Library/OpensslLib/openssl
   ln -sfv "${srcdir}/openssl-$_openssl_ver" CryptoPkg/Library/OpensslLib/openssl
-  # openssl 1.1.1d has a typo that causes a compile error
-  sed -e 's/return return/return/g' \
-      -i "../openssl-$_openssl_ver/crypto/threads_none.c"
+  # copying required pre-generated header into place (to not also have to patch openssl)
+  cp -v CryptoPkg/Library/Include/internal/dso_conf.h CryptoPkg/Library/OpensslLib/openssl/include/crypto/
+
+  # symlinking brotli into place
+  rm -rfv BaseTools/Source/C/BrotliCompress/brotli MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
+  ln -sfv "${srcdir}/brotli-${_brotli_ver}" BaseTools/Source/C/BrotliCompress/brotli
+  ln -sfv "${srcdir}/brotli-${_brotli_ver}" MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
+
   # -Werror, not even once
   sed -e 's/ -Werror//g' \
       -i BaseTools/Conf/*.template BaseTools/Source/C/Makefiles/*.makefile
@@ -136,7 +148,7 @@
   # license
   install -vDm 644 License.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
   # docs
-  install -vDm 644 {Readme.md,Maintainers.txt} \
+  install -vDm 644 {ReadMe.rst,Maintainers.txt} \
     -t "${pkgdir}/usr/share/doc/${pkgname}"
 }
 
@@ -175,6 +187,6 @@
   install -vDm 644 OvmfPkg/License.txt \
     "${pkgdir}/usr/share/licenses/${pkgname}/OvmfPkg.License.txt"
   # docs
-  install -vDm 644 {OvmfPkg/README,Readme.md,Maintainers.txt} \
+  install -vDm 644 {OvmfPkg/README,ReadMe.rst,Maintainers.txt} \
     -t "${pkgdir}/usr/share/doc/${pkgname}"
 }

Added: edk2-202005-openssl-1.1.1g.patch
===================================================================
--- edk2-202005-openssl-1.1.1g.patch	                        (rev 0)
+++ edk2-202005-openssl-1.1.1g.patch	2020-06-17 20:33:37 UTC (rev 389452)
@@ -0,0 +1,233 @@
+diff -ruN a/CryptoPkg/CryptoPkg.dec b/CryptoPkg/CryptoPkg.dec
+--- a/CryptoPkg/CryptoPkg.dec	2020-06-02 09:05:21.000000000 +0200
++++ b/CryptoPkg/CryptoPkg.dec	2020-06-09 15:21:52.055912797 +0200
+@@ -23,7 +23,6 @@
+   Private
+   Library/Include
+   Library/OpensslLib/openssl/include
+-  Library/OpensslLib/openssl/crypto/include
+ 
+ [LibraryClasses]
+   ##  @libraryclass  Provides basic library functions for cryptographic primitives.
+diff -ruN a/CryptoPkg/Library/BaseCryptLib/Hash/CryptSm3.c b/CryptoPkg/Library/BaseCryptLib/Hash/CryptSm3.c
+--- a/CryptoPkg/Library/BaseCryptLib/Hash/CryptSm3.c	2020-06-02 09:05:21.000000000 +0200
++++ b/CryptoPkg/Library/BaseCryptLib/Hash/CryptSm3.c	2020-06-09 15:26:52.686439106 +0200
+@@ -7,7 +7,7 @@
+ **/
+ 
+ #include "InternalCryptLib.h"
+-#include "internal/sm3.h"
++#include <crypto/sm3.h>
+ 
+ /**
+   Retrieves the size, in bytes, of the context buffer required for SM3 hash operations.
+diff -ruN a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c
+--- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c	2020-06-02 09:05:21.000000000 +0200
++++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c	2020-06-09 15:22:47.512057737 +0200
+@@ -15,13 +15,12 @@
+ #include <openssl/asn1.h>
+ #include <openssl/x509.h>
+ #include <openssl/bio.h>
+-#include <internal/x509_int.h>
+ #include <openssl/pkcs7.h>
+ #include <openssl/bn.h>
+ #include <openssl/x509_vfy.h>
+ #include <openssl/pem.h>
+ #include <openssl/evp.h>
+-#include <internal/asn1_int.h>
++#include <crypto/asn1.h>
+ 
+ /**
+   This function will return the leaf signer certificate in a chain.  This is
+diff -ruN a/CryptoPkg/Library/OpensslLib/OpensslLib.inf b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf	2020-06-02 09:05:21.000000000 +0200
++++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf	2020-06-09 11:08:33.349121703 +0200
+@@ -477,45 +477,44 @@
+   $(OPENSSL_PATH)/crypto/s390x_arch.h
+   $(OPENSSL_PATH)/crypto/sparc_arch.h
+   $(OPENSSL_PATH)/crypto/vms_rms.h
+-  $(OPENSSL_PATH)/crypto/aes/aes_locl.h
++  $(OPENSSL_PATH)/crypto/aes/aes_local.h
+   $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h
+-  $(OPENSSL_PATH)/crypto/asn1/asn1_locl.h
++  $(OPENSSL_PATH)/crypto/asn1/asn1_local.h
+   $(OPENSSL_PATH)/crypto/asn1/charmap.h
+   $(OPENSSL_PATH)/crypto/asn1/standard_methods.h
+   $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h
+-  $(OPENSSL_PATH)/crypto/async/async_locl.h
++  $(OPENSSL_PATH)/crypto/async/async_local.h
+   $(OPENSSL_PATH)/crypto/async/arch/async_null.h
+   $(OPENSSL_PATH)/crypto/async/arch/async_posix.h
+   $(OPENSSL_PATH)/crypto/async/arch/async_win.h
+-  $(OPENSSL_PATH)/crypto/bio/bio_lcl.h
+-  $(OPENSSL_PATH)/crypto/bn/bn_lcl.h
++  $(OPENSSL_PATH)/crypto/bio/bio_local.h
++  $(OPENSSL_PATH)/crypto/bn/bn_local.h
+   $(OPENSSL_PATH)/crypto/bn/bn_prime.h
+   $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h
+-  $(OPENSSL_PATH)/crypto/comp/comp_lcl.h
++  $(OPENSSL_PATH)/crypto/comp/comp_local.h
+   $(OPENSSL_PATH)/crypto/conf/conf_def.h
+-  $(OPENSSL_PATH)/crypto/conf/conf_lcl.h
+-  $(OPENSSL_PATH)/crypto/dh/dh_locl.h
+-  $(OPENSSL_PATH)/crypto/dso/dso_locl.h
+-  $(OPENSSL_PATH)/crypto/evp/evp_locl.h
+-  $(OPENSSL_PATH)/crypto/hmac/hmac_lcl.h
+-  $(OPENSSL_PATH)/crypto/lhash/lhash_lcl.h
+-  $(OPENSSL_PATH)/crypto/md5/md5_locl.h
+-  $(OPENSSL_PATH)/crypto/modes/modes_lcl.h
++  $(OPENSSL_PATH)/crypto/conf/conf_local.h
++  $(OPENSSL_PATH)/crypto/dh/dh_local.h
++  $(OPENSSL_PATH)/crypto/dso/dso_local.h
++  $(OPENSSL_PATH)/crypto/evp/evp_local.h
++  $(OPENSSL_PATH)/crypto/hmac/hmac_local.h
++  $(OPENSSL_PATH)/crypto/lhash/lhash_local.h
++  $(OPENSSL_PATH)/crypto/md5/md5_local.h
++  $(OPENSSL_PATH)/crypto/modes/modes_local.h
+   $(OPENSSL_PATH)/crypto/objects/obj_dat.h
+-  $(OPENSSL_PATH)/crypto/objects/obj_lcl.h
++  $(OPENSSL_PATH)/crypto/objects/obj_local.h
+   $(OPENSSL_PATH)/crypto/objects/obj_xref.h
+-  $(OPENSSL_PATH)/crypto/ocsp/ocsp_lcl.h
+-  $(OPENSSL_PATH)/crypto/pkcs12/p12_lcl.h
+-  $(OPENSSL_PATH)/crypto/rand/rand_lcl.h
+-  $(OPENSSL_PATH)/crypto/rsa/rsa_locl.h
+-  $(OPENSSL_PATH)/crypto/sha/sha_locl.h
++  $(OPENSSL_PATH)/crypto/ocsp/ocsp_local.h
++  $(OPENSSL_PATH)/crypto/pkcs12/p12_local.h
++  $(OPENSSL_PATH)/crypto/rand/rand_local.h
++  $(OPENSSL_PATH)/crypto/rsa/rsa_local.h
++  $(OPENSSL_PATH)/crypto/sha/sha_local.h
+   $(OPENSSL_PATH)/crypto/siphash/siphash_local.h
+-  $(OPENSSL_PATH)/crypto/sm3/sm3_locl.h
+-  $(OPENSSL_PATH)/crypto/store/store_locl.h
+-  $(OPENSSL_PATH)/crypto/ui/ui_locl.h
+-  $(OPENSSL_PATH)/crypto/x509/x509_lcl.h
++  $(OPENSSL_PATH)/crypto/sm3/sm3_local.h
++  $(OPENSSL_PATH)/crypto/store/store_local.h
++  $(OPENSSL_PATH)/crypto/ui/ui_local.h
++  $(OPENSSL_PATH)/crypto/x509/x509_local.h
+   $(OPENSSL_PATH)/crypto/x509v3/ext_dat.h
+-  $(OPENSSL_PATH)/crypto/x509v3/pcy_int.h
+   $(OPENSSL_PATH)/crypto/x509v3/standard_exts.h
+   $(OPENSSL_PATH)/crypto/x509v3/v3_admis.h
+   $(OPENSSL_PATH)/ssl/bio_ssl.c
+@@ -562,13 +561,13 @@
+   $(OPENSSL_PATH)/ssl/t1_trce.c
+   $(OPENSSL_PATH)/ssl/tls13_enc.c
+   $(OPENSSL_PATH)/ssl/tls_srp.c
+-  $(OPENSSL_PATH)/ssl/packet_locl.h
++  $(OPENSSL_PATH)/ssl/packet_local.h
+   $(OPENSSL_PATH)/ssl/ssl_cert_table.h
+-  $(OPENSSL_PATH)/ssl/ssl_locl.h
++  $(OPENSSL_PATH)/ssl/ssl_local.h
+   $(OPENSSL_PATH)/ssl/record/record.h
+-  $(OPENSSL_PATH)/ssl/record/record_locl.h
++  $(OPENSSL_PATH)/ssl/record/record_local.h
+   $(OPENSSL_PATH)/ssl/statem/statem.h
+-  $(OPENSSL_PATH)/ssl/statem/statem_locl.h
++  $(OPENSSL_PATH)/ssl/statem/statem_local.h
+ # Autogenerated files list ends here
+   buildinf.h
+   rand_pool_noise.h
+diff -ruN a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf	2020-06-02 09:05:21.000000000 +0200
++++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf	2020-06-09 11:17:31.877356870 +0200
+@@ -477,45 +477,44 @@
+   $(OPENSSL_PATH)/crypto/s390x_arch.h
+   $(OPENSSL_PATH)/crypto/sparc_arch.h
+   $(OPENSSL_PATH)/crypto/vms_rms.h
+-  $(OPENSSL_PATH)/crypto/aes/aes_locl.h
++  $(OPENSSL_PATH)/crypto/aes/aes_local.h
+   $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h
+-  $(OPENSSL_PATH)/crypto/asn1/asn1_locl.h
++  $(OPENSSL_PATH)/crypto/asn1/asn1_local.h
+   $(OPENSSL_PATH)/crypto/asn1/charmap.h
+   $(OPENSSL_PATH)/crypto/asn1/standard_methods.h
+   $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h
+-  $(OPENSSL_PATH)/crypto/async/async_locl.h
++  $(OPENSSL_PATH)/crypto/async/async_local.h
+   $(OPENSSL_PATH)/crypto/async/arch/async_null.h
+   $(OPENSSL_PATH)/crypto/async/arch/async_posix.h
+   $(OPENSSL_PATH)/crypto/async/arch/async_win.h
+-  $(OPENSSL_PATH)/crypto/bio/bio_lcl.h
+-  $(OPENSSL_PATH)/crypto/bn/bn_lcl.h
++  $(OPENSSL_PATH)/crypto/bio/bio_local.h
++  $(OPENSSL_PATH)/crypto/bn/bn_local.h
+   $(OPENSSL_PATH)/crypto/bn/bn_prime.h
+   $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h
+-  $(OPENSSL_PATH)/crypto/comp/comp_lcl.h
++  $(OPENSSL_PATH)/crypto/comp/comp_local.h
+   $(OPENSSL_PATH)/crypto/conf/conf_def.h
+-  $(OPENSSL_PATH)/crypto/conf/conf_lcl.h
+-  $(OPENSSL_PATH)/crypto/dh/dh_locl.h
+-  $(OPENSSL_PATH)/crypto/dso/dso_locl.h
+-  $(OPENSSL_PATH)/crypto/evp/evp_locl.h
+-  $(OPENSSL_PATH)/crypto/hmac/hmac_lcl.h
+-  $(OPENSSL_PATH)/crypto/lhash/lhash_lcl.h
+-  $(OPENSSL_PATH)/crypto/md5/md5_locl.h
+-  $(OPENSSL_PATH)/crypto/modes/modes_lcl.h
++  $(OPENSSL_PATH)/crypto/conf/conf_local.h
++  $(OPENSSL_PATH)/crypto/dh/dh_local.h
++  $(OPENSSL_PATH)/crypto/dso/dso_local.h
++  $(OPENSSL_PATH)/crypto/evp/evp_local.h
++  $(OPENSSL_PATH)/crypto/hmac/hmac_local.h
++  $(OPENSSL_PATH)/crypto/lhash/lhash_local.h
++  $(OPENSSL_PATH)/crypto/md5/md5_local.h
++  $(OPENSSL_PATH)/crypto/modes/modes_local.h
+   $(OPENSSL_PATH)/crypto/objects/obj_dat.h
+-  $(OPENSSL_PATH)/crypto/objects/obj_lcl.h
++  $(OPENSSL_PATH)/crypto/objects/obj_local.h
+   $(OPENSSL_PATH)/crypto/objects/obj_xref.h
+-  $(OPENSSL_PATH)/crypto/ocsp/ocsp_lcl.h
+-  $(OPENSSL_PATH)/crypto/pkcs12/p12_lcl.h
+-  $(OPENSSL_PATH)/crypto/rand/rand_lcl.h
+-  $(OPENSSL_PATH)/crypto/rsa/rsa_locl.h
+-  $(OPENSSL_PATH)/crypto/sha/sha_locl.h
++  $(OPENSSL_PATH)/crypto/ocsp/ocsp_local.h
++  $(OPENSSL_PATH)/crypto/pkcs12/p12_local.h
++  $(OPENSSL_PATH)/crypto/rand/rand_local.h
++  $(OPENSSL_PATH)/crypto/rsa/rsa_local.h
++  $(OPENSSL_PATH)/crypto/sha/sha_local.h
+   $(OPENSSL_PATH)/crypto/siphash/siphash_local.h
+-  $(OPENSSL_PATH)/crypto/sm3/sm3_locl.h
+-  $(OPENSSL_PATH)/crypto/store/store_locl.h
+-  $(OPENSSL_PATH)/crypto/ui/ui_locl.h
+-  $(OPENSSL_PATH)/crypto/x509/x509_lcl.h
++  $(OPENSSL_PATH)/crypto/sm3/sm3_local.h
++  $(OPENSSL_PATH)/crypto/store/store_local.h
++  $(OPENSSL_PATH)/crypto/ui/ui_local.h
++  $(OPENSSL_PATH)/crypto/x509/x509_local.h
+   $(OPENSSL_PATH)/crypto/x509v3/ext_dat.h
+-  $(OPENSSL_PATH)/crypto/x509v3/pcy_int.h
+   $(OPENSSL_PATH)/crypto/x509v3/standard_exts.h
+   $(OPENSSL_PATH)/crypto/x509v3/v3_admis.h
+ # Autogenerated files list ends here
+diff -ruN a/CryptoPkg/Library/OpensslLib/process_files.pl b/CryptoPkg/Library/OpensslLib/process_files.pl
+--- a/CryptoPkg/Library/OpensslLib/process_files.pl	2020-06-02 09:05:21.000000000 +0200
++++ b/CryptoPkg/Library/OpensslLib/process_files.pl	2020-06-09 12:36:16.400775802 +0200
+@@ -111,8 +111,8 @@
+             # Generate dso_conf.h per config data
+             system(
+                 "perl -I. -Mconfigdata util/dofile.pl " .
+-                "crypto/include/internal/dso_conf.h.in " .
+-                "> include/internal/dso_conf.h"
++                "include/crypto/dso_conf.h.in " .
++                "> include/crypto/dso_conf.h"
+                 ) == 0 ||
+                     die "Failed to generate dso_conf.h!\n";
+ 
+diff -ruN a/CryptoPkg/Library/OpensslLib/rand_pool.c b/CryptoPkg/Library/OpensslLib/rand_pool.c
+--- a/CryptoPkg/Library/OpensslLib/rand_pool.c	2020-06-02 09:05:21.000000000 +0200
++++ b/CryptoPkg/Library/OpensslLib/rand_pool.c	2020-06-17 21:00:46.335684557 +0200
+@@ -7,9 +7,8 @@
+ 
+ **/
+ 
+-#include "internal/rand_int.h"
+ #include <openssl/aes.h>
+-
++#include <crypto/rand.h>
+ #include <Uefi.h>
+ #include <Library/TimerLib.h>
+ 



More information about the arch-commits mailing list