[arch-commits] Commit in edk2/trunk (70-edk2-armvirt-aarch64.json PKGBUILD)

David Runge dvzrv at archlinux.org
Thu Dec 3 17:37:23 UTC 2020


    Date: Thursday, December 3, 2020 @ 17:37:22
  Author: dvzrv
Revision: 402849

upgpkg: edk2 202011-1: Upgrade to 202011.

Use openssl 1.1.1h.
Add aarch64-linux-gnu-gcc to makedepends for the new split package edk2-armvirt.
Extend build() by instructions to build ArmVirtPkg (for aarch64).
Add package() function for edk2-armvirt.
Extend package() function for edk2-shell to also include the aarch64 UEFI shell.
FIx package() function for edk2-ovmf to be able to still use a loop over _arch_list.

Added:
  edk2/trunk/70-edk2-armvirt-aarch64.json
Modified:
  edk2/trunk/PKGBUILD

------------------------------+
 70-edk2-armvirt-aarch64.json |   31 +++++++++++
 PKGBUILD                     |  113 +++++++++++++++++++++++++++++++++--------
 2 files changed, 123 insertions(+), 21 deletions(-)

Added: 70-edk2-armvirt-aarch64.json
===================================================================
--- 70-edk2-armvirt-aarch64.json	                        (rev 0)
+++ 70-edk2-armvirt-aarch64.json	2020-12-03 17:37:22 UTC (rev 402849)
@@ -0,0 +1,31 @@
+{
+    "description": "UEFI firmware for aarch64",
+    "interface-types": [
+        "uefi"
+    ],
+    "mapping": {
+        "device": "flash",
+        "executable": {
+            "filename": "/usr/share/edk2-armvirt/aarch64/QEMU_CODE.fd",
+            "format": "raw"
+        },
+        "nvram-template": {
+            "filename": "/usr/share/edk2-armvirt/aarch64/QEMU_VARS.fd",
+            "format": "raw"
+        }
+    },
+    "targets": [
+        {
+            "architecture": "aarch64",
+            "machines": [
+                "virt-*"
+            ]
+        }
+    ],
+    "features": [
+        "verbose-static"
+    ],
+    "tags": [
+
+    ]
+}

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-12-03 16:46:09 UTC (rev 402848)
+++ PKGBUILD	2020-12-03 17:37:22 UTC (rev 402849)
@@ -3,14 +3,14 @@
 _brotli_ver=1.0.7
 _openssl_ver=1.1.1h
 pkgbase=edk2
-pkgname=('edk2-shell' 'edk2-ovmf')
-pkgver=202008
+pkgname=('edk2-armvirt' 'edk2-shell' 'edk2-ovmf')
+pkgver=202011
 pkgrel=1
 pkgdesc="Modern, feature-rich firmware development environment for the UEFI specifications"
 arch=('any')
 url="https://github.com/tianocore/edk2"
 license=('BSD')
-makedepends=('acpica' 'iasl' 'util-linux-libs' 'nasm' 'python')
+makedepends=('aarch64-linux-gnu-gcc' 'acpica' 'iasl' 'util-linux-libs' 'nasm' 'python')
 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}
@@ -18,8 +18,9 @@
         "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=('c32340104f27b9b85f79e934cc9eeb739d47b01e13975c88f39b053e9bc5a1ecfe579ab3b63fc7747cc328e104b337b53d41deb4470c3f20dbbd5552173a4666'
