Gentoo Archives: gentoo-commits

From: John Helmert III <ajak@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-firmware/edk2-ovmf/
Date: Tue, 27 Sep 2022 03:27:26
Message-Id: 1664249184.87be87f70b4393527fb9f4c5f141c0dbb3f24968.ajak@gentoo
1 commit: 87be87f70b4393527fb9f4c5f141c0dbb3f24968
2 Author: John Helmert III <ajak <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 27 02:45:28 2022 +0000
4 Commit: John Helmert III <ajak <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 27 03:26:24 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=87be87f7
7
8 sys-firmware/edk2-ovmf: drop 202105-r1
9
10 Signed-off-by: John Helmert III <ajak <AT> gentoo.org>
11
12 sys-firmware/edk2-ovmf/edk2-ovmf-202105-r1.ebuild | 176 ----------------------
13 1 file changed, 176 deletions(-)
14
15 diff --git a/sys-firmware/edk2-ovmf/edk2-ovmf-202105-r1.ebuild b/sys-firmware/edk2-ovmf/edk2-ovmf-202105-r1.ebuild
16 deleted file mode 100644
17 index c316a3faf1bd..000000000000
18 --- a/sys-firmware/edk2-ovmf/edk2-ovmf-202105-r1.ebuild
19 +++ /dev/null
20 @@ -1,176 +0,0 @@
21 -# Copyright 1999-2021 Gentoo Authors
22 -# Distributed under the terms of the GNU General Public License v2
23 -
24 -EAPI=7
25 -
26 -PYTHON_REQ_USE="sqlite"
27 -PYTHON_COMPAT=( python3_{8,9,10} )
28 -
29 -inherit python-any-r1 readme.gentoo-r1
30 -
31 -DESCRIPTION="UEFI firmware for 64-bit x86 virtual machines"
32 -HOMEPAGE="https://github.com/tianocore/edk2"
33 -
34 -BUNDLED_OPENSSL_SUBMODULE_SHA="e2e09d9fba1187f8d6aafaa34d4172f56f1ffb72"
35 -BUNDLED_BROTLI_SUBMODULE_SHA="666c3280cc11dc433c303d79a83d4ffbdd12cc8d"
36 -
37 -# TODO: talk with tamiko about unbundling (mva)
38 -
39 -# TODO: the binary 202105 package currently lacks the preseeded
40 -# OVMF_VARS.secboot.fd file (that we typically get from fedora)
41 -
42 -SRC_URI="
43 - !binary? (
44 - https://github.com/tianocore/edk2/archive/edk2-stable${PV}.tar.gz -> ${P}.tar.gz
45 - https://github.com/openssl/openssl/archive/${BUNDLED_OPENSSL_SUBMODULE_SHA}.tar.gz -> openssl-${BUNDLED_OPENSSL_SUBMODULE_SHA}.tar.gz
46 - https://github.com/google/brotli/archive/${BUNDLED_BROTLI_SUBMODULE_SHA}.tar.gz -> brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}.tar.gz
47 - )
48 - binary? ( https://dev.gentoo.org/~tamiko/distfiles/${PF}-bin.tar.xz )
49 - https://dev.gentoo.org/~tamiko/distfiles/${P}-qemu-firmware.tar.xz
50 -"
51 -
52 -LICENSE="BSD-2 MIT"
53 -SLOT="0"
54 -KEYWORDS="amd64 arm64 ~ppc ppc64 x86"
55 -
56 -IUSE="+binary"
57 -REQUIRED_USE+="
58 - !amd64? ( binary )
59 -"
60 -
61 -NON_BINARY_DEPEND="
62 - app-emulation/qemu
63 - >=dev-lang/nasm-2.0.7
64 - >=sys-power/iasl-20160729
65 - ${PYTHON_DEPS}
66 -"
67 -
68 -DEPEND+="
69 - !binary? (
70 - amd64? (
71 - ${NON_BINARY_DEPEND}
72 - )
73 - )"
74 -RDEPEND=""
75 -
76 -PATCHES=(
77 - "${FILESDIR}/${PN}-202105-werror.patch"
78 -)
79 -
80 -S="${WORKDIR}/edk2-edk2-stable${PV}"
81 -
82 -DISABLE_AUTOFORMATTING=true
83 -DOC_CONTENTS="This package contains the tianocore edk2 UEFI firmware for 64-bit x86
84 -virtual machines. The firmware is located under
85 - /usr/share/edk2-ovmf/OVMF_CODE.fd
86 - /usr/share/edk2-ovmf/OVMF_VARS.fd
87 - /usr/share/edk2-ovmf/OVMF_CODE.secboot.fd
88 -
89 -If USE=binary is enabled, we also install an OVMF variables file (coming from
90 -fedora) that contains secureboot default keys
91 -
92 - /usr/share/edk2-ovmf/OVMF_VARS.secboot.fd
93 -
94 -If you have compiled this package by hand, you need to either populate all
95 -necessary EFI variables by hand by booting
96 - /usr/share/edk2-ovmf/UefiShell.(iso|img)
97 -or creating OVMF_VARS.secboot.fd by hand:
98 - https://github.com/puiterwijk/qemu-ovmf-secureboot
99 -
100 -The firmware does not support csm (due to no free csm implementation
101 -available). If you need a firmware with csm support you have to download
102 -one for yourself. Firmware blobs are commonly labeled
103 - OVMF{,_CODE,_VARS}-with-csm.fd
104 -
105 -In order to use the firmware you can run qemu the following way
106 -
107 - $ qemu-system-x86_64 \
108 - -drive file=/usr/share/edk2-ovmf/OVMF.fd,if=pflash,format=raw,unit=0,readonly=on \
109 - ..."
110 -
111 -pkg_setup() {
112 - [[ ${PV} != "999999" ]] && use binary || python-any-r1_pkg_setup
113 -}
114 -
115 -src_prepare() {
116 - if use binary; then
117 - eapply_user
118 - else
119 - # Bundled submodules
120 - cp -rl "${WORKDIR}/openssl-${BUNDLED_OPENSSL_SUBMODULE_SHA}"/* "CryptoPkg/Library/OpensslLib/openssl/"
121 - cp -rl "${WORKDIR}/brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}"/* "BaseTools/Source/C/BrotliCompress/brotli/"
122 - cp -rl "${WORKDIR}/brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}"/* "MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/"
123 -
124 - sed -i -r \
125 - -e "/function SetupPython3/,/\}/{s,\\\$\(whereis python3\),${EPYTHON},g}" \
126 - "${S}"/edksetup.sh || die "Fixing for correct Python3 support failed"
127 -
128 - default
129 - fi
130 -}
131 -
132 -src_compile() {
133 - TARGET_ARCH=X64
134 - TARGET_NAME=RELEASE
135 - TARGET_TOOLS=GCC49
136 -
137 - BUILD_FLAGS="-D TLS_ENABLE \
138 - -D HTTP_BOOT_ENABLE \
139 - -D NETWORK_IP6_ENABLE \
140 - -D TPM_ENABLE \
141 - -D TPM2_ENABLE -D TPM2_CONFIG_ENABLE \
142 - -D FD_SIZE_2MB"
143 -
144 - SECUREBOOT_BUILD_FLAGS="${BUILD_FLAGS} \
145 - -D SECURE_BOOT_ENABLE \
146 - -D SMM_REQUIRE \
147 - -D EXCLUDE_SHELL_FROM_FD"
148 -
149 - [[ ${PV} != "999999" ]] && use binary && return
150 -
151 - emake ARCH=${TARGET_ARCH} -C BaseTools
152 -
153 - . ./edksetup.sh
154 -
155 - # Build all EFI firmware blobs:
156 -
157 - mkdir -p ovmf
158 -
159 - ./OvmfPkg/build.sh \
160 - -a "${TARGET_ARCH}" -b "${TARGET_NAME}" -t "${TARGET_TOOLS}" \
161 - ${BUILD_FLAGS} || die "OvmfPkg/build.sh failed"
162 -
163 - cp Build/OvmfX64/*/FV/OVMF_*.fd ovmf/
164 - rm -rf Build/OvmfX64
165 -
166 - ./OvmfPkg/build.sh \
167 - -a "${TARGET_ARCH}" -b "${TARGET_NAME}" -t "${TARGET_TOOLS}" \
168 - ${SECUREBOOT_BUILD_FLAGS} || die "OvmfPkg/build.sh failed"
169 -
170 - cp Build/OvmfX64/*/FV/OVMF_CODE.fd ovmf/OVMF_CODE.secboot.fd || die "cp failed"
171 - cp Build/OvmfX64/*/X64/Shell.efi ovmf/ || die "cp failed"
172 - cp Build/OvmfX64/*/X64/EnrollDefaultKeys.efi ovmf || die "cp failed"
173 -
174 - # Build a convenience UefiShell.img:
175 -
176 - mkdir -p iso_image/efi/boot || die "mkdir failed"
177 - cp ovmf/Shell.efi iso_image/efi/boot/bootx64.efi || die "cp failed"
178 - cp ovmf/EnrollDefaultKeys.efi iso_image || die "cp failed"
179 - qemu-img convert --image-opts \
180 - driver=vvfat,floppy=on,fat-type=12,label=UEFI_SHELL,dir=iso_image \
181 - ovmf/UefiShell.img || die "qemu-img failed"
182 -}
183 -
184 -src_install() {
185 - insinto /usr/share/${PN}
186 - doins ovmf/*
187 -
188 - insinto /usr/share/qemu/firmware
189 - doins qemu/*
190 -
191 - readme.gentoo_create_doc
192 -}
193 -
194 -pkg_postinst() {
195 - readme.gentoo_print_elog
196 -}