upgpkg: sbcl 2.2.9-1
[arch-packages.git] / edk2 / trunk / PKGBUILD
blob04c345b64bfb6e13c8e1dfdaa639cfbae4ab51d3
1 # Maintainer: David Runge <dvzrv@archlinux.org>
2 # Contributor: Alexander Epaneshnikov <alex19ep@archlinux.org>
4 _brotli_ver=1.0.9
5 _openssl_ver=1.1.1q
6 pkgbase=edk2
7 pkgname=(edk2-armvirt edk2-shell edk2-ovmf)
8 pkgver=202208
9 pkgrel=2
10 pkgdesc="Modern, feature-rich firmware development environment for the UEFI specifications"
11 arch=(any)
12 url="https://github.com/tianocore/edk2"
13 license=(BSD)
14 makedepends=(aarch64-linux-gnu-gcc acpica git iasl util-linux-libs nasm python seabios)
15 options=(!makeflags)
16 source=(
17   $pkgbase-$pkgver.tar.gz::https://github.com/tianocore/$pkgbase/archive/$pkgbase-stable$pkgver.tar.gz
18   https://www.openssl.org/source/openssl-$_openssl_ver.tar.gz{,.asc}
19   brotli-$_brotli_ver.tar.gz::https://github.com/google/brotli/archive/v$_brotli_ver.tar.gz
20   50-edk2-ovmf-i386-secure.json
21   50-edk2-ovmf-i386-secure-4m.json
22   50-edk2-ovmf-x86_64-secure.json
23   50-edk2-ovmf-x86_64-secure-4m.json
24   60-edk2-ovmf-i386.json
25   60-edk2-ovmf-i386-4m.json
26   60-edk2-ovmf-x86_64.json
27   60-edk2-ovmf-x86_64-4m.json
28   60-edk2-ovmf-microvm.json
29   60-edk2-ovmf-microvm-4m.json
30   60-edk2-armvirt-aarch64.json
31   70-edk2-ovmf-i386-csm.json
32   70-edk2-ovmf-i386-csm-4m.json
33   70-edk2-ovmf-x86_64-csm.json
34   70-edk2-ovmf-x86_64-csm-4m.json
35   80-edk2-ovmf-ia32-on-x86_64-secure.json
36   80-edk2-ovmf-ia32-on-x86_64-secure-4m.json
37   81-edk2-ovmf-ia32-on-x86_64.json
38   81-edk2-ovmf-ia32-on-x86_64-4m.json
39   82-edk2-ovmf-ia32-on-x86_64-csm.json
40   82-edk2-ovmf-ia32-on-x86_64-csm-4m.json
41   $pkgbase-202202-brotli.patch
43 sha512sums=('6a09d90c2e7f9b762dd8a22d61acf94ef740b5250532c50bc1a56b4df3cc11937457b3aff5494b85c41d9567de1f7718855e3801b8ba4b6762d35f524118245e'
44             'cb9f184ec4974a3423ef59c8ec86b6bf523d5b887da2087ae58c217249da3246896fdd6966ee9c13aea9e6306783365239197e9f742c508a0e35e5744e3e085f'
45             'SKIP'
46             'b8e2df955e8796ac1f022eb4ebad29532cb7e3aa6a4b6aee91dbd2c7d637eee84d9a144d3e878895bb5e62800875c2c01c8f737a1261020c54feacf9f676b5f5'
47             '603cae145a87bae371bd069d05128beebddb7048e78b93650b19c44b86b2d27cabbcf3bc4c0b2384b862f32383ce7a914a10fc0ad564632bcadd6e4f9389fede'
48             '0c0bc684cef2e35d600ebab12cfc87ade1409270d3838c0b70c27e8bd8a704f69c982de9781b92c8b698948a03a77de575d50ff8fcb8ba09f8ab936ad239a2bf'
49             '3e10bdc9ad13aadbd4111230fb8f37d5f16306aeb7bce2af5ec31c1e2b5adea26d5875cd0d7070ea82eca7546ecbacc8c195ed68425428bf6d2533b58e307b2d'
50             'cb945b6b88b112cd6bfc02dc60112c22c25a057e285ec53169578026e2173e275e2621e7220ac4623105c2b384db66e156b019df89802daa5f8c30f456d5c478'
51             '56d0bffd6dd7be79709f66bcfba2112e8ef6208de9b5018e90251e3ba68b37f9d911f0bd5a03987b49bb19bd0d62f7fa9ac3ca9f234e80ada3c4dbdd619705b9'
52             '7af6cc543280428aa81dcc5a2da897052ef29bd7d3a73d44f7a2c6f207d626b0f662da9111c1d5f93fd786f10813ebfef57ac44705370801cfe84730961602bc'
53             '04b4c86f5afeab6170ad1b7b9937fa775a920c78719a33b213f7f8924e4e905709335307c38b8d5d9c127dd8c7000ddbe740b77f1ddfb68035819b7b4cf2b1e4'
54             '11c747781fe09eac852c7ed996886559626fe0a394fc380939a868516f03b94190f0a7fce2a09f879313a0ec24509ba89ca050c0e9aed920ca441fc793596645'
55             '31874507e67e1332f678f6f4b10b9f893cef6bafb1db2ac781ea7bfded31a23a84c485b6df43699aaf6c4c7a5a30e024031ffd2b52ede104eedc7c8725e2b5d6'
56             '720181408cdcb8d49bfdfbccb289abba5b18ca7c607facf77b33997810f6687e65cab831f58a848dac3c20f0a540f63a3ca959195e00afdc52c8799c0bafadb9'
57             '6d2799171058b45ff4205441ad222893ebe2fce5c5c71c9c52c97efc95e4cad65d66d390b6a554ce7a2ce505ceba7431d18f79f2c2c1101addccee55141d4a66'
58             '4ee69302de1cec37e4bf4c6a5525d887392f8f733ae8a95a54021f6531741e95baef31da1538b45667a1b198cbbab3069678169069f9ba8db641d603ebb3735b'
59             '24af2459154e7303e5d3df83d06a839256740ad0e9a50dcccc58404b89692ad473b5941aa6f13bdf42a08eef941a2a2557398f6218e476deee3682f65d72d2f1'
60             '77e23f0c116ae5a087553edb2754df172b2c4fe5bc346356abe0e1f2acfb41a346d06d87b0569102ca4ac9356e189198c0c74476cb35f1b62773a956cb6a1e04'
61             '84f24534edb962b71532da914d26d503000d84242d92f4a72c84ad02acf097a695170508065507d6c333f17a7f23043ac68f01e86bbd69e01e5ed067183a7ed1'
62             '8e5eb4e24fad4644a66eb52c95a90a82f01df0af6e57208ad61cb0859dd4425e623e75d93846e8fc3235370a88d93a1d27a512dc4e559bedfe3249404797838b'
63             '038c1f2c189c4e80e87b62df4f3ff96dbf5a20b8fc26b36c04c902293ff1c236ddf3da0063bc5778bf84731fa562d377b9e29c02492c8e584119d71695e0ca09'
64             '7c9f8e7ce7451e7aa852998ffcd3ca95c08083c313dc8dcf0877969ef23d9da6f69c60bb1e652387a223da6e690524fa094bfbaed14d8bdae2853e68530b2f82'
65             'd9857c22bbbee5db9c8e46aaf615600d4b54d6d47fa5f53aa974da98cfd2b8565b1c20e1a9986f5cd4f0352fb65ec105f6ade8e986402369b0edb1581b0b15b5'
66             '891d3ea36d966114ff1f79c3619675a46b30b68def16ab426f2dee00bd0768f82ca0ee26acd7adedd379f25613e309ec9dfaed4e8a5d3f3e4fa7e8d845f55b18'
67             '427f10a9ad528c796366aac9da9668a255642c57dd099a2a798f7f95031a55a360474d657cec300988337d8facb9997fc835dccf77eb0290a94cdc3a36db8f6c'
68             'd074c794796d17d77eed7c34201d93d7ef3f1322fe1ea4a2ddd7137fae884d49f94f465ee39cfd8346b026142668a41f5a8671e521409505dd6d002f71c0eebc')
69 b2sums=('06b25eb8b2a7fd16041a8f3f5b0fcca6bf554a452a39c0ec5d222e94361cc6485c7b6ac1458e464a0b504e257aa5573d6fc0107aa60550226b960046a47d8d2e'
70         'fc8fd6a62dc291d0bda328a051e253175fb04442cc4b8f45d67c3a5027748a0fc5fb372d0483bc9024ae0bff119c4fac8f1e982a182612427696d6d09f5935f5'
71         'SKIP'
72         '8b9939d5224396ef33b43e019250ba4bc8949903583615e8dc02c85340fc0a1e2d1632161e00b0ee7355d77f05529ac772f482e05d2089afd71a0bf71e803904'
73         'fa75566a2ac591fc0c296812f907bfe3fd67f2ee90d3762f0fcae6427df0dfd6260238f5af4fc6b74a76eccfc264db2259db70f8c533871e8b58f37b91a90657'
74         'd8e31fe12522f3c973c400435410b48cff92b67f00bc19808d211edc2f56f164b662457687d0e8aa69aba4ef279b74684579899a2e59ea06a2b399faff5557f6'
75         'f6aaccf4b5a070b05e8eb58d5df60c8798d9b9de2f9febf1417a1ae178431be9a69890a7107d3ca100a439551b4949b937ba400ac36bb9eebaf7e1fdb61dc9d3'
76         'acbe08c38460a3acdb3ada3bf30468c59c7e1f812576ab39d9261f9bf5432bc4150bacac51a590b8bba26d0842da97ab3ddff8c4cfc44e00bf2b6c9ab7c153ba'
77         '891719a70d14f29f6ec9e9cfe83cbf48abb5aedfaf5a3a02efaf9cf1dcca0c14f42f8e4486425df12c72001d7811b0f6030520bad2d83b4885f13d110ab2ae0f'
78         'fb6f2b838ca4da83978ba04dbb6785b7f0712342a92deb0ca7bc16ebf5c31b34903908266c47c637baa17a4c1c6641c35e4e6c3c2771f270c31c7a7a78c82e9f'
79         '899ecf699815216984905a7abdd3385890c6309f3ef7813778bedf63c15d42ab12c59532d45033a11838f990744417100eb13048b53cee5cdf46440af61b475d'
80         'b970841e9587133bc2038f9aaa4d00247c9652c6a9aed417c59df061e00c3b9d91d174f6b2a4fb66862cbbc754c0a79d77774c3fa1419b04eb6a3211d54451a5'
81         '271322de65313b310a390ea9148640eb065c71b4edcab8aa675f8dbdfbbfa961950994d47213e22f05aa093895d180b840627a15d324252323986596f5c9f067'
82         '3622e946453d88de0e458217fadb74bde221e4efbbdc232ee84d4fb74a895a725e32e98e575a10ad642f7e0badf47c72303105555a7d266c9a928074aef19a32'
83         'e61378139f2da0d4185e67436d87a023600a075b4258234e818fe7f591bdb5d363713d29d250263df6074f5d37deed269c067983ee6bd322f2f7d0ee710bc452'
84         '8c211a1bbef20ff361c53735b91cc05660f9d94e7d8a937d903c061a1ec9c96ec2c37f0ef5e954cd4aac7f7962489f5a7a0507e44c781a7671211a9530dccb5b'
85         'c869699ef197bf18e048ca59c170bc09e1c792b99d2a5ee0ce3fb8f248d271f5b2a1788f44a392acf668dbf47f8bc4c4c9dbead3e7a26c2c093650df65cc9d2a'
86         '7f48bb1747c732c597a749c851a6cac46de844c1727f3d5edca35249df845a0f578780e8bcda7d86ad2c4a62a9a2a0bc7e1cfab9b7b93d7b5415bb5817d73346'
87         '6bea37f43f5ba483c7c1b57043bc7529d883992d5b64d28f96fd87aeb39ef52eec443d473badcb3323cd259c0bff249d550a00a78c3db7718a7a2200daf7f0db'
88         'ddacbab89d0fd7831149594487559bb6bac1464b2b5620641043306fabfc37800db8c6d87a833c70ec35c699ea2f35cf09d34028ec7982a94686e8cd97b73300'
89         '5cffcdde97a4b830412294d97d70f73c223c30f2489f10ab9731b76d77ac73518164c8eac6c2adfc879e29e289bbde677d7ca641b2af0db4f507719b01d6c87b'
90         '99bf35c4042fd5105a3b3b7f71b0aeb18db7811da4ed4481ffec485258619c30d33b08633f9a1c762d383e3bf0191053be9b88b9a4c142350186c6df1261d1f7'
91         'f9afdc9c7ed72c97f6747087b341f4af3527d2a148cb0cda3a1b676c4def7acc2172f889f56fe66ab8a27a038a5f47c86627393dcb1ec9c4d36361d8b0c15a40'
92         'd45b224c36eda139ca6ad9e4c6c04282724b264dd36a0b3ba904d71476b83e02963c8cadf1f1e1233955071d133dc0defa746740fa08b26398c489fbf6ba89a0'
93         '27523147892b9953643e08e3f592598c6cb04986fcf6f1f54b21f6a293acbbbc4bcdfcd67ef1dfc4894fac294a9268a9da265ef9205736e359116ba546bee5ef'
94         '644c071dc4fbbccaa64b0b1babcad60395ffce1a7a317a6f5380eff44cbb886be5f29156a8e967ab02b508a33954fcf5602606b43362cc3bb1936a8cfc3a3c07')
95 validpgpkeys=(
96   8657ABB260F056B1E5190839D9C4D26D0E604491 # Matt Caswell <matt@openssl.org>
97   7953AC1FBC3DC8B3B292393ED5E9E43F7DF9EE8C  # Richard Levitte <richard@levitte.org>
99 _arch_list=(AARCH64 IA32 X64)
100 _build_type=RELEASE
101 _build_plugin=GCC5
103 prepare() {
104   # patch to be able to use brotli 1.0.9
105   patch -Np1 -d $pkgbase-$pkgbase-stable$pkgver -i ../$pkgbase-202202-brotli.patch
107   cd $pkgbase-$pkgbase-stable$pkgver
109   # symlinking openssl into place
110   rm -rfv CryptoPkg/Library/OpensslLib/openssl
111   ln -sfv "${srcdir}/openssl-$_openssl_ver" CryptoPkg/Library/OpensslLib/openssl
113   # symlinking brotli into place
114   rm -rfv BaseTools/Source/C/BrotliCompress/brotli MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
115   ln -sfv "${srcdir}/brotli-${_brotli_ver}" BaseTools/Source/C/BrotliCompress/brotli
116   ln -sfv "${srcdir}/brotli-${_brotli_ver}" MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
118   # -Werror, not even once
119   sed -e 's/ -Werror//g' -i BaseTools/Conf/*.template BaseTools/Source/C/Makefiles/*.makefile
121   # copy seabios's CSM binary into place, so that it can be included in the binaries:
122   cp -v /usr/share/qemu/bios-csm.bin OvmfPkg/Csm/Csm16/Csm16.bin
125 # TODO: check TPM_ENABLE/TPM2_ENABLE
126 build() {
127   local _arch
128   # shared targets for all
129   local _common_args=(
130     -b "$_build_type"
131     -n "$(nproc)"
132     -t "$_build_plugin"
133   )
134   # shared targets for all EFI binaries
135   local _efi_args=(
136     -D NETWORK_IP6_ENABLE
137     -D TPM_CONFIG_ENABLE
138     -D TPM1_ENABLE
139     -D TPM2_ENABLE
140   )
141   # shared targets x86_64 and i686
142   local _x86_args=(
143     -D FD_SIZE_2MB
144     -D HTTP_BOOT_ENABLE
145     -D TLS_ENABLE
146   )
147   # 4MB FD size variant
148   local _4mb_args=(
149     -D FD_SIZE_4MB
150     -D FD_SIZE_IN_KB=4096
151     -D HTTP_BOOT_ENABLE
152     -D TLS_ENABLE
153   )
155   cd $pkgbase-$pkgbase-stable$pkgver
156   export GCC5_IA32_PREFIX="x86_64-linux-gnu-"
157   export GCC5_X64_PREFIX="x86_64-linux-gnu-"
158   export GCC5_AARCH64_PREFIX="aarch64-linux-gnu-"
159   echo "Building base tools (AARCH64)"
160   ARCH=AARCH64 make -C BaseTools
161   echo "Building base tools"
162   make -C BaseTools
163   . edksetup.sh
165   for _arch in ${_arch_list[@]}; do
166     # shell
167     echo "Building shell ($_arch)."
168     BaseTools/BinWrappers/PosixLike/build -p ShellPkg/ShellPkg.dsc -a "$_arch" "${_common_args[@]}"
169     # ovmf
170     if [[ "$_arch" == IA32 ]]; then
171       echo "Building ovmf ($_arch) with secure boot support"
172       OvmfPkg/build.sh -p OvmfPkg/OvmfPkgIa32.dsc \
173                        -a "$_arch" \
174                        "${_common_args[@]}" \
175                        "${_efi_args[@]}" \
176                        "${_x86_args[@]}" \
177                        -D EXCLUDE_SHELL_FROM_FD \
178                        -D LOAD_X64_ON_IA32_ENABLE \
179                        -D SECURE_BOOT_ENABLE \
180                        -D SMM_REQUIRE
181       mv -v Build/Ovmf{Ia32,IA32-secure}
182       echo "Building ovmf ($_arch) with secure boot support (4MB FD)"
183       OvmfPkg/build.sh -p OvmfPkg/OvmfPkgIa32.dsc \
184                        -a "$_arch" \
185                        "${_common_args[@]}" \
186                        "${_efi_args[@]}" \
187                        "${_4mb_args[@]}" \
188                        -D EXCLUDE_SHELL_FROM_FD \
189                        -D LOAD_X64_ON_IA32_ENABLE \
190                        -D SECURE_BOOT_ENABLE \
191                        -D SMM_REQUIRE
192       mv -v Build/Ovmf{Ia32,IA32-secure-4mb}
193       echo "Building ovmf ($_arch) with CSM support"
194       OvmfPkg/build.sh -p OvmfPkg/OvmfPkgIa32.dsc \
195                        -a "${_arch}" \
196                        "${_common_args[@]}" \
197                        "${_efi_args[@]}" \
198                        "${_x86_args[@]}" \
199                        -D CSM_ENABLE \
200                        -D LOAD_X64_ON_IA32_ENABLE
201       mv -v Build/Ovmf{Ia32,IA32-csm}
202       echo "Building ovmf ($_arch) with CSM support (4MB FD)"
203       OvmfPkg/build.sh -p OvmfPkg/OvmfPkgIa32.dsc \
204                        -a "${_arch}" \
205                        "${_common_args[@]}" \
206                        "${_efi_args[@]}" \
207                        "${_4mb_args[@]}" \
208                        -D CSM_ENABLE \
209                        -D LOAD_X64_ON_IA32_ENABLE
210       mv -v Build/Ovmf{Ia32,IA32-csm-4mb}
211       echo "Building ovmf ($_arch) default"
212       OvmfPkg/build.sh -p OvmfPkg/OvmfPkgIa32.dsc \
213                        -a "$_arch" \
214                        "${_common_args[@]}" \
215                        "${_efi_args[@]}" \
216                        "${_x86_args[@]}" \
217                        -D LOAD_X64_ON_IA32_ENABLE
218       mv -v Build/Ovmf{Ia32,IA32}
219       echo "Building ovmf ($_arch) default (4MB FD)"
220       OvmfPkg/build.sh -p OvmfPkg/OvmfPkgIa32.dsc \
221                        -a "$_arch" \
222                        "${_common_args[@]}" \
223                        "${_efi_args[@]}" \
224                        "${_4mb_args[@]}" \
225                        -D LOAD_X64_ON_IA32_ENABLE
226       mv -v Build/Ovmf{Ia32,IA32-4mb}
227     fi
228     if [[ "$_arch" == X64 ]]; then
229       echo "Building ovmf ($_arch) with microvm support (4MB FD)"
230       OvmfPkg/build.sh -p OvmfPkg/Microvm/Microvm$_arch.dsc \
231                        -a "$_arch" \
232                        "${_common_args[@]}" \
233                        "${_efi_args[@]}" \
234                        "${_4mb_args[@]}"
235       mv -v Build/MicrovmX64{,-4mb}
236       echo "Building ovmf ($_arch) with microvm support"
237       OvmfPkg/build.sh -p OvmfPkg/Microvm/Microvm$_arch.dsc \
238                        -a "$_arch" \
239                        "${_common_args[@]}" \
240                        "${_efi_args[@]}" \
241                        "${_x86_args[@]}"
242       echo "Building ovmf ($_arch) with secure boot support"
243       OvmfPkg/build.sh -p OvmfPkg/OvmfPkgIa32X64.dsc \
244                        -a IA32 -a "$_arch" \
245                        "${_common_args[@]}" \
246                        "${_efi_args[@]}" \
247                        "${_x86_args[@]}" \
248                        -D SECURE_BOOT_ENABLE \
249                        -D SMM_REQUIRE \
250                        -D EXCLUDE_SHELL_FROM_FD
251       mv -v Build/Ovmf3264{,-secure}
252       echo "Building ovmf ($_arch) with secure boot support (4MB FD)"
253       OvmfPkg/build.sh -p OvmfPkg/OvmfPkgIa32X64.dsc \
254                        -a IA32 -a "$_arch" \
255                        "${_common_args[@]}" \
256                        "${_efi_args[@]}" \
257                        "${_4mb_args[@]}" \
258                        -D SECURE_BOOT_ENABLE \
259                        -D SMM_REQUIRE \
260                        -D EXCLUDE_SHELL_FROM_FD
261       mv -v Build/Ovmf3264{,-secure-4mb}
262       echo "Building ovmf ($_arch) with CSM support"
263       OvmfPkg/build.sh -p OvmfPkg/OvmfPkg$_arch.dsc \
264                        -a "${_arch}" \
265                        "${_common_args[@]}" \
266                        "${_efi_args[@]}" \
267                        "${_x86_args[@]}" \
268                        -D CSM_ENABLE
269       mv -v Build/OvmfX64{,-csm}
270       echo "Building ovmf ($_arch) with CSM support (4MB FD)"
271       OvmfPkg/build.sh -p OvmfPkg/OvmfPkg$_arch.dsc \
272                        -a "${_arch}" \
273                        "${_common_args[@]}" \
274                        "${_efi_args[@]}" \
275                        "${_4mb_args[@]}" \
276                        -D CSM_ENABLE
277       mv -v Build/OvmfX64{,-csm-4mb}
278       echo "Building ovmf (${_arch}) without secure boot (4MB FD)"
279       OvmfPkg/build.sh -p OvmfPkg/OvmfPkg$_arch.dsc \
280                        -a "$_arch" \
281                        "${_common_args[@]}" \
282                        "${_efi_args[@]}" \
283                        "${_4mb_args[@]}"
284       mv -v Build/OvmfX64{,-4mb}
285       echo "Building ovmf (${_arch}) without secure boot"
286       OvmfPkg/build.sh -p OvmfPkg/OvmfPkg$_arch.dsc \
287                        -a "$_arch" \
288                        "${_common_args[@]}" \
289                        "${_efi_args[@]}" \
290                        "${_x86_args[@]}"
291     fi
292     if [[ "$_arch" == AARCH64 ]]; then
293       echo "Building ArmVirtPkg ($_arch) with secure boot"
294       BaseTools/BinWrappers/PosixLike/build -p ArmVirtPkg/ArmVirtQemu.dsc \
295                                             -a "$_arch" \
296                                             "${_common_args[@]}" \
297                                             "${_efi_args[@]}" \
298                                             -D NETWORK_HTTP_BOOT_ENABLE \
299                                             -D NETWORK_TLS_ENABLE \
300                                             -D SECURE_BOOT_ENABLE
301       dd if=/dev/zero of=Build/ArmVirtQemu-$_arch/${_build_type}_${_build_plugin}/FV/QEMU_CODE.fd bs=1M count=64
302       dd if=Build/ArmVirtQemu-$_arch/${_build_type}_${_build_plugin}/FV/QEMU_EFI.fd of=Build/ArmVirtQemu-$_arch/${_build_type}_${_build_plugin}/FV/QEMU_CODE.fd conv=notrunc
303       dd if=/dev/zero of=Build/ArmVirtQemu-$_arch/${_build_type}_${_build_plugin}/FV/QEMU_VARS.fd bs=1M count=64
304     fi
305   done
308 package_edk2-armvirt() {
309   local _arch=AARCH64
311   pkgdesc="Firmware for Virtual Machines (aarch64)"
312   url="https://github.com/tianocore/tianocore.github.io/wiki/ArmVirtPkg"
314   cd $pkgbase-$pkgbase-stable$pkgver
315   install -vDm 644 Build/ArmVirtQemu-$_arch/${_build_type}_${_build_plugin}/FV/*.fd -t "$pkgdir/usr/share/$pkgname/${_arch,,}/"
316   # add libvirt compatibility (which hardcodes the following paths)
317   install -vdm 755 "$pkgdir/usr/share/AAVMF"
318   ln -svf /usr/share/$pkgname/${_arch,,}/QEMU_CODE.fd "$pkgdir/usr/share/AAVMF/AAVMF_CODE.fd"
319   ln -svf /usr/share/$pkgname/${_arch,,}/QEMU_VARS.fd "$pkgdir/usr/share/AAVMF/AAVMF_VARS.fd"
320   # install qemu descriptors in accordance with qemu:
321   # https://git.qemu.org/?p=qemu.git;a=tree;f=pc-bios/descriptors
322   install -vDm 644 ../*$pkgname*.json -t "$pkgdir/usr/share/qemu/firmware/"
323   # license
324   install -vDm 644 License.txt -t "$pkgdir/usr/share/licenses/$pkgname/"
327 package_edk2-shell() {
328   local _arch
329   # minimal UEFI shell, as defined in ShellPkg/Application/Shell/ShellPkg.inf
330   local _min='7C04A583-9E3E-4f1c-AD65-E05268D0B4D1'
331   # full UEFI shell, as defined in ShellPkg/ShellPkg.dsc
332   local _full='EA4BB293-2D7F-4456-A681-1F22F42CD0BC'
334   pkgdesc="EDK2 UEFI Shell"
335   provides=(uefi-shell)
337   cd $pkgbase-$pkgbase-stable$pkgver
338   for _arch in ${_arch_list[@]}; do
339     if [[ "${_arch}" == 'AARCH64' ]]; then
340       install -vDm 644 Build/ArmVirtQemu-$_arch/${_build_type}_${_build_plugin}/$_arch/Shell.efi -t "$pkgdir/usr/share/$pkgname/${_arch,,}/"
341     else
342       install -vDm 644 Build/Shell/${_build_type}_${_build_plugin}/$_arch/Shell_$_min.efi "$pkgdir/usr/share/$pkgname/${_arch,,}/Shell.efi"
343       install -vDm 644 Build/Shell/${_build_type}_${_build_plugin}/$_arch/Shell_$_full.efi "$pkgdir/usr/share/$pkgname/${_arch,,}/Shell_Full.efi"
344     fi
345   done
346   # license
347   install -vDm 644 License.txt -t "$pkgdir/usr/share/licenses/$pkgname/"
348   # docs
349   install -vDm 644 {ReadMe.rst,Maintainers.txt} -t "$pkgdir/usr/share/doc/$pkgname/"
352 package_edk2-ovmf() {
353   local _arch
355   pkgdesc="Firmware for Virtual Machines (x86_64, i686)"
356   url="https://github.com/tianocore/tianocore.github.io/wiki/OVMF"
357   license+=(MIT)
358   provides=(ovmf)
359   conflicts=(ovmf)
360   replaces=(ovmf)
361   install=$pkgname.install
363   cd $pkgbase-$pkgbase-stable$pkgver
364   # installing the various firmwares
365   for _arch in ${_arch_list[@]}; do
366     if [[ "$_arch" == AARCH64 ]]; then
367       continue
368     else
369       # installing OVMF.fd for xen: https://bugs.archlinux.org/task/58635
370       install -vDm 644 Build/Ovmf$_arch/${_build_type}_${_build_plugin}/FV/OVMF.fd -t "$pkgdir/usr/share/$pkgname/${_arch,,}/"
371       install -vDm 644 Build/Ovmf$_arch/${_build_type}_${_build_plugin}/FV/OVMF_CODE.fd -t "$pkgdir/usr/share/$pkgname/${_arch,,}/"
372       install -vDm 644 Build/Ovmf$_arch/${_build_type}_${_build_plugin}/FV/OVMF_VARS.fd -t "$pkgdir/usr/share/$pkgname/${_arch,,}/"
373       install -vDm 644 Build/Ovmf$_arch-4mb/${_build_type}_${_build_plugin}/FV/OVMF.fd -t "$pkgdir/usr/share/${pkgname}-4m/${_arch,,}/"
374       install -vDm 644 Build/Ovmf$_arch-4mb/${_build_type}_${_build_plugin}/FV/OVMF_CODE.fd -t "$pkgdir/usr/share/${pkgname}-4m/${_arch,,}/"
375       install -vDm 644 Build/Ovmf$_arch-4mb/${_build_type}_${_build_plugin}/FV/OVMF_VARS.fd -t "$pkgdir/usr/share/${pkgname}-4m/${_arch,,}/"
376       install -vDm 644 Build/Ovmf$_arch-csm/${_build_type}_${_build_plugin}/FV/OVMF_CODE.fd "$pkgdir/usr/share/$pkgname/${_arch,,}/OVMF_CODE.csm.fd"
377       install -vDm 644 Build/Ovmf$_arch-csm-4mb/${_build_type}_${_build_plugin}/FV/OVMF_CODE.fd "$pkgdir/usr/share/${pkgname}-4m/${_arch,,}/OVMF_CODE.csm.fd"
378       if [[ "${_arch}" == 'X64' ]]; then
379         install -vDm 644 Build/Ovmf3264-secure/${_build_type}_${_build_plugin}/FV/OVMF_CODE.fd "$pkgdir/usr/share/$pkgname/${_arch,,}/OVMF_CODE.secboot.fd"
380         install -vDm 644 Build/Ovmf3264-secure-4mb/${_build_type}_${_build_plugin}/FV/OVMF_CODE.fd "$pkgdir/usr/share/${pkgname}-4m/${_arch,,}/OVMF_CODE.secboot.fd"
381         install -vDm 644 Build/MicrovmX64/${_build_type}_${_build_plugin}/FV/MICROVM.fd -t "$pkgdir/usr/share/$pkgname/${_arch,,}/"
382         install -vDm 644 Build/MicrovmX64-4mb/${_build_type}_${_build_plugin}/FV/MICROVM.fd -t "$pkgdir/usr/share/${pkgname}-4m/${_arch,,}/"
383       else
384         install -vDm 644 Build/Ovmf$_arch-secure/${_build_type}_${_build_plugin}/FV/OVMF_CODE.fd "$pkgdir/usr/share/$pkgname/${_arch,,}/OVMF_CODE.secboot.fd"
385         install -vDm 644 Build/Ovmf$_arch-secure-4mb/${_build_type}_${_build_plugin}/FV/OVMF_CODE.fd "$pkgdir/usr/share/${pkgname}-4m/${_arch,,}/OVMF_CODE.secboot.fd"
386       fi
387     fi
388   done
389   # installing qemu descriptors in accordance with qemu:
390   # https://git.qemu.org/?p=qemu.git;a=tree;f=pc-bios/descriptors
391   # https://bugs.archlinux.org/task/64206
392   install -vDm 644 ../*$pkgname*.json -t "$pkgdir/usr/share/qemu/firmware/"
393   # adding symlink for previous ovmf location
394   # https://bugs.archlinux.org/task/66528
395   ln -svf /usr/share/$pkgname "$pkgdir/usr/share/ovmf"
396   # adding a symlink for applications with questionable heuristics (such as lxd)
397   ln -svf /usr/share/$pkgname "$pkgdir/usr/share/OVMF"
398   # licenses
399   install -vDm 644 License.txt -t "$pkgdir/usr/share/licenses/$pkgname/"
400   install -vDm 644 OvmfPkg/License.txt "$pkgdir/usr/share/licenses/$pkgname/OvmfPkg.License.txt"
401   # docs
402   install -vDm 644 {OvmfPkg/README,ReadMe.rst,Maintainers.txt} -t "$pkgdir/usr/share/doc/$pkgname/"