+        "60-edk2-ovmf-x86_64.json"
+        "70-edk2-armvirt-aarch64.json")
+sha512sums=('53e9d2dcc2d4a885e6c48b87195e361ea1263de5501c62b22ad37a4ec350b4e171ea580fbb151874ec474a6b202fa7114d440ef9d2673bc9aff7a295c89ea2a0'
             'da50fd99325841ed7a4367d9251c771ce505a443a73b327d8a46b2c6a7d2ea99e43551a164efc86f8743b22c2bdb0020bf24a9cbd445e9d68868b2dc1d34033a'
             'SKIP'
             'a82362aa36d2f2094bca0b2808d9de0d57291fb3a4c29d7c0ca0a37e73087ec5ac4df299c8c363e61106fccf2fe7f58b5cf76eb97729e2696058ef43b1d3930a'
@@ -26,9 +27,19 @@
             '55e4187b11b27737f61e528c02ff43b9381c0cb09140e803531616766f9cb9401115d88d946b56171784cc028f9571279640eb39b6a9fa8e02ec0c8d1b036a3e'
             'a1236585b30d720540de2e9527d8c90ff2d428e800b3da545b23461dc698dc91fe441b62bb8cbca76e08f4ec1eb485619e9ab26157deb06e7fb33e7f5f9dd8b6'
             'c81e072aabfb01d29cf5194111524e2c4c8684979de6b6793db10299c95bb94f7b1d0a98b057df0664d7a894a2b40e9b4c3576112fae400a95eaf5fe5fc9369b'
-            '2030dc1d49d56fce8af56c5777fd40f04041e39ff806dd8c021e161227bdd646982024db6758230b8332dc68f16bc6918e1d54ad3c022e21e148d6b65ea778b3')
+            '2030dc1d49d56fce8af56c5777fd40f04041e39ff806dd8c021e161227bdd646982024db6758230b8332dc68f16bc6918e1d54ad3c022e21e148d6b65ea778b3'
+            'fa6d36a3c0225e4a5df532e77b18a035d65b0856d6a48875def5007de3f83d8d1d202d5b91e887d424112a3fa377dc9a09bdf44e5fcdccc36854675f95a211a4')
+b2sums=('bd79f68f051226fa7de4d0d3035b3274ac0907d8471ba7aee123abff6fb1c72205abb6a7178ed3d07b00b6ee82d8d3c0e97c81013d9906733f95644e847bb209'
+        'ac9ba6fb0c4da0a761e8655b6907634365ddb114216acfcfc981e13c211577b6bd23ea8d2ad0999c0960b039f5d3dead5733e6dc07c5231ab953307a9015cd36'
+        'SKIP'
+        'b9fc554cd23c8387b648638b6f9bb2d29fa87035856d03cf284662f9281984f3bf8e40109e61155ece18673f4391bc0fff704f8ab800a2041d3ce1824478d2ae'
+        '96502e0c8b748d6db0fcd4e767264f778319b4517fe4bf2e6e4f92e35bf09f388fb7f39c349e66444368820c31a6ff76e952053ac9f9696a59f7f0a929a650d1'
+        '4a438a2f7726c6a9ff1a40506ddb5f724d5c220b57997784fefe4a180e249b4f1e9adc8e353e7dbc492a1bde0165442d873409656ce2fbbc9fd35c690b7692e4'
+        '5da17cfe08368542f04b47121b296c56a6702233207b1cdb822eea42c8fb43d8856e86d19122621caf97e4332814c839204d7ce191041128ee3921b23f137bb6'
+        '1b935f3ad0bd3f10a90430a2873bf592950e9c49c828b50bb1ae48634cee01cc571aeff1c5b4695e0b4faa6274afc0a92fdcc88e283029298bba5e11b2bd2904'
+        '2fd510c533913bbd13fa31b3fdc8c4435bb3dee4ae8d34a516344da7a31ee036b23ac21e09b59b11f507520abeea89271601228f485ee80866bade0140c81742')
 validpgpkeys=('8657ABB260F056B1E5190839D9C4D26D0E604491') # Matt Caswell <matt at openssl.org>
-_arch_list=('IA32' 'X64')
+_arch_list=('AARCH64' 'IA32' 'X64')
 _build_type='RELEASE'
 _build_plugin='GCC5'
 
