summaryrefslogtreecommitdiff
path: root/sys-firmware
diff options
context:
space:
mode:
Diffstat (limited to 'sys-firmware')
-rw-r--r--sys-firmware/Manifest.gzbin5373 -> 5704 bytes
-rw-r--r--sys-firmware/edk2-ovmf-bin/Manifest3
-rw-r--r--sys-firmware/edk2-ovmf-bin/edk2-ovmf-bin-202202.ebuild69
-rw-r--r--sys-firmware/edk2-ovmf-bin/metadata.xml8
-rw-r--r--sys-firmware/edk2-ovmf/Manifest5
-rw-r--r--sys-firmware/edk2-ovmf/edk2-ovmf-202202.ebuild148
-rw-r--r--sys-firmware/seabios-bin/Manifest3
-rw-r--r--sys-firmware/seabios-bin/metadata.xml8
-rw-r--r--sys-firmware/seabios-bin/seabios-bin-1.16.0.ebuild25
-rw-r--r--sys-firmware/seabios/Manifest3
-rw-r--r--sys-firmware/seabios/files/README2
-rw-r--r--sys-firmware/seabios/seabios-1.16.0.ebuild142
12 files changed, 413 insertions, 3 deletions
diff --git a/sys-firmware/Manifest.gz b/sys-firmware/Manifest.gz
index 208411a2755d..e5fb48f5da25 100644
--- a/sys-firmware/Manifest.gz
+++ b/sys-firmware/Manifest.gz
Binary files differ
diff --git a/sys-firmware/edk2-ovmf-bin/Manifest b/sys-firmware/edk2-ovmf-bin/Manifest
new file mode 100644
index 000000000000..33ebc8175b0f
--- /dev/null
+++ b/sys-firmware/edk2-ovmf-bin/Manifest
@@ -0,0 +1,3 @@
+DIST edk2-ovmf-202202-1.xpak 2672386 BLAKE2B 75c15d4379610ab2af85b78166e350d52f4f1bc1fff5b2eb693ad0d7b1f6648e65d8ae3e2c5467f93f1557ad3b4fa664ab2d76ff10794667de22c2ea8cca6b2d SHA512 06783b89c96bada0fd025ff39eaee501a027abcb03c0bdcf3ff497d52be22927ab03013d90f145ee94a8662cfffe4f8c154dcd06db1bb1acef8a85ae43de14a3
+EBUILD edk2-ovmf-bin-202202.ebuild 2116 BLAKE2B 2560bcf5e338cfecf6531882e97a4d7528fc938182ce1bc8376e10dd484cf51f7b42c2723e7e96ed51f9ecef5f03551a33a4a5af3bf0a5fe42d8b31b8ebb13de SHA512 962a16c7a9540361bc3f79e56422c871998efb85bb4683360983b9bc2acc0d18eb775a4500d4a681b78337528a04a501cee7fd2792eadc800deca6755383f208
+MISC metadata.xml 272 BLAKE2B 27a9c4c06a3f01a09abd1c554d9682f0248cd486fa866be62e1e63fcd59c57df6ab036d307b91c4c509bf1190aa5a1620c5995e98fb518bad215eb94b024e2f6 SHA512 aaaaf0683baa09807a821ff4eff365008ee8f7cd7852fb042e7d0aa40cfcc8b192f3bd7bdee6c4cdaad2621b9ad42ea0a5784eb93e0923641e02f8aa24e562fe
diff --git a/sys-firmware/edk2-ovmf-bin/edk2-ovmf-bin-202202.ebuild b/sys-firmware/edk2-ovmf-bin/edk2-ovmf-bin-202202.ebuild
new file mode 100644
index 000000000000..7b35ffe6dc9e
--- /dev/null
+++ b/sys-firmware/edk2-ovmf-bin/edk2-ovmf-bin-202202.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit readme.gentoo-r1
+
+BINPKG="${P/-bin/}-1"
+
+DESCRIPTION="UEFI firmware for 64-bit x86 virtual machines"
+HOMEPAGE="https://github.com/tianocore/edk2"
+SRC_URI="https://dev.gentoo.org/~ajak/distfiles/${BINPKG}.xpak"
+S="${WORKDIR}"
+
+# TODO: the binary 202105 package currently lacks the preseeded
+# OVMF_VARS.secboot.fd file (that we typically get from fedora)
+
+LICENSE="BSD-2 MIT"
+SLOT="0"
+#KEYWORDS="~amd64 ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86"
+
+RDEPEND="!sys-firmware/edk2-ovmf"
+
+DISABLE_AUTOFORMATTING=true
+DOC_CONTENTS="This package contains the tianocore edk2 UEFI firmware for 64-bit x86
+virtual machines. The firmware is located under
+ /usr/share/edk2-ovmf/OVMF_CODE.fd
+ /usr/share/edk2-ovmf/OVMF_VARS.fd
+ /usr/share/edk2-ovmf/OVMF_CODE.secboot.fd
+
+If USE=binary is enabled, we also install an OVMF variables file (coming from
+fedora) that contains secureboot default keys
+
+ /usr/share/edk2-ovmf/OVMF_VARS.secboot.fd
+
+If you have compiled this package by hand, you need to either populate all
+necessary EFI variables by hand by booting
+ /usr/share/edk2-ovmf/UefiShell.(iso|img)
+or creating OVMF_VARS.secboot.fd by hand:
+ https://github.com/puiterwijk/qemu-ovmf-secureboot
+
+The firmware does not support csm (due to no free csm implementation
+available). If you need a firmware with csm support you have to download
+one for yourself. Firmware blobs are commonly labeled
+ OVMF{,_CODE,_VARS}-with-csm.fd
+
+In order to use the firmware you can run qemu the following way
+
+ $ qemu-system-x86_64 \
+ -drive file=/usr/share/edk2-ovmf/OVMF.fd,if=pflash,format=raw,unit=0,readonly=on \
+ ..."
+
+src_unpack() {
+ tar -x < <(xz -c -d --single-stream "${DISTDIR}/${BINPKG}.xpak") || die "unpacking binpkg failed"
+}
+
+src_install() {
+ mv "usr/share/doc/${P/-bin/}" "usr/share/doc/${PF}" || die
+
+ # Don't want to try to install the readme from the source package
+ rm "usr/share/doc/${PF}/README.gentoo.bz2"
+ mv usr "${ED}" || die
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+}
diff --git a/sys-firmware/edk2-ovmf-bin/metadata.xml b/sys-firmware/edk2-ovmf-bin/metadata.xml
new file mode 100644
index 000000000000..cfac6f8ac4ff
--- /dev/null
+++ b/sys-firmware/edk2-ovmf-bin/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>virtualization@gentoo.org</email>
+ <name>Gentoo Virtualization Project</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-firmware/edk2-ovmf/Manifest b/sys-firmware/edk2-ovmf/Manifest
index b56deec41d48..d9cf218886fe 100644
--- a/sys-firmware/edk2-ovmf/Manifest
+++ b/sys-firmware/edk2-ovmf/Manifest
@@ -1,9 +1,14 @@
AUX edk2-ovmf-202105-werror.patch 2355 BLAKE2B 6ce16c0181da1922130209141cde93d1d0407c62f31927270dfe684ebe58cdda94269566231f5b5d0dbb8c1fbde55bd62be881925547d0b1d38b90563e3f480c SHA512 bca368756bab75345e4010b3c0eaa0d3e6a34e172aa662e09a4c89f90d4b4bc6a20a28b7bce5b0fdd678f7f9113193d09a89e49b5d1d6b8a362c445b4098189f
DIST brotli-666c3280cc11dc433c303d79a83d4ffbdd12cc8d.tar.gz 23855739 BLAKE2B 7406ec5b29ac66afbcd7c1376bb3208f298d19b6592b2869c52173aa64947d58bd443f9a61c67deaf046be910a0e31c0b843e5508e97e0e1f5e7bce100d86904 SHA512 df8e90562c4fd7f0e787949df6bc4f5a165b39bd333f442d27874fe65640fbba268f9350d7113e6761a5acceb66d78e75f1a296e5a89b94574edf28109cdc812
+DIST brotli-f4153a09f87cbb9c826d8fc12c74642bb2d879ea.tar.gz 512229 BLAKE2B cd86cc2cc7eefad24f87cda8006409bf764922b5f23ccfb951e7a41214b12004ce532b11f94f5fb858b3bf71f9abf8ef17ba219fa96bd5be23b51873afad0fd5 SHA512 7f48e794e738b31c2005e7cef6d8c0cc0d543f1cd8c137ae8ba14602cac2873de6299a3f32ad52be869f513e7548341353ed049609daef1063975694d9a9b80b
DIST edk2-ovmf-202105-qemu-firmware.tar.xz 672 BLAKE2B e87845a84c83f65db836fd054c81a4f3062d5e0fcc51aa0ecf9c2d23c8741f218d38ef737d140f5935ce8d9c34508e5f3b9f54bf9c547a391fa63cdc2ecf1233 SHA512 6100502f26db26e407dacce57c96b1abfd372bcb31767a068332afa09ac435a092fd2a73db27670d27c6e927c26e88315346bbac70578571108434b9683bd00c
DIST edk2-ovmf-202105-r1-bin.tar.xz 2633188 BLAKE2B 93b4bd1c75da69406b5d27ac32d8b7c63dc8248bcd5d54832e520a4b009be4b7f215eb7d489ecb7cb16d31e02452dfa06b8fa709f37c44e59b4ff70a550076c7 SHA512 356c2110abce43da9c0654324e222cbbab7085e3aa23d1ba4c98011e4d4992a37d61fa45394305b748d119dba12f65d7c7d630b9f8038065ba4672d758c702be
DIST edk2-ovmf-202105.tar.gz 13702868 BLAKE2B 3ec01d467562380ca2fd3bd807d2f6c55e4637c1afd71533f8f5b22cc634dc4c8cb63dab921677f8b315d17b3c9d0b6b00a0e2f3f8da61107033e9e81bf5a64d SHA512 c263345cbb243c63985f974a61f37c577a139d6a7099d2b8c9e1a553e5ebf16de12fb711b72624081c6bf637f8084bbf71731ab99e5747d81da460388ac25791
+DIST edk2-ovmf-202202-qemu-firmware.tar.xz 664 BLAKE2B 1aa4e25804ce0f3c967c80999315de24eaef6682e42dddd81c274ce4603ec3d15186de752de49e2527c6bd5517080c002a357ed6bc389b5afd6f7a4d93edeb44 SHA512 f9a29212274a99796784673d873e0eee7d3e2a5cf9e63192453841ee3a4ef4b813c7b2357fc7000f39c71ed6c66636daab772abb51d3972a2a56ade8a4c68faf
+DIST edk2-ovmf-202202.tar.gz 14208170 BLAKE2B d8411e6808b335ccd551349a10c983b9448a357e73273fa6c30a07785e27feffed0224950ee98b668712c33f6739a9b006e5043b7dfd014f48dba9fd449b3354 SHA512 200690a4867331de06e0478869b85577bc510213ebe679f2103160efb84d94c82ac8481ef1f15c3e42c1e9f22b7c5ef0d6c8f2c655bce7702ce843551cf9bb83
+DIST openssl-d82e959e621a3d597f1e0d50ff8c2d8b96915fd7.tar.gz 10034310 BLAKE2B 6996979dc12a523d565830e7b0943feb682a376f71ddb6f20cb8b9976bb7f12e39f088abaa45d514933ef79c0e4a2933dc6f1af4774fedaa16e74c0081c358e7 SHA512 a89bc652dc4318c5e8a9c594a43d890ca05dfc1acd6b15e2a8ab8b5628b5f33994143ff8024230e07b9e67556b28ea3a5e36763aa72dec20b52022ca8c6f2a7e
DIST openssl-e2e09d9fba1187f8d6aafaa34d4172f56f1ffb72.tar.gz 9981169 BLAKE2B 33aac7364cdd45fec5654ab6caef84e1a829464380419c8a6bb311055c5a01c0aaff6e046a7c541a87e908fa9d26bae652f5be901461d03df36f2522f9c34b0c SHA512 db2087c04f0b428b3f4e1c8b3ac53cce69e0fd331ed2b86ba00facafd1685864d73f71c13eee48f4fe0af2bddad848f84a2b8ed2a17fabdf7fa2ed7d9eb39371
EBUILD edk2-ovmf-202105-r1.ebuild 4974 BLAKE2B 34c7b4ec472917c3ab586ef6dbbd9a0814dc7d284311b94846c981dfd02e50de8d4f7612a3cb3ffc68bd74fb1194a97cf03634d70736010429cce3b6cea3f597 SHA512 b867679dc71db66f6aec9f54551c7feaf2cd2e9084f7f27b623b62d40aba52c5fc96c4db24b9609bc0d131158de3382768ac2efef408df9b23be015cf7d962a9
EBUILD edk2-ovmf-202105-r2.ebuild 5079 BLAKE2B 5b55efe51f30d9d4c64d1d0c2a1b3ee7a5fc9633027da4f09820ca4596a894ce079bb4d08368a0fb4dd2d7be42df8e591230094221daf0710542439a0fe70cdc SHA512 b4c578c2d52625fd510f35b69a12e638271e8f33247e8fc9dcbde3779cc65b6ed3e6fdd1527a9838e6e68ebf1c5233cf07d38245fa16da5f6aa61da374c29f1e
+EBUILD edk2-ovmf-202202.ebuild 4658 BLAKE2B 56dade1ad8b694f47ff515bdb1106d708a6f0e37677e6e5e21e75b738d56a3ebcdc5708eb35670eb849622064bede8c8c00c1a405f1b401a3f4225b6c1467792 SHA512 65c42cc8bf8e3ec781c3466ced4d058ecacdd8f7d5512b682dd733dbe582e0d5a039cfa87f36fa3677a6e07284d83b193bb6bb16892bbc37bf03e422aeb02049
MISC metadata.xml 436 BLAKE2B 091a94f2295817e420f919cc87c89b2ac5aab07f7d1b3279fa153bd89395ed9278d429aa75aa0aa3820ad9ee9400e80c1d4f56a3940eb8b37e39f767438f508a SHA512 d5854375acb0fcdf482458d80f0f916389cba9709a9cdc61ff9dc6ffc8bf5a145445fdf252fe543ea7d25ccd0491089b56aff32c7a30d7470be63acc30ad81d7
diff --git a/sys-firmware/edk2-ovmf/edk2-ovmf-202202.ebuild b/sys-firmware/edk2-ovmf/edk2-ovmf-202202.ebuild
new file mode 100644
index 000000000000..84319b7c4af0
--- /dev/null
+++ b/sys-firmware/edk2-ovmf/edk2-ovmf-202202.ebuild
@@ -0,0 +1,148 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_REQ_USE="sqlite"
+PYTHON_COMPAT=( python3_{8,9,10} )
+
+inherit python-any-r1 readme.gentoo-r1
+
+DESCRIPTION="UEFI firmware for 64-bit x86 virtual machines"
+HOMEPAGE="https://github.com/tianocore/edk2"
+
+BUNDLED_OPENSSL_SUBMODULE_SHA="d82e959e621a3d597f1e0d50ff8c2d8b96915fd7"
+BUNDLED_BROTLI_SUBMODULE_SHA="f4153a09f87cbb9c826d8fc12c74642bb2d879ea"
+
+# TODO: talk with tamiko about unbundling (mva)
+
+# TODO: the binary 202105 package currently lacks the preseeded
+# OVMF_VARS.secboot.fd file (that we typically get from fedora)
+
+SRC_URI="https://github.com/tianocore/edk2/archive/edk2-stable${PV}.tar.gz -> ${P}.tar.gz
+ https://github.com/openssl/openssl/archive/${BUNDLED_OPENSSL_SUBMODULE_SHA}.tar.gz -> openssl-${BUNDLED_OPENSSL_SUBMODULE_SHA}.tar.gz
+ https://github.com/google/brotli/archive/${BUNDLED_BROTLI_SUBMODULE_SHA}.tar.gz -> brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}.tar.gz
+ https://dev.gentoo.org/~ajak/distfiles/${P}-qemu-firmware.tar.xz"
+
+LICENSE="BSD-2 MIT"
+SLOT="0"
+#KEYWORDS="~amd64"
+
+BDEPEND="app-emulation/qemu
+ >=dev-lang/nasm-2.0.7
+ >=sys-power/iasl-20160729
+ ${PYTHON_DEPS}"
+RDEPEND="!sys-firmware/edk2-ovmf-bin"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-202105-werror.patch"
+)
+
+S="${WORKDIR}/edk2-edk2-stable${PV}"
+
+DISABLE_AUTOFORMATTING=true
+DOC_CONTENTS="This package contains the tianocore edk2 UEFI firmware for 64-bit x86
+virtual machines. The firmware is located under
+ /usr/share/edk2-ovmf/OVMF_CODE.fd
+ /usr/share/edk2-ovmf/OVMF_VARS.fd
+ /usr/share/edk2-ovmf/OVMF_CODE.secboot.fd
+
+If USE=binary is enabled, we also install an OVMF variables file (coming from
+fedora) that contains secureboot default keys
+
+ /usr/share/edk2-ovmf/OVMF_VARS.secboot.fd
+
+If you have compiled this package by hand, you need to either populate all
+necessary EFI variables by hand by booting
+ /usr/share/edk2-ovmf/UefiShell.(iso|img)
+or creating OVMF_VARS.secboot.fd by hand:
+ https://github.com/puiterwijk/qemu-ovmf-secureboot
+
+The firmware does not support csm (due to no free csm implementation
+available). If you need a firmware with csm support you have to download
+one for yourself. Firmware blobs are commonly labeled
+ OVMF{,_CODE,_VARS}-with-csm.fd
+
+In order to use the firmware you can run qemu the following way
+
+ $ qemu-system-x86_64 \
+ -drive file=/usr/share/edk2-ovmf/OVMF.fd,if=pflash,format=raw,unit=0,readonly=on \
+ ..."
+
+src_prepare() {
+ # Bundled submodules
+ cp -rl "${WORKDIR}/openssl-${BUNDLED_OPENSSL_SUBMODULE_SHA}"/* "CryptoPkg/Library/OpensslLib/openssl/"
+ cp -rl "${WORKDIR}/brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}"/* "BaseTools/Source/C/BrotliCompress/brotli/"
+ cp -rl "${WORKDIR}/brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}"/* "MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/"
+
+ sed -i -r \
+ -e "/function SetupPython3/,/\}/{s,\\\$\(whereis python3\),${EPYTHON},g}" \
+ "${S}"/edksetup.sh || die "Fixing for correct Python3 support failed"
+
+ default
+}
+
+src_compile() {
+ TARGET_ARCH=X64
+ TARGET_NAME=RELEASE
+ TARGET_TOOLS=GCC49
+
+ BUILD_FLAGS="-D TLS_ENABLE \
+ -D HTTP_BOOT_ENABLE \
+ -D NETWORK_IP6_ENABLE \
+ -D TPM_ENABLE \
+ -D TPM2_ENABLE -D TPM2_CONFIG_ENABLE \
+ -D FD_SIZE_2MB"
+
+ SECUREBOOT_BUILD_FLAGS="${BUILD_FLAGS} \
+ -D SECURE_BOOT_ENABLE \
+ -D SMM_REQUIRE \
+ -D EXCLUDE_SHELL_FROM_FD"
+
+ emake ARCH=${TARGET_ARCH} -C BaseTools
+
+ . ./edksetup.sh
+
+ # Build all EFI firmware blobs:
+
+ mkdir -p ovmf
+
+ ./OvmfPkg/build.sh \
+ -a "${TARGET_ARCH}" -b "${TARGET_NAME}" -t "${TARGET_TOOLS}" \
+ ${BUILD_FLAGS} || die "OvmfPkg/build.sh failed"
+
+ cp Build/OvmfX64/*/FV/OVMF_*.fd ovmf/
+ rm -rf Build/OvmfX64
+
+ ./OvmfPkg/build.sh \
+ -a "${TARGET_ARCH}" -b "${TARGET_NAME}" -t "${TARGET_TOOLS}" \
+ ${SECUREBOOT_BUILD_FLAGS} || die "OvmfPkg/build.sh failed"
+
+ cp Build/OvmfX64/*/FV/OVMF_CODE.fd ovmf/OVMF_CODE.secboot.fd || die "cp failed"
+ cp Build/OvmfX64/*/X64/Shell.efi ovmf/ || die "cp failed"
+ cp Build/OvmfX64/*/X64/EnrollDefaultKeys.efi ovmf || die "cp failed"
+
+ # Build a convenience UefiShell.img:
+
+ mkdir -p iso_image/efi/boot || die "mkdir failed"
+ cp ovmf/Shell.efi iso_image/efi/boot/bootx64.efi || die "cp failed"
+ cp ovmf/EnrollDefaultKeys.efi iso_image || die "cp failed"
+ qemu-img convert --image-opts \
+ driver=vvfat,floppy=on,fat-type=12,label=UEFI_SHELL,dir=iso_image \
+ ovmf/UefiShell.img || die "qemu-img failed"
+}
+
+src_install() {
+ insinto /usr/share/${PN}
+ doins ovmf/*
+
+ insinto /usr/share/qemu/firmware
+ doins qemu/*
+ rm "${ED}"/usr/share/qemu/firmware/40-edk2-ovmf-x64-sb-enrolled.json || die "rm failed"
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+}
diff --git a/sys-firmware/seabios-bin/Manifest b/sys-firmware/seabios-bin/Manifest
new file mode 100644
index 000000000000..b8f7df6239b7
--- /dev/null
+++ b/sys-firmware/seabios-bin/Manifest
@@ -0,0 +1,3 @@
+DIST seabios-1.16.0-1.xpak 141506 BLAKE2B b2d0cc367ea7ba958604f95dc2a7ab92fd76768e6133552b76d651755cab225eed3e1a6bd350b7f3b5058212390c073e9ca37896412797ac224fb1ce4b5f641a SHA512 4007a6cd40b7c82d1f53450a4151a19d5020ca4c3258b4502f9bfb1c3eacfef1a934794b58d38439e41884cd7a962aa436e22b9194b5731585383fd1476dd688
+EBUILD seabios-bin-1.16.0.ebuild 644 BLAKE2B 77c4246de261f73fdfcabb812325fa0aca14b3c7075cfde4c7f41ab763c8ceaa587f52f87153cb2881ef3f6a6f3e133885b1af219d91fc56887c20109d06f448 SHA512 67516aa0426bf7254d1f77b14b6f4278db0f97878845ea6aa54d546a797123ff4c05f7093289dcfb7fd94be6124cd5c6d9ae3d06a7fd3d4202d25bc18a62134c
+MISC metadata.xml 272 BLAKE2B 27a9c4c06a3f01a09abd1c554d9682f0248cd486fa866be62e1e63fcd59c57df6ab036d307b91c4c509bf1190aa5a1620c5995e98fb518bad215eb94b024e2f6 SHA512 aaaaf0683baa09807a821ff4eff365008ee8f7cd7852fb042e7d0aa40cfcc8b192f3bd7bdee6c4cdaad2621b9ad42ea0a5784eb93e0923641e02f8aa24e562fe
diff --git a/sys-firmware/seabios-bin/metadata.xml b/sys-firmware/seabios-bin/metadata.xml
new file mode 100644
index 000000000000..cfac6f8ac4ff
--- /dev/null
+++ b/sys-firmware/seabios-bin/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>virtualization@gentoo.org</email>
+ <name>Gentoo Virtualization Project</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-firmware/seabios-bin/seabios-bin-1.16.0.ebuild b/sys-firmware/seabios-bin/seabios-bin-1.16.0.ebuild
new file mode 100644
index 000000000000..1632d76b3e55
--- /dev/null
+++ b/sys-firmware/seabios-bin/seabios-bin-1.16.0.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+BINPKG="${P/-bin/}-1"
+
+DESCRIPTION="Open Source implementation of a 16-bit x86 BIOS"
+HOMEPAGE="https://www.seabios.org/"
+SRC_URI="https://dev.gentoo.org/~ajak/distfiles/${BINPKG}.xpak"
+S="${WORKDIR}"
+
+LICENSE="LGPL-3 GPL-3"
+SLOT="0"
+#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+
+RDEPEND="!sys-firmware/seabios"
+
+src_unpack() {
+ tar -x < <(xz -c -d --single-stream "${DISTDIR}/${BINPKG}.xpak") || die "unpacking binpkg failed"
+}
+
+src_install() {
+ mv usr "${ED}" || die
+}
diff --git a/sys-firmware/seabios/Manifest b/sys-firmware/seabios/Manifest
index 10b76e808822..6aafacea3e8d 100644
--- a/sys-firmware/seabios/Manifest
+++ b/sys-firmware/seabios/Manifest
@@ -1,4 +1,3 @@
-AUX README 95 BLAKE2B 1b24d1199d9095bb7620c92be24990add23fa0667373ca1fa267da4ca8d7601250e22068aa572e38658049e150a3b2906849deb4393cbd2ce1ccb5cce994b7bc SHA512 60a67c0b57f8c36a266041d5307fcc8e1302660ffaf855e0f01f0ae8460843b0eeb336a78c48b59e7441738ac5cf9069c868d49daf3015ccf0fa72b8081e1c81
AUX seabios-1.14.0-binutils-2.36.patch 401 BLAKE2B c9ae2113c1eaa9b99ec3c05d77e67a308ba86a6f9ba16691e50937f2fa10da730b3d270b20306b1505730cbb3c9fff0a1602ecc70de75d245986c1508c838a39 SHA512 be60c197071423aacd6d69f3e71223d57d5d740b0790f7b817653affe4489911493ea265ed1245a1960442aeefcd052abd576a8c87fd210d45f64d70c0157eb6
AUX seabios/config.seabios-128k 358 BLAKE2B dc64c17aafbb52f88b0db80314b0b1aab31bdeb6fe692762afe9cf60f9f7868ee8cb65d402f9a4c04c0bf1bf891d566b773f1f4c30105a02e2074b36fd726962 SHA512 1428a05757313e7f5d57ed9e55b22dd74b864129b0a25bb69f83c949418b008984b932d433589220a1c8f68ebd5dbabedf668d230293bf7dc73d8107dbda117b
AUX seabios/config.seabios-256k 71 BLAKE2B be5e2925d288cbec5fbcde43daa7f4429ad0e44ad242eefae7d4303b72d16df36654e461ae4ad9487045d66b56fd4739cb5686478dee349fd5d1e740e0391efd SHA512 3d41739944da088edafb3ea298c0d3db59ed638b614c258209a30635caccf86a284f03492612694e3a56f40357743a0a36053e8ec11b7d93853b91ba9e5a502f
@@ -13,9 +12,11 @@ DIST seabios-1.12.0.tar.gz 613542 BLAKE2B f145c2db716996bfa9e5c014086ccfaa8ae96e
DIST seabios-1.14.0-bin.tar.xz 170160 BLAKE2B 1ab471ce0c6e27633ec42a66e3069496be84de713baab5de4f297821bd0da26404f7f70abc82e223ec5aa317a878889ae92b019988c72d24f77e7dcc5865f916 SHA512 7964e9bb7dff4fd6593f5d6d64efc4b1460750461b86635dbe5255d2086d619f51711d7a35e4dc20e556f705091c0950afabeddcd2e8876f05ce14f9ca73ed71
DIST seabios-1.14.0-r2-bin.tar.xz 132256 BLAKE2B 7d38949de254d6e3699d463a66c363156aa36bfe16c18bea48c55a61bdc423184175fd5427d3246a78d9c6335e61e5baa982f67e7406c5525e405b4383530d41 SHA512 5ce0e407b97e878842fbd7ad2f9e8a65f2565a5aa43d08e01cff024352780f55f8669958c58d20770db7f90e87cc52c860af831cefe3846227e7b45cd9dc33ee
DIST seabios-1.14.0.tar.gz 628985 BLAKE2B cc1126925dab1551a655680d20d06ebf28c12c386500d1ee4df9e1a99403b4c5bc6a66c2cc5ef58b4c3d6d7226f35007506a6a1855c2cf2742469dcb7aba05bb SHA512 215c42f59425f8abd062be7b11fc0e39c977cee5001a2381551b0f851ac337d0dd53c065267e6dee0e710ffd700fa635f9007b89da8dfce0f47122c984ee8146
+DIST seabios-1.16.0.tar.gz 635419 BLAKE2B b645f20bae341d56ce4fc4a7044446050d8490c6c136377f6dccf02c88100b0644bc13d210b4a517a8be6002d5671b0fba77120a2aca3a9bafbad5e88d037e40 SHA512 9daefcfb1c9edda4462a4b080c9bac552154d577ae19703a914928e43005e7a52edd86869c6507e94a7f0c61ce8b3e6f5dea38cd5146628cb138a130947c522f
EBUILD seabios-1.12.0-r1.ebuild 4058 BLAKE2B 960efadabb9000c6aecde46e41760d414f92f7b915ae546faf831cd52954b8f78e98419faeb54200189d0210c2d72057fa05997fa848fc10a42cbdff3d665a47 SHA512 9a9fe25e5766f9fc88fc22ac3fe796a3229a36bdba5c08a7648df8dcea0e8502fa9ada2ab3ab1aee2466f67bbb678e3e500ee99e2fe24b3e8b77c4bdded33a32
EBUILD seabios-1.12.0.ebuild 3439 BLAKE2B 4e88e25af3df5c52d44259b8078f2c6a7baf5d88dfd572ab7e25c1d0a35737eca941002fb2e111a70143d95af61b012bbeb1da7e33a1b900471a4c3720cd6f70 SHA512 7e9a0e45766736bfc4aa71736aeee1e5301a044cb84f0ea7060be4cfc2e6f7da97ca789d136b85911d05a25aa1abcc6f644ebdf2da3c5e7a4371171d18614423
EBUILD seabios-1.14.0-r1.ebuild 3922 BLAKE2B 28456deb4ae6bb85deae3f815372db3815bb84789c3107f6f8e47bf83d89f06f519c7ba0d4ed61838d90e476b7ebfb2d221158506ec6f79bbba9ef6f5de9eee6 SHA512 02d60543a35f653e2cfd17df4e8cbd6739d6a90ed444ad7783d1bf047af46424030efc0f425e469f3aca0ef5280422bd5993f7bfb7ac673e778bbc3dfff3278e
EBUILD seabios-1.14.0-r2.ebuild 4312 BLAKE2B ddb719c9cb15130b786708227ff200b51a615806b2a1ba0b7aafb2c6076ccb6cb89629d3e046bd084360114b2d48111244b34cac12260d9b1020b199d1b29c24 SHA512 f8324420c74cc1d55a613c50e7b87fb8b30c787b550cd764c80f5d5188f2f372090deaa581663d7a50227adb85fe98001d940ae9bd235bbbfdc06885f3948197
EBUILD seabios-1.14.0.ebuild 3773 BLAKE2B 3ae3a072999d39f6d639d5c06454a8c33cafcb90014e4a77c5811bc176a536e9b43b144cc12da1e85c21c958dd6b985921902e6129381a3c670aa074d4b1bf81 SHA512 054cda4d92a31852e9cd97dd79182f206c7270f332ffd2e4642890f17b57e89621f3add65ad62e20707c7ef2a929f732d82ee154b7ed47c3dbfbc8c0da5da7c0
+EBUILD seabios-1.16.0.ebuild 3398 BLAKE2B a5add1f7e4bcd07e77d520e32d3c8021e33244a82d990d5ac68a6b043f0347db2653595e4b8f2f6a8d858039a4f998b1a0d0fa4d415e0118236c2a77ada81739 SHA512 a7a157c830ff9a1f216476b4d427ff41f52e7d7a8c743fec74a8a95755f979b59308ce5a0c9069fe7d81e780731be7298b31f74e8650cf9785fc82b8db54b89a
MISC metadata.xml 552 BLAKE2B c04d6ed849a522fa91d5698915ce4a2344cf68301fa7a4a1b1c3644be4892a36920b1daa83afff6c4296877617e394a2565699c3ba34e92acb9b6dc52be34adf SHA512 4c92f35b58ee8f41b2a9457f830ef33962f831e854fe87982579a78c65df7ae5d74c54fb7a90ab837e51229a8ca0d75ae84c989e92c2f679ec9a91ed5ebb7561
diff --git a/sys-firmware/seabios/files/README b/sys-firmware/seabios/files/README
deleted file mode 100644
index a7aed6d46cf6..000000000000
--- a/sys-firmware/seabios/files/README
+++ /dev/null
@@ -1,2 +0,0 @@
-The configuration files config.vga-xxx are based on the variants found in
-the qemu/roms/ tree.
diff --git a/sys-firmware/seabios/seabios-1.16.0.ebuild b/sys-firmware/seabios/seabios-1.16.0.ebuild
new file mode 100644
index 000000000000..4ba443b19f0b
--- /dev/null
+++ b/sys-firmware/seabios/seabios-1.16.0.ebuild
@@ -0,0 +1,142 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit toolchain-funcs python-any-r1
+
+# SeaBIOS maintainers sometimes don't release stable tarballs or stable
+# binaries to generate the stable tarball the following is necessary:
+# git clone git://git.seabios.org/seabios.git && cd seabios
+# git archive --output seabios-${PV}.tar.gz --prefix seabios-${PV}/ rel-${PV}
+
+if [[ ${PV} == *9999* || -n "${EGIT_COMMIT}" ]] ; then
+ EGIT_REPO_URI="git://git.seabios.org/seabios.git"
+ inherit git-r3
+else
+ SRC_URI="https://www.seabios.org/downloads/${P}.tar.gz"
+ #KEYWORDS="~alpha ~amd64 ~arm64 ~loong ~m68k ~mips ~ppc ~ppc64 ~x86"
+fi
+
+DESCRIPTION="Open Source implementation of a 16-bit x86 BIOS"
+HOMEPAGE="https://www.seabios.org/"
+
+LICENSE="LGPL-3 GPL-3"
+SLOT="0"
+IUSE="debug +seavgabios"
+
+BDEPEND="
+ >=sys-power/iasl-20060912
+ ${PYTHON_DEPS}"
+RDEPEND="!sys-firmware/seabios-bin"
+
+choose_target_chost() {
+ if [[ -n "${CC}" ]]; then
+ ${CC} -dumpmachine
+ return
+ fi
+
+ if use amd64 || use x86; then
+ # Use the native compiler
+ echo "${CHOST}"
+ return
+ fi
+
+ local i
+ for i in x86_64 i686 i586 i486 i386 ; do
+ i=${i}-pc-linux-gnu
+ type -P ${i}-gcc > /dev/null && echo ${i} && return
+ done
+}
+
+pkg_pretend() {
+ ewarn "You have decided to compile your own SeaBIOS. This is not"
+ ewarn "supported by upstream unless you use their recommended"
+ ewarn "toolchain (which you are not)."
+ elog
+ ewarn "If you are intending to use this build with QEMU, realize"
+ ewarn "you will not receive any support if you have compiled your"
+ ewarn "own SeaBIOS. Virtual machines subtly fail based on changes"
+ ewarn "in SeaBIOS."
+ if [[ -z "$(choose_target_chost)" ]]; then
+ elog
+ eerror "Before you can compile ${PN}, you need to install a x86 cross-compiler"
+ eerror "Run the following commands:"
+ eerror " emerge crossdev"
+ eerror " crossdev --stable -t x86_64-pc-linux-gnu"
+ die "cross-compiler is needed"
+ fi
+}
+
+src_prepare() {
+ default
+
+ # Ensure precompiled iasl files are never used
+ find "${WORKDIR}" -name '*.hex' -delete || die
+}
+
+src_configure() {
+ tc-ld-disable-gold #438058
+
+ if use debug ; then
+ echo "CONFIG_DEBUG_LEVEL=8" >.config
+ fi
+ _emake config
+}
+
+_emake() {
+ LANG=C \
+ emake V=1 \
+ CPP="$(tc-getPROG CPP cpp)" \
+ CC="$(tc-getCC)" \
+ LD="$(tc-getLD)" \
+ AR="$(tc-getAR)" \
+ AS="$(tc-getAS)" \
+ OBJCOPY="$(tc-getOBJCOPY)" \
+ RANLIB="$(tc-getRANLIB)" \
+ OBJDUMP="$(tc-getOBJDUMP)" \
+ STRIP="$(tc-getSTRIP)" \
+ HOST_CC="$(tc-getBUILD_CC)" \
+ VERSION="Gentoo/${EGIT_COMMIT:-${PVR}}" \
+ "$@"
+}
+
+src_compile() {
+ local TARGET_CHOST=$(choose_target_chost)
+
+ cp "${FILESDIR}/seabios/config.seabios-256k" .config || die
+ _emake oldnoconfig
+ CHOST="${TARGET_CHOST}" _emake iasl
+ CHOST="${TARGET_CHOST}" _emake out/bios.bin
+ mv out/bios.bin ../bios-256k.bin || die
+
+ if use seavgabios ; then
+ local config t targets=(
+ cirrus
+ isavga
+ qxl
+ stdvga
+ virtio
+ vmware
+ )
+ for t in "${targets[@]}" ; do
+ _emake clean distclean
+ cp "${FILESDIR}/seavgabios/config.vga-${t}" .config || die
+ _emake oldnoconfig
+ CHOST="${TARGET_CHOST}" _emake out/vgabios.bin
+ cp out/vgabios.bin ../vgabios-${t}.bin || die
+ done
+ fi
+}
+
+src_install() {
+ insinto /usr/share/seabios
+ doins ../bios-256k.bin
+
+ if use seavgabios ; then
+ insinto /usr/share/seavgabios
+ doins ../vgabios*.bin
+ fi
+}