@@ -52,7 +63,13 @@
 
 build() {
   cd "$pkgbase-$pkgver"
+  export GCC5_IA32_PREFIX="x86_64-linux-gnu-"
+  export GCC5_X64_PREFIX="x86_64-linux-gnu-"
+  export GCC5_AARCH64_PREFIX="aarch64-linux-gnu-"
   local _arch
+  echo "Building base tools (AARCH64)"
+  ARCH=AARCH64 make -C BaseTools
+  echo "Building base tools"
   make -C BaseTools
   . edksetup.sh
   for _arch in ${_arch_list[@]}; do
@@ -123,12 +140,56 @@
                        -D TLS_ENABLE \
                        -D HTTP_BOOT_ENABLE
     fi
+    if [[ "${_arch}" == 'AARCH64' ]]; then
+      echo "Building ovmf (${_arch}) with secure boot"
+      BaseTools/BinWrappers/PosixLike/build -p "ArmVirtPkg/ArmVirtQemu.dsc" \
+                                            -a "${_arch}" \
+                                            -b "${_build_type}" \
+                                            -n "$(nproc)" \
+                                            -t "${_build_plugin}" \
+                                            -D NETWORK_IP6_ENABLE \
+                                            -D NETWORK_HTTP_BOOT_ENABLE \
+                                            -D NETWORK_TLS_ENABLE \
+                                            -D SECURE_BOOT_ENABLE \
+                                            -D TPM_ENABLE \
+                                            -D TPM_CONFIG_ENABLE
+      dd if="/dev/zero" \
+        of="Build/ArmVirtQemu-${_arch}/${_build_type}_${_build_plugin}/FV/QEMU_CODE.fd" \
+        bs=1M count=64
+      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
+      dd if="/dev/zero" \
+        of="Build/ArmVirtQemu-${_arch}/${_build_type}_${_build_plugin}/FV/QEMU_VARS.fd" \
+        bs=1M count=64
+    fi
   done
 }
 
+package_edk2-armvirt() {
+  pkgdesc="Firmware for Virtual Machines (aarch64)"
+  local _arch=AARCH64
+
+  cd "$pkgbase-$pkgver"
+  install -vDm 644 "Build/ArmVirtQemu-${_arch}/${_build_type}_${_build_plugin}/FV/"*.fd \
+    -t "${pkgdir}/usr/share/${pkgname}/${_arch,,}/"
+  # add libvirt compatibility (which hardcodes the following paths)
+  install -vdm 755 "${pkgdir}/usr/share/AAVMF"
+  ln -svf "/usr/share/${pkgname}/${_arch,,}/QEMU_CODE.fd" \
+    "${pkgdir}/usr/share/AAVMF/AAVMF_CODE.fd"
+  ln -svf "/usr/share/${pkgname}/${_arch,,}/QEMU_VARS.fd" \
+    "${pkgdir}/usr/share/AAVMF/AAVMF_VARS.fd"
+  # install qemu descriptors in accordance with qemu:
+  # https://git.qemu.org/?p=qemu.git;a=tree;f=pc-bios/descriptors
+  install -vDm 644 ../*"${pkgname}"*.json -t "${pkgdir}/usr/share/qemu/firmware"
+  # license
+  install -vDm 644 License.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
+}
+
 package_edk2-shell() {
   pkgdesc="EDK2 UEFI Shell"
   provides=('uefi-shell')
+
   cd "$pkgbase-$pkgver"
   local _arch
   # minimal UEFI shell, as defined in ShellPkg/Application/Shell/ShellPkg.inf
@@ -136,10 +197,15 @@
   # full UEFI shell, as defined in ShellPkg/ShellPkg.dsc
   local _full='EA4BB293-2D7F-4456-A681-1F22F42CD0BC'
   for _arch in ${_arch_list[@]}; do
-    install -vDm 644 "Build/Shell/${_build_type}_${_build_plugin}/${_arch}/Shell_${_min}.efi" \
-      "${pkgdir}/usr/share/${pkgname}/${_arch,,}/Shell.efi"
-    install -vDm 644 "Build/Shell/${_build_type}_${_build_plugin}/${_arch}/Shell_${_full}.efi" \
-      "${pkgdir}/usr/share/${pkgname}/${_arch,,}/Shell_Full.efi"
+    if [[ "${_arch}" == 'AARCH64' ]]; then
+      install -vDm 644 "Build/ArmVirtQemu-${_arch}/${_build_type}_${_build_plugin}/${_arch}/Shell.efi" \
+        -t "${pkgdir}/usr/share/${pkgname}/${_arch,,}/"
+    else
+      install -vDm 644 "Build/Shell/${_build_type}_${_build_plugin}/${_arch}/Shell_${_min}.efi" \
+        "${pkgdir}/usr/share/${pkgname}/${_arch,,}/Shell.efi"
+      install -vDm 644 "Build/Shell/${_build_type}_${_build_plugin}/${_arch}/Shell_${_full}.efi" \
+        "${pkgdir}/usr/share/${pkgname}/${_arch,,}/Shell_Full.efi"
+    fi
   done
   # license
   install -vDm 644 License.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
@@ -149,25 +215,30 @@
 }
 
 package_edk2-ovmf() {
-  pkgdesc="Open Virtual Machine Firmware to support firmware for Virtual Machines"
+  pkgdesc="Firmware for Virtual Machines (x86_64, i686)"
   provides=('ovmf')
   conflicts=('ovmf')
   replaces=('ovmf')
   license+=('MIT')
   install="${pkgname}.install"
+
   cd "$pkgbase-$pkgver"
   local _arch
   # installing the various firmwares
   for _arch in ${_arch_list[@]}; do
-    # installing OVMF.fd for xen: https://bugs.archlinux.org/task/58635
-    install -vDm 644 "Build/Ovmf${_arch}/${_build_type}_${_build_plugin}/FV/OVMF.fd" \
-      -t "${pkgdir}/usr/share/${pkgname}/${_arch,,}"
-    install -vDm 644 "Build/Ovmf${_arch}/${_build_type}_${_build_plugin}/FV/OVMF_CODE.fd" \
-      -t "${pkgdir}/usr/share/${pkgname}/${_arch,,}"
-    install -vDm 644 "Build/Ovmf${_arch}/${_build_type}_${_build_plugin}/FV/OVMF_VARS.fd" \
-      -t "${pkgdir}/usr/share/${pkgname}/${_arch,,}"
-    install -vDm 644 "Build/Ovmf${_arch}-secure/${_build_type}_${_build_plugin}/FV/OVMF_CODE.fd" \
-      "${pkgdir}/usr/share/${pkgname}/${_arch,,}/OVMF_CODE.secboot.fd"
+    if [[ "${_arch}" == 'AARCH64' ]]; then
+      continue
+    else
+      # installing OVMF.fd for xen: https://bugs.archlinux.org/task/58635
+      install -vDm 644 "Build/Ovmf${_arch}/${_build_type}_${_build_plugin}/FV/OVMF.fd" \
+        -t "${pkgdir}/usr/share/${pkgname}/${_arch,,}"
+      install -vDm 644 "Build/Ovmf${_arch}/${_build_type}_${_build_plugin}/FV/OVMF_CODE.fd" \
+        -t "${pkgdir}/usr/share/${pkgname}/${_arch,,}"
+      install -vDm 644 "Build/Ovmf${_arch}/${_build_type}_${_build_plugin}/FV/OVMF_VARS.fd" \
+        -t "${pkgdir}/usr/share/${pkgname}/${_arch,,}"
+      install -vDm 644 "Build/Ovmf${_arch}-secure/${_build_type}_${_build_plugin}/FV/OVMF_CODE.fd" \
+        "${pkgdir}/usr/share/${pkgname}/${_arch,,}/OVMF_CODE.secboot.fd"
+    fi
   done
   # installing qemu descriptors in accordance with qemu:
   # https://git.qemu.org/?p=qemu.git;a=tree;f=pc-bios/descriptors



More information about the arch-commits mailing list