diff options
| author | root <root@alpha.trunkmasters.com> | 2026-06-04 05:48:38 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-06-04 05:48:38 -0500 |
| commit | bfd9c39e4712ebdb442d4ca0673061faed1e70e1 (patch) | |
| tree | 0d7a74b4463ee387f9cf9368ceb1b757f694f72a /sys-firmware | |
| parent | f716a9fe6455d39eef01e718aae68dae61c19704 (diff) | |
| download | baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.gz baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.xz baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.zip | |
Revert "Adding metadata"
This reverts commit f716a9fe6455d39eef01e718aae68dae61c19704.
Diffstat (limited to 'sys-firmware')
135 files changed, 5913 insertions, 0 deletions
diff --git a/sys-firmware/alsa-firmware/Manifest b/sys-firmware/alsa-firmware/Manifest new file mode 100644 index 000000000000..41ce6be2f88e --- /dev/null +++ b/sys-firmware/alsa-firmware/Manifest @@ -0,0 +1,2 @@ +DIST alsa-firmware-1.2.4.tar.bz2 5154366 BLAKE2B 0f844f6cc4859b72635f24d347b4c790469aee39aa60d9addb2c168dcf06b48e7e3cbba26ff21c7e1f5aa355641eec7ab934cb09bfac8ca116a6ac6a7db9d548 SHA512 041f54744fe30fa94781968c89c77ab9073fc9a828014d07a0f7e0f11c4185ace6846d5d2a313fcca6e9cda6e4837fd6f62e883b0fdb0a4e30a8c18ba7b2e05d +DIST alsa-firmware-1.2.4.tar.bz2.sig 833 BLAKE2B a9577b7b43433084b5f5b0d89ff38255548c97e3c339ec46c641b6f00944447353d5e7c134ade3a3134a074041f94d0a8b2947c101437ee168040314956fdcd4 SHA512 204f466fa60ff1c7bf0bcd9117214d6c9b2b5b0e4ecee8026cde43295d8729d4d189ee502b215a3904937904642e4a46921a0bbe89aa7e31530cfdb977a8b1ab diff --git a/sys-firmware/alsa-firmware/alsa-firmware-1.2.4-r2.ebuild b/sys-firmware/alsa-firmware/alsa-firmware-1.2.4-r2.ebuild new file mode 100644 index 000000000000..258a20d61154 --- /dev/null +++ b/sys-firmware/alsa-firmware/alsa-firmware-1.2.4-r2.ebuild @@ -0,0 +1,226 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/alsa.asc +inherit linux-info udev verify-sig + +DESCRIPTION="Advanced Linux Sound Architecture firmware" +HOMEPAGE="https://alsa-project.org/wiki/Main_Page" +SRC_URI=" + https://www.alsa-project.org/files/pub/firmware/${P}.tar.bz2 + verify-sig? ( https://www.alsa-project.org/files/pub/firmware/${P}.tar.bz2.sig ) +" + +LICENSE=" + GPL-2 freedist + alsa_cards_korg1212? ( all-rights-reserved ) + alsa_cards_maestro3? ( all-rights-reserved ) + alsa_cards_sb16? ( all-rights-reserved ) + alsa_cards_wavefront? ( all-rights-reserved ) + alsa_cards_ymfpci? ( all-rights-reserved ) +" +SLOT="0" +KEYWORDS="amd64 ppc ppc64 x86" + +ECHOAUDIO_CARDS=" + alsa_cards_darla20 alsa_cards_gina20 alsa_cards_layla20 + alsa_cards_darla24 alsa_cards_gina24 alsa_cards_layla24 + alsa_cards_mona alsa_cards_mia alsa_cards_indigo + alsa_cards_indigoio alsa_cards_echo3g +" + +EMU_CARDS=" + alsa_cards_emu1212 alsa_cards_emu1616 alsa_cards_emu1820 + alsa_cards_emu10k1 +" + +IUSE="compress-xz compress-zstd +deduplicate + alsa_cards_cs46xx alsa_cards_pcxhr alsa_cards_vx222 + alsa_cards_usb-usx2y alsa_cards_hdsp alsa_cards_hdspm + alsa_cards_mixart alsa_cards_asihpi alsa_cards_sb16 + alsa_cards_korg1212 alsa_cards_maestro3 alsa_cards_ymfpci + alsa_cards_wavefront alsa_cards_msnd-pinnacle alsa_cards_aica + alsa_cards_ca0132 ${ECHOAUDIO_CARDS} ${EMU_CARDS} +" +REQUIRED_USE="?? ( compress-xz compress-zstd )" + +RESTRICT=" + alsa_cards_korg1212? ( bindist ) + alsa_cards_maestro3? ( bindist ) + alsa_cards_sb16? ( bindist ) + alsa_cards_wavefront? ( bindist ) + alsa_cards_ymfpci? ( bindist ) +" + +RDEPEND=" + alsa_cards_usb-usx2y? ( sys-apps/fxload ) + alsa_cards_hdsp? ( media-sound/alsa-tools ) + alsa_cards_hdspm? ( media-sound/alsa-tools ) + deduplicate? ( + alsa_cards_ca0132? ( sys-kernel/linux-firmware[redistributable] ) + alsa_cards_korg1212? ( sys-kernel/linux-firmware[unknown-license] ) + alsa_cards_maestro3? ( sys-kernel/linux-firmware[unknown-license] ) + alsa_cards_sb16? ( sys-kernel/linux-firmware[unknown-license] ) + alsa_cards_wavefront? ( sys-kernel/linux-firmware[unknown-license] ) + alsa_cards_ymfpci? ( sys-kernel/linux-firmware[unknown-license] ) + ) +" +BDEPEND="verify-sig? ( sec-keys/openpgp-keys-alsa )" + +DOCS="README" + +PATCHES=( + "${FILESDIR}"/${PN}-1.2.4-musl.patch +) + +pkg_setup() { + if use compress-xz || use compress-zstd ; then + local CONFIG_CHECK + + if kernel_is -ge 5 19; then + use compress-xz && CONFIG_CHECK="~FW_LOADER_COMPRESS_XZ" + use compress-zstd && CONFIG_CHECK="~FW_LOADER_COMPRESS_ZSTD" + else + use compress-xz && CONFIG_CHECK="~FW_LOADER_COMPRESS" + if use compress-zstd; then + eerror "Kernels <5.19 do not support ZSTD-compressed firmware files" + fi + fi + fi + linux-info_pkg_setup +} + +src_configure() { + local myeconfargs=( + --with-hotplug-dir=/lib/firmware + $(use_enable alsa_cards_usb-usx2y buildfw) + ) + econf "${myeconfargs[@]}" +} + +src_install() { + default + + if ! use alsa_cards_pcxhr; then + rm -r "${ED}"/usr/share/alsa/firmware/pcxhrloader "${ED}"/lib/firmware/pcxhr || die + fi + + if ! use alsa_cards_vx222; then + rm -r "${ED}"/usr/share/alsa/firmware/vxloader || die + fi + + if ! use alsa_cards_usb-usx2y; then + rm -r "${ED}"/usr/share/alsa/firmware/usx2yloader || die + if ! use alsa_cards_vx222; then + rm -r "${ED}"/lib/firmware/vx || die + fi + else + udev_dorules "${FILESDIR}"/52-usx2yaudio.rules + fi + + if ! use alsa_cards_mixart; then + rm -r "${ED}"/usr/share/alsa/firmware/mixartloader "${ED}"/lib/firmware/mixart || die + fi + + if ! use alsa_cards_hdsp && ! use alsa_cards_hdspm; then + rm -r "${ED}"/usr/share/alsa/firmware/hdsploader || die + rm "${ED}"/lib/firmware/digiface_firmware{,_rev11}.bin || die + rm "${ED}"/lib/firmware/multiface_firmware{,_rev11}.bin || die + rm "${ED}"/lib/firmware/rpm_firmware.bin || die + fi + + if ! use alsa_cards_asihpi; then + rm -r "${ED}"/lib/firmware/asihpi || die + fi + + if ! use alsa_cards_sb16; then + rm -r "${ED}"/lib/firmware/sb16 || die + elif use deduplicate; then + rm -r "${ED}"/lib/firmware/sb16 || die + fi + + if ! use alsa_cards_korg1212; then + rm -r "${ED}"/lib/firmware/korg || die + elif use deduplicate; then + rm "${ED}"/lib/firmware/korg/k1212.dsp || die + fi + + if ! use alsa_cards_maestro3; then + rm -r "${ED}"/lib/firmware/ess || die + elif use deduplicate; then + rm "${ED}"/lib/firmware/ess/maestro3_assp_{kernel,minisrc}.fw || die + fi + + if ! use alsa_cards_ymfpci && ! use alsa_cards_wavefront; then + rm -r "${ED}"/lib/firmware/yamaha || die + elif use deduplicate; then + rm -r "${ED}"/lib/firmware/yamaha || die + fi + + if ! use alsa_cards_msnd-pinnacle; then + rm -r "${ED}"/lib/firmware/turtlebeach || die + fi + + if ! use alsa_cards_aica; then + rm "${ED}"/lib/firmware/aica_firmware.bin || die + fi + + if ! use alsa_cards_ca0132; then + rm "${ED}"/lib/firmware/ctspeq.bin || die + rm "${ED}"/lib/firmware/ctefx{,-desktop,-r3di}.bin || die + elif use deduplicate; then + rm "${ED}"/lib/firmware/ctspeq.bin || die + rm "${ED}"/lib/firmware/ctefx.bin || die + fi + + if ! use alsa_cards_cs46xx; then + rm -r "${ED}"/lib/firmware/cs46xx || die + fi + + local ea= + for card in ${ECHOAUDIO_CARDS}; do + use ${card} && ea=1 && break + done + + local emu= + for card in ${EMU_CARDS}; do + use ${card} && emu=1 && break + done + + if [[ ! ${ea} ]]; then + rm -r "${ED}"/lib/firmware/ea || die + fi + if [[ ! ${emu} ]]; then + rm -r "${ED}"/lib/firmware/emu || die + fi + + # Copied from sys-kernel/linux-firmware + if use compress-xz; then + find "${ED}"/lib/firmware -type f -exec \ + xz --compress --quiet --check=crc32 "{}" \; || die + elif use compress-zstd; then + find "${ED}"/lib/firmware -type f -exec \ + zstd --compress --quiet --rm "{}" \; || die + fi +} + +pkg_preinst() { + if [[ ! -d "${ED}"/lib/firmware ]]; then + ewarn "No firmware files are being installed, is ALSA_CARDS= empty?" + ewarn "Please populate ALSA_CARDS with your sound card in make.conf" + fi +} + +pkg_postinst() { + udev_reload + if use alsa_cards_msnd-pinnacle; then + einfo "Please download the actual firmware files from:" + einfo " ftp://ftp.voyetra.com/pub/tbs/msndcl/msndvkit.zip" + einfo " ftp://ftp.voyetra.com/pub/tbs/pinn/pnddk100.zip" + einfo "and copy them to /etc/sound/. Registration required." + einfo + einfo "See also: https://www.kernel.org/doc/Documentation/sound/oss/MultiSound" + fi +} diff --git a/sys-firmware/alsa-firmware/files/52-usx2yaudio.rules b/sys-firmware/alsa-firmware/files/52-usx2yaudio.rules new file mode 100644 index 000000000000..988de4d36c4e --- /dev/null +++ b/sys-firmware/alsa-firmware/files/52-usx2yaudio.rules @@ -0,0 +1,7 @@ +# Load firmware via fxload + +SUBSYSTEM=="usb_device", ACTION=="add", ATTRS{idVendor}=="1604", ATTRS{idProduct}=="800[157]", RUN+="/usr/bin/usx2yloader" +SUBSYSTEM=="usb_device", ACTION=="add", ATTRS{idVendor}=="1604", ATTRS{idProduct}=="800[15]", RUN+="/sbin/startproc /usr/bin/us428control" +SUBSYSTEM=="usb_device", ACTION=="add", ATTRS{idVendor}=="1604", ATTRS{idProduct}=="8000", RUN+="/sbin/fxload -s /usr/share/alsa/firmware/usx2yloader/tascam_loader.ihx -I /usr/share/alsa/firmware/usx2yloader/us428fw.ihx -D %N" +SUBSYSTEM=="usb_device", ACTION=="add", ATTRS{idVendor}=="1604", ATTRS{idProduct}=="8004", RUN+="/sbin/fxload -s /usr/share/alsa/firmware/usx2yloader/tascam_loader.ihx -I /usr/share/alsa/firmware/usx2yloader/us224fw.ihx -D %N" +SUBSYSTEM=="usb_device", ACTION=="add", ATTRS{idVendor}=="1604", ATTRS{idProduct}=="8006", RUN+="/sbin/fxload -s /usr/share/alsa/firmware/usx2yloader/tascam_loader.ihx -I /usr/share/alsa/firmware/usx2yloader/us122fw.ihx -D %N" diff --git a/sys-firmware/alsa-firmware/files/alsa-firmware-1.2.4-musl.patch b/sys-firmware/alsa-firmware/files/alsa-firmware-1.2.4-musl.patch new file mode 100644 index 000000000000..836575331735 --- /dev/null +++ b/sys-firmware/alsa-firmware/files/alsa-firmware-1.2.4-musl.patch @@ -0,0 +1,91 @@ +https://github.com/alsa-project/alsa-firmware/pull/10 + +From 09da9c869fa177acca17d63ac5fc3b3217683918 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Sun, 15 Oct 2023 13:28:36 +0100 +Subject: [PATCH] Use stdint.h types + +u_int_* aren't standard, but uint* are. Use those instead for musl compat. + +Bug: https://bugs.gentoo.org/832969 +Signed-off-by: Sam James <sam@gentoo.org> +--- + hdsploader/digiface_firmware.dat | 4 +++- + hdsploader/digiface_firmware_rev11.dat | 4 +++- + hdsploader/multiface_firmware.dat | 4 +++- + hdsploader/multiface_firmware_rev11.dat | 4 +++- + hdsploader/tobin.c | 3 ++- + 5 files changed, 14 insertions(+), 5 deletions(-) + +diff --git a/hdsploader/digiface_firmware.dat b/hdsploader/digiface_firmware.dat +index 9ac946a..9643e8e 100644 +--- a/hdsploader/digiface_firmware.dat ++++ b/hdsploader/digiface_firmware.dat +@@ -1,5 +1,7 @@ ++#include <stdint.h> ++ + /* stored in little-endian */ +-static u_int32_t digiface_firmware[24413] = { ++static uint32_t digiface_firmware[24413] = { + 0xffffffff, 0x66aa9955, 0x8001000c, 0xe0000000, 0x8006800c, 0xb0000000, + 0x8004800c, 0xb4fc0100, 0x8003000c, 0x00000000, 0x8001000c, 0x90000000, + 0x8004000c, 0x00000000, 0x8001000c, 0x80000000, 0x0002000c, 0x581a000a, +diff --git a/hdsploader/digiface_firmware_rev11.dat b/hdsploader/digiface_firmware_rev11.dat +index 2930017..adffd82 100644 +--- a/hdsploader/digiface_firmware_rev11.dat ++++ b/hdsploader/digiface_firmware_rev11.dat +@@ -1,5 +1,7 @@ ++#include <stdint.h> ++ + /* stored in little-endian */ +-static u_int32_t digiface_firmware_rev11[24413] = { ++static uint32_t digiface_firmware_rev11[24413] = { + 0xffffffff, 0x66aa9955, 0x8001000c, 0xe0000000, 0x8006800c, 0xb0000000, + 0x8004800c, 0xb4fc0100, 0x8003000c, 0x00000000, 0x8001000c, 0x90000000, + 0x8004000c, 0x00000000, 0x8001000c, 0x80000000, 0x0002000c, 0x581a000a, +diff --git a/hdsploader/multiface_firmware.dat b/hdsploader/multiface_firmware.dat +index 6c4813d..f95c1b3 100644 +--- a/hdsploader/multiface_firmware.dat ++++ b/hdsploader/multiface_firmware.dat +@@ -1,5 +1,7 @@ ++#include <stdint.h> ++ + /* stored in little-endian */ +-static u_int32_t multiface_firmware[24413] = { ++static uint32_t multiface_firmware[24413] = { + 0xffffffff, 0x66aa9955, 0x8001000c, 0xe0000000, 0x8006800c, 0xb0000000, + 0x8004800c, 0xb4fc0100, 0x8003000c, 0x00000000, 0x8001000c, 0x90000000, + 0x8004000c, 0x00000000, 0x8001000c, 0x80000000, 0x0002000c, 0x581a000a, +diff --git a/hdsploader/multiface_firmware_rev11.dat b/hdsploader/multiface_firmware_rev11.dat +index 057f53e..16de278 100644 +--- a/hdsploader/multiface_firmware_rev11.dat ++++ b/hdsploader/multiface_firmware_rev11.dat +@@ -1,5 +1,7 @@ ++#include <stdint.h> ++ + /* stored in little-endian */ +-static u_int32_t multiface_firmware_rev11[24413] = { ++static uint32_t multiface_firmware_rev11[24413] = { + 0xffffffff, 0x66aa9955, 0x8001000c, 0xe0000000, 0x8006800c, 0xb0000000, + 0x8004800c, 0xb4fc0100, 0x8003000c, 0x00000000, 0x8001000c, 0x90000000, + 0x8004000c, 0x00000000, 0x8001000c, 0x80000000, 0x0002000c, 0x581a000a, +diff --git a/hdsploader/tobin.c b/hdsploader/tobin.c +index 2d76220..8d67b2b 100644 +--- a/hdsploader/tobin.c ++++ b/hdsploader/tobin.c +@@ -1,5 +1,6 @@ + #include <stdio.h> + #include <stdlib.h> ++#include <stdint.h> + #include <unistd.h> + #include <endian.h> + +@@ -8,7 +9,7 @@ + #include "multiface_firmware.dat" + #include "multiface_firmware_rev11.dat" + +-int write_bin_file(u_int32_t *array, const char *filename) ++int write_bin_file(uint32_t *array, const char *filename) + { + FILE *out; + diff --git a/sys-firmware/alsa-firmware/metadata.xml b/sys-firmware/alsa-firmware/metadata.xml new file mode 100644 index 000000000000..038601d9ad78 --- /dev/null +++ b/sys-firmware/alsa-firmware/metadata.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <!-- maintainer-needed --> + <upstream> + <remote-id type="github">alsa-project/alsa-firmware</remote-id> + </upstream> + <use> + <flag name="compress-xz">Compress firmware using xz (<pkg>app-arch/xz-utils</pkg>) before installation</flag> + <flag name="compress-zstd">Compress firmware using zstd (<pkg>app-arch/zstd</pkg>) before installation</flag> + <flag name="deduplicate">Remove firmware that is also provided by <pkg>sys-kernel/linux-firmware</pkg></flag> + </use> +</pkgmetadata> diff --git a/sys-firmware/atmel-firmware/Manifest b/sys-firmware/atmel-firmware/Manifest new file mode 100644 index 000000000000..de360415ac25 --- /dev/null +++ b/sys-firmware/atmel-firmware/Manifest @@ -0,0 +1 @@ +DIST atmel-firmware-1.3.tar.gz 470254 BLAKE2B 76b90d6bf34db5540ab8c4034a439e8da6e0590ecbca0962c9e65099143b67337c91f7673a2cc33a2191924f42f69f922176a9b91f8592ce649dbf04a17b36ee SHA512 e87767008d3fe08a7e997b629a11589c00f46ca375639dd0b06c48b2de831a7df666c895888026eff03b7ee81a7594349fd550c4943b088ce26fb57f660ce89b diff --git a/sys-firmware/atmel-firmware/atmel-firmware-1.3-r3.ebuild b/sys-firmware/atmel-firmware/atmel-firmware-1.3-r3.ebuild new file mode 100644 index 000000000000..a9508563594e --- /dev/null +++ b/sys-firmware/atmel-firmware/atmel-firmware-1.3-r3.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +DESCRIPTION="Firmware and config for atmel and atmel_cs wlan drivers included in linux 2.6" +HOMEPAGE="https://www.thekelleys.org.uk/atmel/" +SRC_URI="https://www.thekelleys.org.uk/atmel/${P}.tar.gz" + +LICENSE="Atmel" +SLOT="0" +KEYWORDS="amd64 ~ppc x86" +IUSE="pcmcia usb" + +RDEPEND=">=net-wireless/wireless-tools-26-r1 + pcmcia? ( sys-apps/pcmciautils )" + +PATCHES=( + "${FILESDIR}"/${PN}-1.3-clang-16-build.patch +) + +src_compile() { + tc-export CC + emake atmel_fwl +} + +src_install() { + # atmel_at76c504c-wpa.bin should be renamed to atmel_at76c504-wpa.bin, bug #398803 + mv images/atmel_at76c504c-wpa.bin images/atmel_at76c504-wpa.bin || die + + insinto /lib/firmware + doins images/*.bin + + if use usb; then + doins images.usb/*.bin + fi + + if use pcmcia; then + insinto /etc/pcmcia + doins atmel.conf + fi + + dosbin atmel_fwl atmel_fwl.pl + doman atmel_fwl.8 + dodoc README VERSION +} + +pkg_postinst() { + if use pcmcia && [ -f /run/cardmgr.pid ]; then + kill -HUP `cat /run/cardmgr.pid` + fi +} + +pkg_postrm() { + if use pcmcia && [ -f /run/cardmgr.pid ]; then + kill -HUP `cat /run/cardmgr.pid` + fi +} diff --git a/sys-firmware/atmel-firmware/files/atmel-firmware-1.3-clang-16-build.patch b/sys-firmware/atmel-firmware/files/atmel-firmware-1.3-clang-16-build.patch new file mode 100644 index 000000000000..dca3dd03be43 --- /dev/null +++ b/sys-firmware/atmel-firmware/files/atmel-firmware-1.3-clang-16-build.patch @@ -0,0 +1,13 @@ +Fix build with clang 16 +Bug: https://bugs.gentoo.org/887113 +--- a/atmel_fwl.c ++++ b/atmel_fwl.c +@@ -37,7 +37,7 @@ struct atmel_priv_ioctl { + unsigned short len; + }; + +-main(int argc, char **argv) ++int main(int argc, char **argv) + { + int i, magic, rc, sock = -1; + struct ifreq ifr; diff --git a/sys-firmware/atmel-firmware/metadata.xml b/sys-firmware/atmel-firmware/metadata.xml new file mode 100644 index 000000000000..85e4ed814fa2 --- /dev/null +++ b/sys-firmware/atmel-firmware/metadata.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<!-- maintainer-needed --> +</pkgmetadata> diff --git a/sys-firmware/b43-firmware/Manifest b/sys-firmware/b43-firmware/Manifest new file mode 100644 index 000000000000..8005a5bfa539 --- /dev/null +++ b/sys-firmware/b43-firmware/Manifest @@ -0,0 +1,2 @@ +DIST broadcom-wl-5.100.138.tar.bz2 13514651 BLAKE2B 3f29c09f8c58290c1fadd1ab4ceb9c8606e27b828363056d21e48adcdd6e28d3a7326f4ef6ac3fa13353da138f6af5fe7bde88308e21f0fd6754106189cf12da SHA512 02487e76e3eca7fe97ce2ad7dc9c5d39fac82b8d5f7786cce047f9c85e2426f5b7ea085d84c7d4aae43e0fe348d603e3229211bab601726794ef633441d37a8b +DIST broadcom-wl-6.30.163.46.tar.bz2 7684610 BLAKE2B 53b1c8a4737b6fa524c09e4cec14ac92260961f61c67a37013580e4998b001c9ee68f2f998a798743bb5e77cb3e444d5c1b27f72fd8efbbc25913e7da111d733 SHA512 0144894fbbb5e8ebab6c423d9bd0f3249be94f2f468a50b8bf721a3b17f1f6e57467c79e87abc8d136bfc92e701ed046885fead892e9a73efa5217d710311ae9 diff --git a/sys-firmware/b43-firmware/b43-firmware-5.100.138.ebuild b/sys-firmware/b43-firmware/b43-firmware-5.100.138.ebuild new file mode 100644 index 000000000000..1940a6ad1cec --- /dev/null +++ b/sys-firmware/b43-firmware/b43-firmware-5.100.138.ebuild @@ -0,0 +1,28 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_P="broadcom-wl-${PV}" + +DESCRIPTION="broadcom firmware for b43 LP PHY and >=linux-3.2" +HOMEPAGE="https://wireless.docs.kernel.org/en/latest/en/users/drivers/b43.html" +SRC_URI="http://www.lwfinger.com/b43-firmware/${MY_P}.tar.bz2" +S="${WORKDIR}/${MY_P}" + +LICENSE="Broadcom" +SLOT="b43" +KEYWORDS="amd64 ~arm64 ppc x86" +RESTRICT="binchecks bindist strip" + +BDEPEND=">=net-wireless/b43-fwcutter-015" + +src_compile() { + mkdir ebuild-output || die + b43-fwcutter -w ebuild-output linux/wl_apsta.o || die +} + +src_install() { + insinto /lib/firmware + doins -r ebuild-output/. +} diff --git a/sys-firmware/b43-firmware/b43-firmware-6.30.163.46.ebuild b/sys-firmware/b43-firmware/b43-firmware-6.30.163.46.ebuild new file mode 100644 index 000000000000..5cff1634bf5a --- /dev/null +++ b/sys-firmware/b43-firmware/b43-firmware-6.30.163.46.ebuild @@ -0,0 +1,30 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_P="broadcom-wl-${PV}" + +DESCRIPTION="broadcom firmware for b43 LP PHY and >=linux-3.2" +HOMEPAGE="https://wireless.docs.kernel.org/en/latest/en/users/drivers/b43.html" +SRC_URI="http://www.lwfinger.com/b43-firmware/${MY_P}.tar.bz2" +S="${WORKDIR}" + +LICENSE="Broadcom" +SLOT="b43" +RESTRICT="binchecks bindist strip" + +BDEPEND=">=net-wireless/b43-fwcutter-018" + +src_compile() { + mkdir ebuild-output || die + b43-fwcutter -w ebuild-output ${MY_P}.wl_apsta.o || die +} + +src_install() { + insinto /lib/firmware + doins -r ebuild-output/. + ewarn "This version of the firmware has been reported as buggy, that's why it has no keywords." + ewarn "No one can fix bugs in this binary firmware except broadcom, do not open bugs about instability" + ewarn "See https://bugs.gentoo.org/541080 for some details" +} diff --git a/sys-firmware/b43-firmware/metadata.xml b/sys-firmware/b43-firmware/metadata.xml new file mode 100644 index 000000000000..5b155ef976b3 --- /dev/null +++ b/sys-firmware/b43-firmware/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="person"> +<email>zerochaos@gentoo.org</email> +<name>Rick Farina</name> +</maintainer> +</pkgmetadata> diff --git a/sys-firmware/b43legacy-firmware/Manifest b/sys-firmware/b43legacy-firmware/Manifest new file mode 100644 index 000000000000..02aa78099812 --- /dev/null +++ b/sys-firmware/b43legacy-firmware/Manifest @@ -0,0 +1 @@ +DIST wl_apsta-3.130.20.0.o 652866 BLAKE2B bfe92320ffe506e7ed1fda889ae5bdf2a760dedde152bf97e0434a8577c85df31a5a940fa9c032375c4f7520b254eedc9433b90073402d40cd807a9b1b0b1cfa SHA512 d89ed52045307449bbae79a4d1807cc6cd89ae67c4a22e8e8aa51c1396edbb6ed8b157cd0756faf8b660a537b48b62117c57967f2048245b5b102d9d9bca4bbd diff --git a/sys-firmware/b43legacy-firmware/b43legacy-firmware-3.130.20.0.ebuild b/sys-firmware/b43legacy-firmware/b43legacy-firmware-3.130.20.0.ebuild new file mode 100644 index 000000000000..4d0da051a668 --- /dev/null +++ b/sys-firmware/b43legacy-firmware/b43legacy-firmware-3.130.20.0.ebuild @@ -0,0 +1,30 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="broadcom firmware for b43legacy/bcm43xx" +HOMEPAGE="https://wireless.docs.kernel.org/en/latest/en/users/drivers/b43.html" +SRC_URI="http://downloads.openwrt.org/sources/wl_apsta-${PV}.o" +S="${WORKDIR}" + +LICENSE="Broadcom" +SLOT="0" +KEYWORDS="amd64 ppc x86" +RESTRICT="binchecks bindist strip" + +BDEPEND=">=net-wireless/b43-fwcutter-012" + +src_unpack() { + cp "${DISTDIR}/${A}" "${WORKDIR}/wl_apsta.o" || die +} + +src_compile() { + mkdir ebuild-output || die + b43-fwcutter -w ebuild-output wl_apsta.o || die +} + +src_install() { + insinto /lib/firmware + doins -r ebuild-output/. +} diff --git a/sys-firmware/b43legacy-firmware/metadata.xml b/sys-firmware/b43legacy-firmware/metadata.xml new file mode 100644 index 000000000000..5b155ef976b3 --- /dev/null +++ b/sys-firmware/b43legacy-firmware/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="person"> +<email>zerochaos@gentoo.org</email> +<name>Rick Farina</name> +</maintainer> +</pkgmetadata> diff --git a/sys-firmware/blisp/Manifest b/sys-firmware/blisp/Manifest new file mode 100644 index 000000000000..f5d0186adba7 --- /dev/null +++ b/sys-firmware/blisp/Manifest @@ -0,0 +1 @@ +DIST blisp-0.0.5.tar.gz 169995 BLAKE2B 21863c4b643fc570d154a7e54f35fd34a77f42300cd9297d05972c66a8e55c39d5c494f1d34be258750e7ba17288d992091e9c6967e431732be9226e48f14881 SHA512 92171a7e00df95521b21a3992e395f63d68de0d0f661e23aa7aa8ce4d4ebe7ff12dd2f3bd48f530a7c70895ce786da374cb227c4b9d1e92f625f9a4ea78982e9 diff --git a/sys-firmware/blisp/blisp-0.0.5.ebuild b/sys-firmware/blisp/blisp-0.0.5.ebuild new file mode 100644 index 000000000000..cc17b51e2d3e --- /dev/null +++ b/sys-firmware/blisp/blisp-0.0.5.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +DESCRIPTION="Bouffalo Labs in-system-programming tool and library" +HOMEPAGE="https://github.com/pine64/blisp" +SRC_URI="https://github.com/pine64/${PN}/archive/refs/tags/v${PV}.tar.gz + -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~riscv" +IUSE="+tools" + +RDEPEND="dev-libs/argtable3 + dev-libs/libserialport" +DEPEND="${RDEPEND}" + +src_prepare() { + cmake_src_prepare + + # Be extra sure we're not using vendored deps + rm -r vendor || die +} + +src_configure() { + + local mycmakeargs=( + -DBLISP_USE_SYSTEM_LIBRARIES=ON + -DBLISP_BUILD_CLI=$(usex tools) + -DCOMPILE_TESTS=OFF # requires unpackaged googletest + ) + cmake_src_configure +} diff --git a/sys-firmware/blisp/metadata.xml b/sys-firmware/blisp/metadata.xml new file mode 100644 index 000000000000..5e57d2700deb --- /dev/null +++ b/sys-firmware/blisp/metadata.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>mjo@gentoo.org</email> + <name>Michael Orlitzky</name> + </maintainer> + + <upstream> + <remote-id type="github">pine64/blisp</remote-id> + </upstream> + + <use> + <flag name="tools"> + Build the blisp command-line utility used to upload firmware to + the pinecil + </flag> + </use> +</pkgmetadata> diff --git a/sys-firmware/bluez-firmware/Manifest b/sys-firmware/bluez-firmware/Manifest new file mode 100644 index 000000000000..6c6c0036552a --- /dev/null +++ b/sys-firmware/bluez-firmware/Manifest @@ -0,0 +1 @@ +DIST bluez-firmware-1.2_p9_p20250503.tar.gz 603973 BLAKE2B ac120a5110f7dba0be15411018a3e135af5c20f2167f6aa783df45ffc2b59f0e1aa163a3882c645b94d1be5deff463406c75a71d0c51198a550194b0a9faa13a SHA512 62246630d710dabcdc98443a27ecd610e1c3fb047fbaf0fd905cd9a2d9406c0b38c589e55adb6385f288c5a208bbaca220510da5df882ddaa39967724592adc9 diff --git a/sys-firmware/bluez-firmware/bluez-firmware-1.2_p9_p20250503.ebuild b/sys-firmware/bluez-firmware/bluez-firmware-1.2_p9_p20250503.ebuild new file mode 100644 index 000000000000..32ea77b4dbf0 --- /dev/null +++ b/sys-firmware/bluez-firmware/bluez-firmware-1.2_p9_p20250503.ebuild @@ -0,0 +1,41 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +COMMIT_ID="2bbfb8438e824f5f61dae3f6ebb367a6129a4d63" + +DESCRIPTION="Firmware for Broadcom BCM, STLC2300, and Synaptics SYN Bluetooth chips" +HOMEPAGE="https://github.com/RPi-Distro/bluez-firmware" +SRC_URI=" + https://github.com/RPi-Distro/bluez-firmware/archive/${COMMIT_ID}.tar.gz + -> ${P}.tar.gz +" + +S="${WORKDIR}/bluez-firmware-${COMMIT_ID}" +LICENSE="bluez-firmware GPL-2+" +SLOT="0" + +KEYWORDS="amd64 arm64" + +RESTRICT="bindist mirror" + +DOCS=( AUTHORS ChangeLog README ) + +src_configure() { + econf --libdir=/lib +} + +src_compile() { + : +} + +src_install() { + emake DESTDIR="${D}" install + + insinto /lib/firmware/brcm + doins debian/firmware/broadcom/*.hcd + + insinto /lib/firmware/synaptics + doins debian/firmware/synaptics/*.hcd +} diff --git a/sys-firmware/bluez-firmware/metadata.xml b/sys-firmware/bluez-firmware/metadata.xml new file mode 100644 index 000000000000..6837276c7e11 --- /dev/null +++ b/sys-firmware/bluez-firmware/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <name>Florian Schmaus</name> + <email>flow@gentoo.org</email> + </maintainer> + <stabilize-allarches/> + <upstream> + <remote-id type="github">RPi-Distro/bluez-firmware</remote-id> + </upstream> +</pkgmetadata> diff --git a/sys-firmware/broadcom-bt-firmware/Manifest b/sys-firmware/broadcom-bt-firmware/Manifest new file mode 100644 index 000000000000..738e59840e34 --- /dev/null +++ b/sys-firmware/broadcom-bt-firmware/Manifest @@ -0,0 +1 @@ +DIST broadcom-bt-firmware-12.0.1.1105_p4.tar.gz 2332067 BLAKE2B cc6c2b7b30ec1d7b3cedb1a836be603db60e48d13b02108e7ce4b72dfddea9997d115a4af25f6192c54d4ad4c0acb259b7079885fadf41e9e2e58cdaabf62dad SHA512 f37017d6ae17ed89199e9c87e2f603ba21e278ba75c5c0a62f9b0ed8f2f9118f42e19486cc73b3e9153db79699909581a4f5154a6ce862343f50905eb43afcfa diff --git a/sys-firmware/broadcom-bt-firmware/broadcom-bt-firmware-12.0.1.1105_p4-r1.ebuild b/sys-firmware/broadcom-bt-firmware/broadcom-bt-firmware-12.0.1.1105_p4-r1.ebuild new file mode 100644 index 000000000000..0e655075efd7 --- /dev/null +++ b/sys-firmware/broadcom-bt-firmware/broadcom-bt-firmware-12.0.1.1105_p4-r1.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 +inherit linux-info multiprocessing + +DESCRIPTION="Broadcom Bluetooth firmware" +HOMEPAGE="https://github.com/winterheart/broadcom-bt-firmware" +SRC_URI="https://github.com/winterheart/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="broadcom_bcm20702 MIT" +SLOT="0" +KEYWORDS="amd64 ~ppc64 x86" +# Re-use compress-* USE flags from sys-kernel/linux-firmware. +IUSE="compress-xz compress-zstd" +REQUIRED_USE="?? ( compress-xz compress-zstd )" + +BDEPEND=" + compress-xz? ( app-arch/xz-utils ) + compress-zstd? ( app-arch/zstd ) +" + +pkg_setup() { + if use compress-xz || use compress-zstd ; then + local CONFIG_CHECK + + if kernel_is -ge 5 19; then + use compress-xz && CONFIG_CHECK="~FW_LOADER_COMPRESS_XZ" + use compress-zstd && CONFIG_CHECK="~FW_LOADER_COMPRESS_ZSTD" + else + use compress-xz && CONFIG_CHECK="~FW_LOADER_COMPRESS" + if use compress-zstd; then + eerror "Kernels <5.19 do not support ZSTD-compressed firmware files" + fi + fi + linux-info_pkg_setup + fi +} + +src_install() { + insinto /lib/firmware + doins -r brcm + + if use compress-xz || use compress-zstd; then + pushd "${ED}/lib/firmware/brcm" &>/dev/null || die + einfo "Compressing firmware ..." + local ext + local compressor + + if use compress-xz; then + ext=xz + compressor="xz -T1 -C crc32" + elif use compress-zstd; then + ext=zst + compressor="zstd -15 -T1 -C -q --rm" + fi + find . -type f -print0 | \ + xargs -0 -P $(makeopts_jobs) -I'{}' ${compressor} '{}' + assert + popd &>/dev/null || die + fi + dodoc DEVICES.md README.md +} diff --git a/sys-firmware/broadcom-bt-firmware/metadata.xml b/sys-firmware/broadcom-bt-firmware/metadata.xml new file mode 100644 index 000000000000..1d4e71fe4818 --- /dev/null +++ b/sys-firmware/broadcom-bt-firmware/metadata.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person" proxied="yes"> + <email>azamat.hackimov@gmail.com</email> + <name>Azamat H. Hackimov</name> + </maintainer> + <maintainer type="project" proxied="proxy"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <upstream> + <remote-id type="github">winterheart/broadcom-bt-firmware</remote-id> + </upstream> +<use> + <flag name="compress-xz">Compress firmware using xz (<pkg>app-arch/xz-utils</pkg>) before installation</flag> + <flag name="compress-zstd">Compress firmware using zstd (<pkg>app-arch/zstd</pkg>) before installation</flag> +</use> +</pkgmetadata> diff --git a/sys-firmware/edk2-bin/Manifest b/sys-firmware/edk2-bin/Manifest new file mode 100644 index 000000000000..50cce1f73972 --- /dev/null +++ b/sys-firmware/edk2-bin/Manifest @@ -0,0 +1,10 @@ +DIST edk2-202408-1-amd64.xpak 6406269 BLAKE2B 4989c77321b01165253a8a3bf9955f5b75598cc49371ed74b342786b8158c232f088f1f8a34b8afae0e72f8aabe6cb2a437f5d1f495d3e09d939ef5b4ddfecc6 SHA512 9ead4ac94c634b740ea2a19dcad968e31bc90662b8caf6a9bb96f7517358af23bc1bc996317ca4e7bf2a7b685b2c80fae4757eb1d10fd8d3550388580a0b6ff2 +DIST edk2-202408-1-arm64.xpak 2710314 BLAKE2B e21ee00e178c59cd89cc297f22a044459446f394000e6e959a2cea59c120e9778682ba3e040b02e155d05d5196aebe45c8fc50ae6923a51fd2be2308132b23f9 SHA512 9f2c99755e3ca482ef240f58711d571a57c2e29fc29b696d0345a1c02d185b325f840cd747d139724bde7dfeaced99fd6eecc5e95ec3b45a6651c797d7989576 +DIST edk2-202411-1-amd64.xpak 6551638 BLAKE2B 96cbbfd3cc105805bd2c4b535aa2802258fd7a51a5601c3dbdf6e7a34add424a46f2d0b99ffb95cc4af87c7636aa73ceaf4200a2bcda4d466464dc19798cef38 SHA512 c3df3a7af4460e3ef9fef46f279bf9984a52995335842daec51e3e3a71ebb874e905c95ee35f645787447301d7f12662ceae5fa202399e9d42174253e2c915c5 +DIST edk2-202411-1-arm64.xpak 2694540 BLAKE2B abf73580f8b9b6e6172918b43906d17787fd27b62e067f0950cd8dd7462aa70fa70fda21b634711526328d6c00ed7526764411daaa3801876812a9408fccefc6 SHA512 6f9908c1abd444ea9a2c2fe98b0a34b9f8827d7e909d35503fd90846c6c3c2d9d74adc264e83834f51f48f3cf1b2959ef1c75ce83fd24e916325437dbbb2b741 +DIST edk2-202411-1-riscv.xpak 1424979 BLAKE2B 417b183c4786ad094966765912a5359f6764f868f60e6dfc9689342f8f23c223b1770f00f6f31fc6f2826827b5473586013d7aee2a502dfe403784811814c842 SHA512 a20a2222ea5dc13d8fac7beb63a3287572316343a79913eefcc77db53107a6a8ab34094d5b711631f25188810961a873e468f9b07fd13cbc149d119299e5e4c8 +DIST edk2-202511-1-qemu-aarch64.xpak 4052801 BLAKE2B 79fb12322613286fc0733da774e29db35b4e2a5eb61d36c1717450cc49b124f54cd3b695af871d5be28bab39bde10d9247c67115a6e89378950d468287300f70 SHA512 036aff0540b5947a146a8f42f09e4f354d0a54ad5227e351696573759ceb004855eedc1acd1e8751012f97313610b76ddf3631b5cb2bb7cd218657d6732cc548 +DIST edk2-202511-1-qemu-loongarch64.xpak 1994972 BLAKE2B 98ef04fa0042f82458b48e5edee4ee271196bdc73ab3e7c0c97397c2a989240881fa1d0d3ed5e24f35731a37be43c1f140914965fb04b2f03aabd00e0615782d SHA512 deac522183b2c2a4ca54dacad087a753866b66cef148b481f77c9a4d163fd972ab043340880d66be523b99ba40e7e7bb0efaf4282cc6cbd41e6f0bdff05fe485 +DIST edk2-202511-1-qemu-riscv64.xpak 1847391 BLAKE2B ef1070607e4e937a211c39e558e7012a02387f29d876680b9b05aaeffb8d7dda9c56a20d05d607319def68e1677a2c8985fb498a2c55bb607251a4fbe6c3d5eb SHA512 e9bdc4141dc0ded6b7620eadfda89fc7009823e7762759cd925cfc6d178a50638aa09f088b7d195b1bf18b70d8e920ee00d4ed35a65fa39b6061729ebd828c66 +DIST edk2-202511-1-qemu-x86_64.xpak 8985483 BLAKE2B 752351a7ccdb7e16274e94bd1d43d605c31b6babe0dbe4af189aeedbb70a0d943c7be8c4b9b1808cf4229603ca2ffeb4e90d6419000fb3691af7fa73e9792881 SHA512 aca265ad79cb0a835e7dc2bbf3fdcdfce43d2f03a5fd9663f0d3b719620ae4adc4f16453759c547adf508d7a549463875788a0913e0fae8b7e630915ad7c33b5 +DIST edk2-ovmf-202202-1.xpak 2672386 BLAKE2B 75c15d4379610ab2af85b78166e350d52f4f1bc1fff5b2eb693ad0d7b1f6648e65d8ae3e2c5467f93f1557ad3b4fa664ab2d76ff10794667de22c2ea8cca6b2d SHA512 06783b89c96bada0fd025ff39eaee501a027abcb03c0bdcf3ff497d52be22927ab03013d90f145ee94a8662cfffe4f8c154dcd06db1bb1acef8a85ae43de14a3 diff --git a/sys-firmware/edk2-bin/edk2-bin-202202.ebuild b/sys-firmware/edk2-bin/edk2-bin-202202.ebuild new file mode 100644 index 000000000000..22e25e29aa56 --- /dev/null +++ b/sys-firmware/edk2-bin/edk2-bin-202202.ebuild @@ -0,0 +1,71 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit readme.gentoo-r1 secureboot + +BINPKG="edk2-ovmf-${PV}-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-with-patent MIT" +SLOT="0" +KEYWORDS="amd64 arm64 ~loong ~ppc ppc64 ~riscv x86" + +RDEPEND="!sys-firmware/edk2" + +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 -xf - < <(xz -c -d --single-stream "${DISTDIR}/${BINPKG}.xpak") || die "unpacking binpkg failed" +} + +src_install() { + mv "usr/share/doc/edk2-ovmf-${PV}" "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 + + secureboot_auto_sign --in-place + + readme.gentoo_create_doc +} + +pkg_postinst() { + readme.gentoo_print_elog +} diff --git a/sys-firmware/edk2-bin/edk2-bin-202408.ebuild b/sys-firmware/edk2-bin/edk2-bin-202408.ebuild new file mode 100644 index 000000000000..6e11f9cc811a --- /dev/null +++ b/sys-firmware/edk2-bin/edk2-bin-202408.ebuild @@ -0,0 +1,69 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit readme.gentoo-r1 secureboot + +BINPKG="${P/-bin/}-1" +ARCHES="amd64 arm64" + +DESCRIPTION="TianoCore EDK II UEFI firmware for virtual machines" +HOMEPAGE="https://github.com/tianocore/edk2" +SRC_URI=$(printf "https://dev.gentoo.org/~chewi/distfiles/${BINPKG}-%s.xpak\n" ${ARCHES}) +S="${WORKDIR}" +LICENSE="BSD-2-with-patent MIT" +SLOT="0" +KEYWORDS="amd64 arm64 ~loong ~ppc ppc64 ~riscv x86" + +RDEPEND="!sys-firmware/edk2" + +DOC_CONTENTS="This package includes the TianoCore EDK II UEFI firmware for virtual \ +machines of these architectures: ${ARCHES}. See each architecture's README for \ +usage details." + +src_unpack() { + local a + for a in ${ARCHES}; do + mkdir "${a}" || die + tar -C "${a}" -xf - < <(xz -c -d --single-stream "${DISTDIR}/${BINPKG}-${a}.xpak") || + die "unpacking ${a} binpkg failed" + done +} + +src_prepare() { + bunzip2 */usr/share/doc/*/README.gentoo.bz2 || die + default +} + +src_install() { + insinto /usr/share + doins -r */usr/share/{edk2,qemu}/ + + # Compatibility with older package versions. + dosym edk2/OvmfX64 /usr/share/edk2-ovmf + + secureboot_auto_sign --in-place + readme.gentoo_create_doc + + local a + for a in ${ARCHES}; do + newdoc "${a}"/usr/share/doc/*/README.gentoo README-"${a}".gentoo + done +} + +pkg_preinst() { + local OLD=${EROOT}/usr/share/edk2-ovmf NEW=${EROOT}/usr/share/edk2/OvmfX64 + if [[ -d ${OLD} && ! -L ${OLD} ]]; then + { + rm -vf "${OLD}"/{OVMF_{CODE,CODE.secboot,VARS}.fd,EnrollDefaultKeys.efi,Shell.efi,UefiShell.img} && + mkdir -p "${NEW}" && + find "${OLD}" -mindepth 1 -maxdepth 1 -execdir mv --update=none-fail -vt "${NEW}"/ {} + && + rmdir "${OLD}" + } || die "unable to replace old directory with compatibility symlink" + fi +} + +pkg_postinst() { + readme.gentoo_print_elog +} diff --git a/sys-firmware/edk2-bin/edk2-bin-202411.ebuild b/sys-firmware/edk2-bin/edk2-bin-202411.ebuild new file mode 100644 index 000000000000..636670d43c76 --- /dev/null +++ b/sys-firmware/edk2-bin/edk2-bin-202411.ebuild @@ -0,0 +1,69 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit readme.gentoo-r1 secureboot + +BINPKG="${P/-bin/}-1" +ARCHES="amd64 arm64 riscv" + +DESCRIPTION="TianoCore EDK II UEFI firmware for virtual machines" +HOMEPAGE="https://github.com/tianocore/edk2" +SRC_URI=$(printf "https://dev.gentoo.org/~chewi/distfiles/${BINPKG}-%s.xpak\n" ${ARCHES}) +S="${WORKDIR}" +LICENSE="BSD-2-with-patent MIT" +SLOT="0" +KEYWORDS="amd64 arm64 ~loong ~ppc ppc64 ~riscv x86" + +RDEPEND="!sys-firmware/edk2" + +DOC_CONTENTS="This package includes the TianoCore EDK II UEFI firmware for virtual \ +machines of these architectures: ${ARCHES}. See each architecture's README for \ +usage details." + +src_unpack() { + local a + for a in ${ARCHES}; do + mkdir "${a}" || die + tar -C "${a}" -xf - < <(xz -c -d --single-stream "${DISTDIR}/${BINPKG}-${a}.xpak") || + die "unpacking ${a} binpkg failed" + done +} + +src_prepare() { + bunzip2 */usr/share/doc/*/README.gentoo.bz2 || die + default +} + +src_install() { + insinto /usr/share + doins -r */usr/share/{edk2,qemu}/ + + # Compatibility with older package versions. + dosym edk2/OvmfX64 /usr/share/edk2-ovmf + + secureboot_auto_sign --in-place + readme.gentoo_create_doc + + local a + for a in ${ARCHES}; do + newdoc "${a}"/usr/share/doc/*/README.gentoo README-"${a}".gentoo + done +} + +pkg_preinst() { + local OLD=${EROOT}/usr/share/edk2-ovmf NEW=${EROOT}/usr/share/edk2/OvmfX64 + if [[ -d ${OLD} && ! -L ${OLD} ]]; then + { + rm -vf "${OLD}"/{OVMF_{CODE,CODE.secboot,VARS}.fd,EnrollDefaultKeys.efi,Shell.efi,UefiShell.img} && + mkdir -p "${NEW}" && + find "${OLD}" -mindepth 1 -maxdepth 1 -execdir mv --update=none-fail -vt "${NEW}"/ {} + && + rmdir "${OLD}" + } || die "unable to replace old directory with compatibility symlink" + fi +} + +pkg_postinst() { + readme.gentoo_print_elog +} diff --git a/sys-firmware/edk2-bin/edk2-bin-202511.ebuild b/sys-firmware/edk2-bin/edk2-bin-202511.ebuild new file mode 100644 index 000000000000..bf887f6d1b15 --- /dev/null +++ b/sys-firmware/edk2-bin/edk2-bin-202511.ebuild @@ -0,0 +1,75 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit readme.gentoo-r1 secureboot + +BINPKG="${P/-bin/}-1" +QEMU_TARGETS="aarch64 loongarch64 riscv64 x86_64" + +DESCRIPTION="TianoCore EDK II UEFI firmware for virtual machines" +HOMEPAGE="https://github.com/tianocore/edk2" +for a in ${QEMU_TARGETS}; do + SRC_URI+=" qemu_softmmu_targets_${a}? ( https://dev.gentoo.org/~chewi/distfiles/${BINPKG}-qemu-${a}.xpak )" +done +S="${WORKDIR}" +LICENSE="BSD-2-with-patent MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86" +printf -v IUSE ' qemu_softmmu_targets_%s' ${QEMU_TARGETS} +REQUIRED_USE="|| ( ${IUSE} )" + +RDEPEND="!sys-firmware/edk2" + +DOC_CONTENTS="This package includes the TianoCore EDK II UEFI firmware for virtual \ +machines of these QEMU architectures: ${QEMU_TARGETS}. See each architecture's README \ +for usage details." + +src_unpack() { + local a + for a in ${QEMU_TARGETS}; do + use "qemu_softmmu_targets_${a}" || continue + mkdir "${a}" || die + tar -C "${a}" -xf - < <(xz -c -d --single-stream "${DISTDIR}/${BINPKG}-qemu-${a}.xpak") || + die "unpacking ${a} QEMU binpkg failed" + done +} + +src_prepare() { + bunzip2 */usr/share/doc/*/README.gentoo.bz2 || die + default +} + +src_install() { + insinto /usr/share + doins -r */usr/share/{edk2,qemu}/ + + # Compatibility with older package versions. + use qemu_softmmu_targets_x86_64 && dosym edk2/OvmfX64 /usr/share/edk2-ovmf + + secureboot_auto_sign --in-place + readme.gentoo_create_doc + + local a + for a in ${QEMU_TARGETS}; do + use "qemu_softmmu_targets_${a}" || continue + newdoc "${a}"/usr/share/doc/*/README.gentoo README-"${a}".gentoo + done +} + +pkg_preinst() { + local OLD=${EROOT}/usr/share/edk2-ovmf NEW=${EROOT}/usr/share/edk2/OvmfX64 + if use qemu_softmmu_targets_x86_64 && [[ -d ${OLD} && ! -L ${OLD} ]]; then + { + rm -vf "${OLD}"/{OVMF_{CODE,CODE.secboot,VARS}.fd,EnrollDefaultKeys.efi,Shell.efi,UefiShell.img} && + mkdir -p "${NEW}" && + find "${OLD}" -mindepth 1 -maxdepth 1 -execdir mv --update=none-fail -vt "${NEW}"/ {} + && + rmdir "${OLD}" + } || die "unable to replace old directory with compatibility symlink" + fi +} + +pkg_postinst() { + readme.gentoo_print_elog +} diff --git a/sys-firmware/edk2-bin/metadata.xml b/sys-firmware/edk2-bin/metadata.xml new file mode 100644 index 000000000000..aca18aaa2c8c --- /dev/null +++ b/sys-firmware/edk2-bin/metadata.xml @@ -0,0 +1,15 @@ +<?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> + <maintainer type="person"> + <email>chewi@gentoo.org</email> + <name>James Le Cuirot</name> + </maintainer> + <upstream> + <remote-id type="cpe">cpe:/a:tianocore:edk2</remote-id> + </upstream> +</pkgmetadata> diff --git a/sys-firmware/edk2/Manifest b/sys-firmware/edk2/Manifest new file mode 100644 index 000000000000..df45726be667 --- /dev/null +++ b/sys-firmware/edk2/Manifest @@ -0,0 +1,17 @@ +DIST amd64_DBXUpdate_v1.6.3.bin 24053 BLAKE2B 4796ce3218df9c29d88fe5a14975e0b7ac2dc1271dd89ba1e6b7c1f898d196deab698bf93e527aa4c5802a0a4092556c4480220baa349cd98ddf8b500767225a SHA512 0452d2c302f702eeb2d549fd5ac4b3c3623172de9559a881bc92875590f3c5b65e301b880f5f76786e22b1af145b2aa6e58c74fef00a279950f3d6641aef484e +DIST arm64_DBXUpdate_05092023.bin 4610 BLAKE2B 4c6628e5c297a26ca5a1235e377a794fdc18f8201dc7bcb134eb5dd164cc16497ff8d7e598509a61dadf3aa6e8525c9c9e4ca597af62a1c93f97945594517303 SHA512 5a2816e3ff73fef1d258c1418a09b264291408493147399da6b71b6a20bd6b347c00153e22589b2635172cdc57de404ff423be41a6c382a9b25ee9a76922f397 +DIST arm64_DBXUpdate_v1.6.3.bin 4613 BLAKE2B 1a60e4e54416886111451e51bf9bdcc08f5da696050cc47cf941b1e040f7e872b1cf05e653366e31395e68bcafc689b30419e7c6133821434251341edf6f3d3c SHA512 2af6d22d139ff58cb2d0dc0883257b6131f1bd9cc04b4c062c21f1d0560508f8f4ea062e6946fd37c8ab47259772884e29c32a93844d5d6beadcf9e778e4ee51 +DIST brotli-e230f474b87134e8c6c85b630084c612057f253e.tar.gz 646535 BLAKE2B cac5c68aa0c0ed1b47a1d97c86edc444ab21cdf66e51b66b5ce9f39af67640d3e0ac076c7b3e23be0a7c2c7e3436ea25e9972a2c577d0822a578e1720cd109e4 SHA512 007068eae049e80f91ffac3be12159f7278ce2237f969055dc1bc07b87e44eaa4f5dab70940710bf2e673134cb9ad9c0fd3f46c9f93d16905fb4ddc3e0f88c3e +DIST brotli-f4153a09f87cbb9c826d8fc12c74642bb2d879ea.tar.gz 512229 BLAKE2B cd86cc2cc7eefad24f87cda8006409bf764922b5f23ccfb951e7a41214b12004ce532b11f94f5fb858b3bf71f9abf8ef17ba219fa96bd5be23b51873afad0fd5 SHA512 7f48e794e738b31c2005e7cef6d8c0cc0d543f1cd8c137ae8ba14602cac2873de6299a3f32ad52be869f513e7548341353ed049609daef1063975694d9a9b80b +DIST edk2-202411.tar.gz 17669304 BLAKE2B 2aa1d5c5d7b99a1abccf0c8b0b04a74006319a269ec03814ab9a28d38299f7d00f57d457c4e011067ad8dfc816430372ab02130ec138b148999662764a411483 SHA512 633483a1ff915f6e5f5a6d3c329f517d6c070368855f1d5348a80e22e71ac13ff4c6774c8620482a4e5cefe03907edc3a904ae405cbfe2dcd025ddd82f039eaf +DIST edk2-202502.tar.gz 18217115 BLAKE2B a72fd05398b32377f6a0b80fa2c3c84ed4f53039174f8e814dc6c57617d21a3c99603d5c572a372295399658a42e3ff1ab642f8cbaa8782301268344443f6502 SHA512 1421b3e14acf6aa51c84cf0a12716990f08815fff631f4657bb9907fd8d620e9fac7794e05c2eed54d5f8966f8e9267d32bf2256237a959bd727629163b8c00d +DIST edk2-202511.tar.gz 18471528 BLAKE2B c3d484061c1360bb2f3f08114875699ecc1cb03c90949c6cbfa140865c83fef5dabe3df4e37d12a8d71f2484c18ae0fbae6c28b56c0404ce6fa8112b5961ef8d SHA512 0a9d70b9fa72457eac0937cbca1f02ed101ffc50dd67be6ca0f4d290b0ade32d9000637060242a5980890e29818186c7bc77b8ff940541759089519302ab1c20 +DIST libspdm-50924a4c8145fc721e17208f55814d2b38766fe6.tar.gz 1967479 BLAKE2B fe15ac34fa65a86b13ed3a44959d860dc1bf39fd9a4bd2dcde2d2ec6ad9490f5d7d53320c481f9cf931a636527719c29eb315d178f2bd48cb905216849b633b4 SHA512 f11e748e40b66c37365175ff0ef9c0a695db2e7da50da2cf8a33267064b53e5938cfb1363d27e5ce0a174b2059533352bb8a44c48003db900c6b844167473198 +DIST libspdm-98ef964e1e9a0c39c7efb67143d3a13a819432e0.tar.gz 2017163 BLAKE2B 312528eb0af2cffb4d3557354ada87302b471a4c1cc73bad74a60162cdbb057be392fd57f18bef99a437ccb879583c69afb2596bf120656787b4b6530005316d SHA512 366155f146f47f7fe81c2b7863c3dff6339dd017b3d8ebe2e843ee04fedb6911193248cea2d048547a4389b4727c1576d5b6c1f26bbe83362299b52d72527f52 +DIST mbedtls-8c89224991adff88d53cd380f42a2baa36f91454.tar.gz 4587796 BLAKE2B c28df5c52ac3ed5ef6a2b9eba29f3894d3f5f11083869e8b137cd66d4f72b2a0971c91636ce4626869bd06eeb5e661d90160021f92564b9449fb13001b8e379f SHA512 a421c03c740867210f9e30457bc951928cafec3622e1e304f8c18ce5c5e27c5c8e6c7715180ecb74c6a997e4b91ee160e52b357e1bb65ff76ce8414a87ec4889 +DIST mipi-sys-t-370b5944c046bab043dd8b133727b2135af7747a.tar.gz 378522 BLAKE2B d3f1033e78ad814ebb991e66d8c1437aa3583e91481af9785b97b6021c7c45fb9dcb8d2d58d0a0fe84fbd9f108d24a27234df298eb8a2ba2340e5c9c85c89c40 SHA512 de6888577ceab7ab6915d792f3c48248cfa53357ccd310fc7f7eae4d25a932de8c7c23e5b898c9ebf61cf86cb538277273f2eb131a628b3bf0d46c9a3b9b6686 +DIST openssl-3.0.15.tar.gz 15318633 BLAKE2B f2900d0894b97e86c709079ca4336d5dc508d69e91d3a4de4420c8d9344cb54dada6ea2cdd408166e53db0c652b06654e670701166b67a0a40578676e1cea535 SHA512 acd80f2f7924d90c1416946a5c61eff461926ad60f4821bb6b08845ea18f8452fd5e88a2c2c5bd0d7590a792cb8341a3f3be042fd0a5b6c9c1b84a497c347bbf +DIST openssl-3.4.1.tar.gz 18346056 BLAKE2B 328a2a4f0536b15ffe6421afc99bdb5dcdf3d29f44437fdd80bbf4089f5f2658ca10907e033eda2e04c6b862e49b150ea59d8ab1807d14a3dcf64e10c32e78af SHA512 1de6307c587686711f05d1e96731c43526fa3af51e4cd94c06c880954b67f6eb4c7db3177f0ea5937d41bc1f8cadcf5bce75025b5c1a46a469376960f1001c5f +DIST openssl-3.5.1.tar.gz 53158817 BLAKE2B 172db56ac41cee78bcb5d2223c33d78baf3326d8d466115f39be414384d265ad4541e00096d3f53435f9f89119882ae587b20b1ac05dc2ace46a0d43d7cc6996 SHA512 0fa152ae59ab5ea066319de039dfb1d24cbb247172d7512feb5dd920db3740f219d76b0195ea562f84fe5eae36c23772302eddfbb3509df13761452b4dafb9d3 +DIST pylibfdt-cfff805481bdea27f900c32698171286542b8d3c.tar.gz 49659 BLAKE2B 05e954fc2d72618b3f56c08bdfcd64479259902ee2613d034b66ebe50e33b02b243bed1191d8dcdcea9fcb2553f84a737ae12514d30c48e776efc858a4879894 SHA512 c2f4cbda24bc4a2140135de2db19fd7ad0b6eff2a748862b4166bf0e65f3e324e2855ea4331dafa2c82f44b4d01309c8ac50159cbcc076a968a1169c8709a523 +DIST x64_DBXUpdate_05092023.bin 21170 BLAKE2B 9b74945ef441e65c50116122bc24578c22c8f5f7af94e46322a96bd15035b79c0af4c1fd5366017b347b9aaf3f5791b9d6ea84ef141500700ccf69f708f91389 SHA512 71fb6e8cd6918126b3acd78b95651913336df372e13fdfdfdd20d5d23f0e509050c6c88c8a2c43f8ac44f987df86bd45174bb3065d5a7a8c7e3b8772fd06d624 diff --git a/sys-firmware/edk2/edk2-202411.ebuild b/sys-firmware/edk2/edk2-202411.ebuild new file mode 100644 index 000000000000..7052a53f7ae5 --- /dev/null +++ b/sys-firmware/edk2/edk2-202411.ebuild @@ -0,0 +1,346 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_REQ_USE="sqlite" +PYTHON_COMPAT=( python3_{13..14} ) + +inherit edo prefix python-any-r1 readme.gentoo-r1 secureboot toolchain-funcs + +DESCRIPTION="TianoCore EDK II UEFI firmware for virtual machines" +HOMEPAGE="https://github.com/tianocore/edk2" + +DBXDATE="05092023" # MMDDYYYY +BUNDLED_BROTLI_SUBMODULE_SHA="f4153a09f87cbb9c826d8fc12c74642bb2d879ea" +BUNDLED_LIBFDT_SUBMODULE_SHA="cfff805481bdea27f900c32698171286542b8d3c" +BUNDLED_LIBSPDM_SUBMODULE_SHA="50924a4c8145fc721e17208f55814d2b38766fe6" +BUNDLED_MBEDTLS_SUBMODULE_SHA="8c89224991adff88d53cd380f42a2baa36f91454" +BUNDLED_MIPI_SYS_T_SUBMODULE_SHA="370b5944c046bab043dd8b133727b2135af7747a" +BUNDLED_OPENSSL_SUBMODULE_P="openssl-3.0.15" + +SRC_URI=" + https://github.com/tianocore/${PN}/archive/${PN}-stable${PV}.tar.gz + -> ${P}.tar.gz + https://github.com/google/brotli/archive/${BUNDLED_BROTLI_SUBMODULE_SHA}.tar.gz + -> brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}.tar.gz + https://github.com/DMTF/libspdm/archive/${BUNDLED_LIBSPDM_SUBMODULE_SHA}.tar.gz + -> libspdm-${BUNDLED_LIBSPDM_SUBMODULE_SHA}.tar.gz + https://github.com/Mbed-TLS/mbedtls/archive/${BUNDLED_MBEDTLS_SUBMODULE_SHA}.tar.gz + -> mbedtls-${BUNDLED_MBEDTLS_SUBMODULE_SHA}.tar.gz + https://github.com/MIPI-Alliance/public-mipi-sys-t/archive/${BUNDLED_MIPI_SYS_T_SUBMODULE_SHA}.tar.gz + -> mipi-sys-t-${BUNDLED_MIPI_SYS_T_SUBMODULE_SHA}.tar.gz + https://github.com/openssl/openssl/releases/download/${BUNDLED_OPENSSL_SUBMODULE_P}/${BUNDLED_OPENSSL_SUBMODULE_P}.tar.gz + + amd64? ( + https://uefi.org/sites/default/files/resources/x64_DBXUpdate_${DBXDATE}.bin + https://uefi.org/sites/default/files/resources/x64_DBXUpdate.bin -> x64_DBXUpdate_${DBXDATE}.bin + ) + + arm64? ( + https://uefi.org/sites/default/files/resources/arm64_DBXUpdate_${DBXDATE}.bin + https://uefi.org/sites/default/files/resources/arm64_DBXUpdate.bin -> arm64_DBXUpdate_${DBXDATE}.bin + https://github.com/devicetree-org/pylibfdt/archive/${BUNDLED_LIBFDT_SUBMODULE_SHA}.tar.gz + -> pylibfdt-${BUNDLED_LIBFDT_SUBMODULE_SHA}.tar.gz + ) +" + +S="${WORKDIR}/${PN}-${PN}-stable${PV}" +LICENSE="BSD-2-with-patent MIT" +SLOT="0" +KEYWORDS="-* amd64 arm64 ~loong ~riscv" + +BDEPEND=" + ${PYTHON_DEPS} + app-emulation/qemu + app-emulation/virt-firmware + >=sys-power/iasl-20160729 + amd64? ( <dev-lang/nasm-3 ) +" + +RDEPEND=" + !sys-firmware/edk2-bin +" + +PATCHES=( + "${FILESDIR}/${PN}-202411-werror.patch" + "${FILESDIR}/${PN}-202411-gcc15.patch" + "${FILESDIR}/${PN}-202411-loong.patch" + "${FILESDIR}/${PN}-202408-binutils-2.41-textrels.patch" +) + +DISABLE_AUTOFORMATTING="true" +DIR="/usr/share/${PN}" + +pkg_setup() { + python-any-r1_pkg_setup + secureboot_pkg_setup + + local QEMU_ARCH ARCH_DIRS UNIT0 UNIT1 FMT + + case "${ARCH}" in + amd64) + TARGET_ARCH="X64" + QEMU_ARCH="x86_64" + ARCH_DIRS="${DIR}/OvmfX64" + UNIT0="OVMF_CODE.fd" + UNIT1="OVMF_VARS.fd" + FMT="raw" + ;; + arm64) + TARGET_ARCH="AARCH64" + QEMU_ARCH="aarch64" + ARCH_DIRS="${DIR}/ArmVirtQemu-AARCH64" + UNIT0="QEMU_EFI.qcow2" + UNIT1="QEMU_VARS.qcow2" + FMT="qcow2" + ;; + loong) + TARGET_ARCH="LOONGARCH64" + QEMU_ARCH="loongarch64" + ARCH_DIRS="${DIR}/LoongArchVirtQemu" + UNIT0="QEMU_EFI.fd" + UNIT1="QEMU_VARS.fd" + FMT="raw" + ;; + riscv) + TARGET_ARCH="RISCV64" + QEMU_ARCH="riscv64" + ARCH_DIRS="${DIR}/RiscVVirtQemu" + UNIT0="RISCV_VIRT_CODE.qcow2" + UNIT1="RISCV_VIRT_VARS.qcow2" + FMT="qcow2" + ;; + esac + + DOC_CONTENTS="This package includes the TianoCore EDK II UEFI firmware for ${QEMU_ARCH} +virtual machines. The firmware is located under ${ARCH_DIRS}. + +In order to use the firmware, you can run QEMU like so: + + $ qemu-system-${QEMU_ARCH} \\ + -drive file=${EPREFIX}${ARCH_DIRS%% *}/${UNIT0},if=pflash,format=${FMT},unit=0,readonly=on \\ + -drive file=/path/to/the/copy/of/${UNIT1},if=pflash,format=${FMT},unit=1 \\ + ..." + + case "${ARCH}" in + amd64) DOC_CONTENTS+=" + +The firmware does not support CSM due to the lack of a free +implementation. If you need a firmware with CSM support, you have to +download one for yourself. Firmware blobs are commonly labelled: + + OVMF_CODE-with-csm.fd + OVMF_VARS-with-csm.fd" + ;; + arm64) DOC_CONTENTS+=" + +WARNING! QEMU_EFI.secboot_INSECURE.qcow2 does have Secure Boot +enabled, but it must not be used in production. The lack of an SMM +implementation for arm64 in this firmware means that the EFI +variable store is unprotected, making the firmware unsafe." + ;; + esac +} + +link_mod() { + rmdir "$2" && ln -sfT "$1" "$2" || die "linking ${2##*/} failed" +} + +src_prepare() { + # Bundled submodules + link_mod "${WORKDIR}/brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}" \ + BaseTools/Source/C/BrotliCompress/brotli + link_mod "${WORKDIR}/brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}" \ + MdeModulePkg/Library/BrotliCustomDecompressLib/brotli + link_mod "${WORKDIR}/libspdm-${BUNDLED_LIBSPDM_SUBMODULE_SHA}" \ + SecurityPkg/DeviceSecurity/SpdmLib/libspdm + link_mod "${WORKDIR}/mbedtls-${BUNDLED_MBEDTLS_SUBMODULE_SHA}" \ + CryptoPkg/Library/MbedTlsLib/mbedtls + link_mod "${WORKDIR}/public-mipi-sys-t-${BUNDLED_MIPI_SYS_T_SUBMODULE_SHA}" \ + MdePkg/Library/MipiSysTLib/mipisyst + link_mod "${WORKDIR}/${BUNDLED_OPENSSL_SUBMODULE_P}" \ + CryptoPkg/Library/OpensslLib/openssl + + use arm64 && + link_mod "${WORKDIR}/pylibfdt-${BUNDLED_LIBFDT_SUBMODULE_SHA}" \ + MdePkg/Library/BaseFdtLib/libfdt + + default + + # Fix descriptor paths for prefix. + hprefixify "${FILESDIR}"/descriptors/*.json +} + +mybuild() { + edo build \ + -t "${TOOLCHAIN}" \ + -b "${BUILD_TARGET}" \ + -D NETWORK_HTTP_BOOT_ENABLE \ + -D NETWORK_IP6_ENABLE \ + -D NETWORK_TLS_ENABLE \ + -D TPM1_ENABLE \ + -D TPM2_ENABLE \ + -D TPM2_CONFIG_ENABLE \ + "${BUILD_ARGS[@]}" \ + "${@}" +} + +# Add the MS and Red Hat Secure Boot certificates and update the revocation list +# for the given architecture in the given raw variables image. +mk_fw_vars() { + edo virt-fw-vars \ + --set-dbx "${DISTDIR}/$1_DBXUpdate_${DBXDATE}.bin" \ + --secure-boot --enroll-redhat --inplace "$2" +} + +# Convert the given images from raw to QCOW2 and resize them to the amount given +# as the first argument. Specify 0 to not resize. +raw_to_qcow2() { + local SIZE=$1 RAW + shift + + for RAW in "${@}"; do + edo qemu-img convert -f raw -O qcow2 -o cluster_size=4096 -S 4096 "${RAW}" "${RAW%.fd}.qcow2" + [[ ${SIZE} != 0 ]] && edo qemu-img resize -f qcow2 "${RAW%.fd}.qcow2" "${SIZE}" + rm "${RAW}" || die + done +} + +src_compile() { + TOOLCHAIN="GCC5" + BUILD_TARGET="RELEASE" + BUILD_DIR="${BUILD_TARGET}_${TOOLCHAIN}" + BUILD_ARGS=() + + tc-export_build_env + emake -C BaseTools \ + CC="$(tc-getBUILD_CC)" \ + CXX="$(tc-getBUILD_CXX)" \ + EXTRA_OPTFLAGS="${BUILD_CFLAGS}" \ + EXTRA_LDFLAGS="${BUILD_LDFLAGS}" + + export \ + "${TOOLCHAIN}_${TARGET_ARCH}_PREFIX=${CHOST}-" \ + "${TOOLCHAIN}_BIN=${CHOST}-" + + . ./edksetup.sh + + # DO NOT enable the shell with Secure Boot as it can be used as a bypass! + + case "${ARCH}" in + amd64) + local SIZE + for SIZE in _2M _4M; do + mybuild -a X64 -p OvmfPkg/OvmfPkgX64.dsc \ + -D FD_SIZE${SIZE}B \ + -D BUILD_SHELL=FALSE \ + -D SECURE_BOOT_ENABLE \ + -D SMM_REQUIRE + + mv -T Build/OvmfX64 Build/OvmfX64${SIZE}.secboot || die + + mybuild -a X64 -p OvmfPkg/OvmfPkgX64.dsc \ + -D FD_SIZE${SIZE}B + + mv -T Build/OvmfX64 Build/OvmfX64${SIZE} || die + + mk_fw_vars x64 Build/OvmfX64${SIZE}.secboot/"${BUILD_DIR}"/FV/OVMF_VARS.fd + done + + # Fedora only converts newer images to QCOW2. 2MB images are raw. + raw_to_qcow2 0 Build/OvmfX64_4M*/"${BUILD_DIR}"/FV/OVMF_{CODE,VARS}.fd + ;; + arm64) + BUILD_ARGS+=( + # grub.efi uses EfiLoaderData for code + --pcd PcdDxeNxMemoryProtectionPolicy=0xC000000000007FD1 + # shim.efi has broken MemAttr code + --pcd PcdUninstallMemAttrProtocol=TRUE + ) + + mybuild -a AARCH64 -p ArmVirtPkg/ArmVirtQemu.dsc \ + -D BUILD_SHELL=FALSE \ + -D SECURE_BOOT_ENABLE + + mv -T Build/ArmVirtQemu-AARCH64 Build/ArmVirtQemu-AARCH64.secboot_INSECURE || die + + mybuild -a AARCH64 -p ArmVirtPkg/ArmVirtQemu.dsc + + mk_fw_vars arm64 Build/ArmVirtQemu-AARCH64.secboot_INSECURE/"${BUILD_DIR}"/FV/QEMU_VARS.fd + raw_to_qcow2 64m Build/ArmVirtQemu-AARCH64*/"${BUILD_DIR}"/FV/QEMU_{EFI,VARS}.fd + ;; + loong) + BUILD_ARGS+=( + # fails to seed the OpenSSL RNG during early initialization due + # to improper FPU enabling (maybe too late) + -D NETWORK_TLS_ENABLE=FALSE + ) + mybuild -a LOONGARCH64 -p OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc + ;; + riscv) + mybuild -a RISCV64 -p OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc + raw_to_qcow2 32m Build/RiscVVirtQemu/"${BUILD_DIR}"/FV/RISCV_VIRT_{CODE,VARS}.fd + ;; + esac +} + +src_install() { + local SIZE TYPE FMT + + case "${ARCH}" in + amd64) + insinto ${DIR}/OvmfX64 + doins Build/OvmfX64_2M/"${BUILD_DIR}"/X64/Shell.efi + + for SIZE in _2M _4M; do + for TYPE in "" .secboot; do + [[ ${SIZE} = _4M ]] && FMT=qcow2 || FMT=fd + newins Build/OvmfX64${SIZE}${TYPE}/"${BUILD_DIR}"/FV/OVMF_CODE.${FMT} OVMF_CODE${SIZE#_2M}${TYPE}.${FMT} + newins Build/OvmfX64${SIZE}${TYPE}/"${BUILD_DIR}"/FV/OVMF_VARS.${FMT} OVMF_VARS${SIZE#_2M}${TYPE}.${FMT} + done + done + + # Compatibility with older package versions. + dosym ${PN}/OvmfX64 /usr/share/edk2-ovmf + ;; + arm64) + insinto ${DIR}/ArmVirtQemu-AARCH64 + + for TYPE in "" .secboot_INSECURE; do + newins Build/ArmVirtQemu-AARCH64${TYPE}/"${BUILD_DIR}"/FV/QEMU_EFI.qcow2 QEMU_EFI${TYPE}.qcow2 + newins Build/ArmVirtQemu-AARCH64${TYPE}/"${BUILD_DIR}"/FV/QEMU_VARS.qcow2 QEMU_VARS${TYPE}.qcow2 + done + ;; + loong) + insinto ${DIR}/LoongArchVirtQemu + doins Build/LoongArchVirtQemu/"${BUILD_DIR}"/FV/QEMU_{EFI,VARS}.fd + ;; + riscv) + insinto ${DIR}/RiscVVirtQemu + doins Build/RiscVVirtQemu/"${BUILD_DIR}"/FV/RISCV_VIRT_{CODE,VARS}.qcow2 + ;; + esac + + insinto /usr/share/qemu/firmware + doins "${FILESDIR}"/descriptors/*"${TARGET_ARCH,,}"*.json + + secureboot_auto_sign --in-place + readme.gentoo_create_doc +} + +pkg_preinst() { + local OLD=${EROOT}/usr/share/edk2-ovmf NEW=${EROOT}/${DIR}/OvmfX64 + if [[ -d ${OLD} && ! -L ${OLD} ]]; then + { + rm -vf "${OLD}"/{OVMF_{CODE,CODE.secboot,VARS}.fd,EnrollDefaultKeys.efi,Shell.efi,UefiShell.img} && + mkdir -p "${NEW}" && + find "${OLD}" -mindepth 1 -maxdepth 1 -execdir mv --update=none-fail -vt "${NEW}"/ {} + && + rmdir "${OLD}" + } || die "unable to replace old directory with compatibility symlink" + fi +} + +pkg_postinst() { + readme.gentoo_print_elog +} diff --git a/sys-firmware/edk2/edk2-202502-r1.ebuild b/sys-firmware/edk2/edk2-202502-r1.ebuild new file mode 100644 index 000000000000..8a0a45673c32 --- /dev/null +++ b/sys-firmware/edk2/edk2-202502-r1.ebuild @@ -0,0 +1,354 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_REQ_USE="sqlite" +PYTHON_COMPAT=( python3_{13..14} ) + +inherit edo prefix python-any-r1 readme.gentoo-r1 secureboot toolchain-funcs + +DESCRIPTION="TianoCore EDK II UEFI firmware for virtual machines" +HOMEPAGE="https://github.com/tianocore/edk2" + +DBXDATE="05092023" # MMDDYYYY +BUNDLED_BROTLI_SUBMODULE_SHA="f4153a09f87cbb9c826d8fc12c74642bb2d879ea" +BUNDLED_LIBFDT_SUBMODULE_SHA="cfff805481bdea27f900c32698171286542b8d3c" +BUNDLED_LIBSPDM_SUBMODULE_SHA="98ef964e1e9a0c39c7efb67143d3a13a819432e0" +BUNDLED_MBEDTLS_SUBMODULE_SHA="8c89224991adff88d53cd380f42a2baa36f91454" +BUNDLED_MIPI_SYS_T_SUBMODULE_SHA="370b5944c046bab043dd8b133727b2135af7747a" +BUNDLED_OPENSSL_SUBMODULE_P="openssl-3.4.1" + +SRC_URI=" + https://github.com/tianocore/${PN}/archive/${PN}-stable${PV}.tar.gz + -> ${P}.tar.gz + https://github.com/google/brotli/archive/${BUNDLED_BROTLI_SUBMODULE_SHA}.tar.gz + -> brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}.tar.gz + https://github.com/DMTF/libspdm/archive/${BUNDLED_LIBSPDM_SUBMODULE_SHA}.tar.gz + -> libspdm-${BUNDLED_LIBSPDM_SUBMODULE_SHA}.tar.gz + https://github.com/Mbed-TLS/mbedtls/archive/${BUNDLED_MBEDTLS_SUBMODULE_SHA}.tar.gz + -> mbedtls-${BUNDLED_MBEDTLS_SUBMODULE_SHA}.tar.gz + https://github.com/MIPI-Alliance/public-mipi-sys-t/archive/${BUNDLED_MIPI_SYS_T_SUBMODULE_SHA}.tar.gz + -> mipi-sys-t-${BUNDLED_MIPI_SYS_T_SUBMODULE_SHA}.tar.gz + https://github.com/openssl/openssl/releases/download/${BUNDLED_OPENSSL_SUBMODULE_P}/${BUNDLED_OPENSSL_SUBMODULE_P}.tar.gz + + amd64? ( + https://uefi.org/sites/default/files/resources/x64_DBXUpdate_${DBXDATE}.bin + https://uefi.org/sites/default/files/resources/x64_DBXUpdate.bin -> x64_DBXUpdate_${DBXDATE}.bin + ) + + arm64? ( + https://uefi.org/sites/default/files/resources/arm64_DBXUpdate_${DBXDATE}.bin + https://uefi.org/sites/default/files/resources/arm64_DBXUpdate.bin -> arm64_DBXUpdate_${DBXDATE}.bin + https://github.com/devicetree-org/pylibfdt/archive/${BUNDLED_LIBFDT_SUBMODULE_SHA}.tar.gz + -> pylibfdt-${BUNDLED_LIBFDT_SUBMODULE_SHA}.tar.gz + ) +" + +S="${WORKDIR}/${PN}-${PN}-stable${PV}" +LICENSE="BSD-2-with-patent MIT" +SLOT="0" +KEYWORDS="-* amd64 ~loong ~riscv" + +BDEPEND=" + ${PYTHON_DEPS} + app-emulation/qemu + app-emulation/virt-firmware + >=sys-power/iasl-20160729 + amd64? ( >=dev-lang/nasm-2.0.7 ) +" + +RDEPEND=" + !sys-firmware/edk2-bin +" + +PATCHES=( + "${FILESDIR}/${PN}-202411-werror.patch" + "${FILESDIR}/${PN}-202408-binutils-2.41-textrels.patch" + "${FILESDIR}/edk2-202502-nasm-3.patch" +) + +DISABLE_AUTOFORMATTING="true" +DIR="/usr/share/${PN}" + +pkg_setup() { + python-any-r1_pkg_setup + secureboot_pkg_setup + + local QEMU_ARCH ARCH_DIRS UNIT0 UNIT1 FMT + + case "${ARCH}" in + amd64) + TARGET_ARCH="X64" + QEMU_ARCH="x86_64" + ARCH_DIRS="${DIR}/OvmfX64" + UNIT0="OVMF_CODE.fd" + UNIT1="OVMF_VARS.fd" + FMT="raw" + ;; + arm64) + TARGET_ARCH="AARCH64" + QEMU_ARCH="aarch64" + ARCH_DIRS="${DIR}/ArmVirtQemu-AARCH64" + UNIT0="QEMU_EFI.qcow2" + UNIT1="QEMU_VARS.qcow2" + FMT="qcow2" + ;; + loong) + TARGET_ARCH="LOONGARCH64" + QEMU_ARCH="loongarch64" + ARCH_DIRS="${DIR}/LoongArchVirtQemu" + UNIT0="QEMU_EFI.qcow2" + UNIT1="QEMU_VARS.qcow2" + FMT="qcow2" + ;; + riscv) + TARGET_ARCH="RISCV64" + QEMU_ARCH="riscv64" + ARCH_DIRS="${DIR}/RiscVVirtQemu" + UNIT0="RISCV_VIRT_CODE.qcow2" + UNIT1="RISCV_VIRT_VARS.qcow2" + FMT="qcow2" + ;; + esac + + DOC_CONTENTS="This package includes the TianoCore EDK II UEFI firmware for ${QEMU_ARCH} +virtual machines. The firmware is located under ${ARCH_DIRS}. + +In order to use the firmware, you can run QEMU like so: + + $ qemu-system-${QEMU_ARCH} \\ + -drive file=${EPREFIX}${ARCH_DIRS%% *}/${UNIT0},if=pflash,format=${FMT},unit=0,readonly=on \\ + -drive file=/path/to/the/copy/of/${UNIT1},if=pflash,format=${FMT},unit=1 \\ + ..." + + case "${ARCH}" in + amd64) DOC_CONTENTS+=" + +The firmware does not support CSM due to the lack of a free +implementation. If you need a firmware with CSM support, you have to +download one for yourself. Firmware blobs are commonly labelled: + + OVMF_CODE-with-csm.fd + OVMF_VARS-with-csm.fd" + ;; + arm64) DOC_CONTENTS+=" + +WARNING! QEMU_EFI.secboot_INSECURE.qcow2 does have Secure Boot +enabled, but it must not be used in production. The lack of an SMM +implementation for arm64 in this firmware means that the EFI +variable store is unprotected, making the firmware unsafe." + ;; + esac +} + +link_mod() { + rmdir "$2" && ln -sfT "$1" "$2" || die "linking ${2##*/} failed" +} + +src_prepare() { + # Bundled submodules + link_mod "${WORKDIR}/brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}" \ + BaseTools/Source/C/BrotliCompress/brotli + link_mod "${WORKDIR}/brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}" \ + MdeModulePkg/Library/BrotliCustomDecompressLib/brotli + link_mod "${WORKDIR}/libspdm-${BUNDLED_LIBSPDM_SUBMODULE_SHA}" \ + SecurityPkg/DeviceSecurity/SpdmLib/libspdm + link_mod "${WORKDIR}/mbedtls-${BUNDLED_MBEDTLS_SUBMODULE_SHA}" \ + CryptoPkg/Library/MbedTlsLib/mbedtls + link_mod "${WORKDIR}/public-mipi-sys-t-${BUNDLED_MIPI_SYS_T_SUBMODULE_SHA}" \ + MdePkg/Library/MipiSysTLib/mipisyst + link_mod "${WORKDIR}/${BUNDLED_OPENSSL_SUBMODULE_P}" \ + CryptoPkg/Library/OpensslLib/openssl + + use arm64 && + link_mod "${WORKDIR}/pylibfdt-${BUNDLED_LIBFDT_SUBMODULE_SHA}" \ + MdePkg/Library/BaseFdtLib/libfdt + + default + + # Fix descriptor paths for prefix. + hprefixify "${FILESDIR}"/descriptors/*.json +} + +mybuild() { + edo build \ + -t "${TOOLCHAIN}" \ + -b "${BUILD_TARGET}" \ + -D NETWORK_HTTP_BOOT_ENABLE \ + -D NETWORK_IP6_ENABLE \ + -D NETWORK_TLS_ENABLE \ + -D TPM1_ENABLE \ + -D TPM2_ENABLE \ + -D TPM2_CONFIG_ENABLE \ + "${BUILD_ARGS[@]}" \ + "${@}" +} + +# Add the MS and Red Hat Secure Boot certificates and update the revocation list +# for the given architecture in the given raw variables image. +mk_fw_vars() { + edo virt-fw-vars \ + --set-dbx "${DISTDIR}/$1_DBXUpdate_${DBXDATE}.bin" \ + --secure-boot --enroll-redhat --inplace "$2" +} + +# Convert the given images from raw to QCOW2 and resize them to the amount given +# as the first argument. Specify 0 to not resize. +raw_to_qcow2() { + local SIZE=$1 RAW + shift + + for RAW in "${@}"; do + edo qemu-img convert -f raw -O qcow2 -o cluster_size=4096 -S 4096 "${RAW}" "${RAW%.fd}.qcow2" + [[ ${SIZE} != 0 ]] && edo qemu-img resize -f qcow2 "${RAW%.fd}.qcow2" "${SIZE}" + rm "${RAW}" || die + done +} + +nx_strict_args() { + "${@}" \ + --pcd PcdDxeNxMemoryProtectionPolicy=0xC000000000007FD5 \ + --pcd PcdImageProtectionPolicy=0x03 \ + --pcd PcdNullPointerDetectionPropertyMask=0x03 \ + --pcd PcdSetNxForStack=TRUE +} + +src_compile() { + TOOLCHAIN="GCC5" + BUILD_TARGET="RELEASE" + BUILD_DIR="${BUILD_TARGET}_${TOOLCHAIN}" + BUILD_ARGS=() + + tc-export_build_env + emake -C BaseTools \ + CC="$(tc-getBUILD_CC)" \ + CXX="$(tc-getBUILD_CXX)" \ + EXTRA_OPTFLAGS="${BUILD_CFLAGS}" \ + EXTRA_LDFLAGS="${BUILD_LDFLAGS}" + + export \ + "${TOOLCHAIN}_${TARGET_ARCH}_PREFIX=${CHOST}-" \ + "${TOOLCHAIN}_BIN=${CHOST}-" + + . ./edksetup.sh + + # DO NOT enable the shell with Secure Boot as it can be used as a bypass! + + case "${ARCH}" in + amd64) + BUILD_ARGS+=( + # shim.efi has broken MemAttr code + --pcd PcdUninstallMemAttrProtocol=TRUE + ) + + local SIZE + for SIZE in _2M _4M; do + nx_strict_args mybuild -a X64 -p OvmfPkg/OvmfPkgX64.dsc \ + -D FD_SIZE${SIZE}B \ + -D BUILD_SHELL=FALSE \ + -D SECURE_BOOT_ENABLE \ + -D SMM_REQUIRE + + mv -T Build/OvmfX64 Build/OvmfX64${SIZE}.secboot || die + + mybuild -a X64 -p OvmfPkg/OvmfPkgX64.dsc \ + -D FD_SIZE${SIZE}B \ + --pcd PcdDxeNxMemoryProtectionPolicy=0 + + mv -T Build/OvmfX64 Build/OvmfX64${SIZE} || die + + mk_fw_vars x64 Build/OvmfX64${SIZE}.secboot/"${BUILD_DIR}"/FV/OVMF_VARS.fd + done + + # Fedora only converts newer images to QCOW2. 2MB images are raw. + raw_to_qcow2 0 Build/OvmfX64_4M*/"${BUILD_DIR}"/FV/OVMF_{CODE,VARS}.fd + ;; + arm64) + BUILD_ARGS+=( + # shim.efi has broken MemAttr code + --pcd PcdUninstallMemAttrProtocol=TRUE + ) + + nx_strict_args mybuild -a AARCH64 -p ArmVirtPkg/ArmVirtQemu.dsc \ + -D BUILD_SHELL=FALSE \ + -D SECURE_BOOT_ENABLE + + mv -T Build/ArmVirtQemu-AARCH64 Build/ArmVirtQemu-AARCH64.secboot_INSECURE || die + + mybuild -a AARCH64 -p ArmVirtPkg/ArmVirtQemu.dsc \ + --pcd PcdDxeNxMemoryProtectionPolicy=0xC000000000007FD1 + + mk_fw_vars arm64 Build/ArmVirtQemu-AARCH64.secboot_INSECURE/"${BUILD_DIR}"/FV/QEMU_VARS.fd + raw_to_qcow2 64m Build/ArmVirtQemu-AARCH64*/"${BUILD_DIR}"/FV/QEMU_{EFI,VARS}.fd + ;; + loong) + mybuild -a LOONGARCH64 -p OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc + raw_to_qcow2 0 Build/LoongArchVirtQemu/"${BUILD_DIR}"/FV/QEMU_{EFI,VARS}.fd + ;; + riscv) + mybuild -a RISCV64 -p OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc + raw_to_qcow2 32m Build/RiscVVirtQemu/"${BUILD_DIR}"/FV/RISCV_VIRT_{CODE,VARS}.fd + ;; + esac +} + +src_install() { + local SIZE TYPE FMT + + case "${ARCH}" in + amd64) + insinto ${DIR}/OvmfX64 + doins Build/OvmfX64_2M/"${BUILD_DIR}"/X64/Shell.efi + + for SIZE in _2M _4M; do + for TYPE in "" .secboot; do + [[ ${SIZE} = _4M ]] && FMT=qcow2 || FMT=fd + newins Build/OvmfX64${SIZE}${TYPE}/"${BUILD_DIR}"/FV/OVMF_CODE.${FMT} OVMF_CODE${SIZE#_2M}${TYPE}.${FMT} + newins Build/OvmfX64${SIZE}${TYPE}/"${BUILD_DIR}"/FV/OVMF_VARS.${FMT} OVMF_VARS${SIZE#_2M}${TYPE}.${FMT} + done + done + + # Compatibility with older package versions. + dosym ${PN}/OvmfX64 /usr/share/edk2-ovmf + ;; + arm64) + insinto ${DIR}/ArmVirtQemu-AARCH64 + + for TYPE in "" .secboot_INSECURE; do + newins Build/ArmVirtQemu-AARCH64${TYPE}/"${BUILD_DIR}"/FV/QEMU_EFI.qcow2 QEMU_EFI${TYPE}.qcow2 + newins Build/ArmVirtQemu-AARCH64${TYPE}/"${BUILD_DIR}"/FV/QEMU_VARS.qcow2 QEMU_VARS${TYPE}.qcow2 + done + ;; + loong) + insinto ${DIR}/LoongArchVirtQemu + doins Build/LoongArchVirtQemu/"${BUILD_DIR}"/FV/QEMU_{EFI,VARS}.qcow2 + ;; + riscv) + insinto ${DIR}/RiscVVirtQemu + doins Build/RiscVVirtQemu/"${BUILD_DIR}"/FV/RISCV_VIRT_{CODE,VARS}.qcow2 + ;; + esac + + insinto /usr/share/qemu/firmware + doins "${FILESDIR}"/descriptors/*"${TARGET_ARCH,,}"*.json + + secureboot_auto_sign --in-place + readme.gentoo_create_doc +} + +pkg_preinst() { + local OLD=${EROOT}/usr/share/edk2-ovmf NEW=${EROOT}/${DIR}/OvmfX64 + if [[ -d ${OLD} && ! -L ${OLD} ]]; then + { + rm -vf "${OLD}"/{OVMF_{CODE,CODE.secboot,VARS}.fd,EnrollDefaultKeys.efi,Shell.efi,UefiShell.img} && + mkdir -p "${NEW}" && + find "${OLD}" -mindepth 1 -maxdepth 1 -execdir mv --update=none-fail -vt "${NEW}"/ {} + && + rmdir "${OLD}" + } || die "unable to replace old directory with compatibility symlink" + fi +} + +pkg_postinst() { + readme.gentoo_print_elog +} diff --git a/sys-firmware/edk2/edk2-202511-r1.ebuild b/sys-firmware/edk2/edk2-202511-r1.ebuild new file mode 100644 index 000000000000..e5630b3979c1 --- /dev/null +++ b/sys-firmware/edk2/edk2-202511-r1.ebuild @@ -0,0 +1,382 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_REQ_USE="sqlite" +PYTHON_COMPAT=( python3_{13..14} ) + +inherit edo prefix python-any-r1 readme.gentoo-r1 secureboot toolchain-funcs + +DESCRIPTION="TianoCore EDK II UEFI firmware for virtual machines" +HOMEPAGE="https://github.com/tianocore/edk2" + +BUNDLED_BROTLI_SUBMODULE_SHA="e230f474b87134e8c6c85b630084c612057f253e" +BUNDLED_LIBFDT_SUBMODULE_SHA="cfff805481bdea27f900c32698171286542b8d3c" +BUNDLED_LIBSPDM_SUBMODULE_SHA="98ef964e1e9a0c39c7efb67143d3a13a819432e0" +BUNDLED_MBEDTLS_SUBMODULE_SHA="8c89224991adff88d53cd380f42a2baa36f91454" +BUNDLED_MIPI_SYS_T_SUBMODULE_SHA="370b5944c046bab043dd8b133727b2135af7747a" +BUNDLED_OPENSSL_SUBMODULE_P="openssl-3.5.1" + +SBO_VER="1.6.3" # https://github.com/microsoft/secureboot_objects/releases +DBX_URI="https://github.com/microsoft/secureboot_objects/raw/refs/tags/v${SBO_VER}/PostSignedObjects/DBX/@ARCH@/DBXUpdate.bin -> @ARCH@_DBXUpdate_v${SBO_VER}.bin" + +SRC_URI=" + https://github.com/tianocore/${PN}/archive/${PN}-stable${PV}.tar.gz + -> ${P}.tar.gz + https://github.com/google/brotli/archive/${BUNDLED_BROTLI_SUBMODULE_SHA}.tar.gz + -> brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}.tar.gz + https://github.com/DMTF/libspdm/archive/${BUNDLED_LIBSPDM_SUBMODULE_SHA}.tar.gz + -> libspdm-${BUNDLED_LIBSPDM_SUBMODULE_SHA}.tar.gz + https://github.com/Mbed-TLS/mbedtls/archive/${BUNDLED_MBEDTLS_SUBMODULE_SHA}.tar.gz + -> mbedtls-${BUNDLED_MBEDTLS_SUBMODULE_SHA}.tar.gz + https://github.com/MIPI-Alliance/public-mipi-sys-t/archive/${BUNDLED_MIPI_SYS_T_SUBMODULE_SHA}.tar.gz + -> mipi-sys-t-${BUNDLED_MIPI_SYS_T_SUBMODULE_SHA}.tar.gz + https://github.com/openssl/openssl/releases/download/${BUNDLED_OPENSSL_SUBMODULE_P}/${BUNDLED_OPENSSL_SUBMODULE_P}.tar.gz + + amd64? ( ${DBX_URI//@ARCH@/amd64} ) + arm64? ( ${DBX_URI//@ARCH@/arm64} ) + + !amd64? ( + https://github.com/devicetree-org/pylibfdt/archive/${BUNDLED_LIBFDT_SUBMODULE_SHA}.tar.gz + -> pylibfdt-${BUNDLED_LIBFDT_SUBMODULE_SHA}.tar.gz + ) +" + +S="${WORKDIR}/${PN}-${PN}-stable${PV}" +LICENSE="BSD-2-with-patent MIT" +SLOT="0" +KEYWORDS="-* ~amd64 arm64 ~loong ~riscv" + +BDEPEND=" + ${PYTHON_DEPS} + app-emulation/qemu + app-emulation/virt-firmware + >=sys-power/iasl-20160729 + amd64? ( >=dev-lang/nasm-2.0.7 ) +" + +RDEPEND=" + !sys-firmware/edk2-bin +" + +PATCHES=( + "${FILESDIR}/${PN}-202511-werror.patch" + "${FILESDIR}/${PN}-202502-nasm-3.patch" + "${FILESDIR}/${PN}-202505-UninstallMemAttrProtocol.patch" +) + +DISABLE_AUTOFORMATTING="true" +DIR="/usr/share/${PN}" + +pkg_setup() { + python-any-r1_pkg_setup + secureboot_pkg_setup + + local QEMU_ARCH ARCH_DIRS UNIT0 UNIT1 FMT + + case "${ARCH}" in + amd64) + TARGET_ARCH="X64" + QEMU_ARCH="x86_64" + ARCH_DIRS="${DIR}/OvmfX64" + UNIT0="OVMF_CODE.fd" + UNIT1="OVMF_VARS.fd" + FMT="raw" + ;; + arm64) + TARGET_ARCH="AARCH64" + QEMU_ARCH="aarch64" + ARCH_DIRS="${DIR}/ArmVirtQemu-AArch64" + UNIT0="QEMU_EFI.qcow2" + UNIT1="QEMU_VARS.qcow2" + FMT="qcow2" + ;; + loong) + TARGET_ARCH="LOONGARCH64" + QEMU_ARCH="loongarch64" + ARCH_DIRS="${DIR}/LoongArchVirtQemu" + UNIT0="QEMU_EFI.qcow2" + UNIT1="QEMU_VARS.qcow2" + FMT="qcow2" + ;; + riscv) + TARGET_ARCH="RISCV64" + QEMU_ARCH="riscv64" + ARCH_DIRS="${DIR}/RiscVVirtQemu" + UNIT0="RISCV_VIRT_CODE.qcow2" + UNIT1="RISCV_VIRT_VARS.qcow2" + FMT="qcow2" + ;; + esac + + DOC_CONTENTS="This package includes the TianoCore EDK II UEFI firmware for ${QEMU_ARCH} +virtual machines. The firmware is located under ${ARCH_DIRS}. + +In order to use the firmware, you can run QEMU like so: + + $ qemu-system-${QEMU_ARCH} \\ + -drive file=${EPREFIX}${ARCH_DIRS%% *}/${UNIT0},if=pflash,format=${FMT},unit=0,readonly=on \\ + -drive file=/path/to/the/copy/of/${UNIT1},if=pflash,format=${FMT},unit=1 \\ + ..." + + case "${ARCH}" in + amd64) DOC_CONTENTS+=" + +The firmware does not support CSM due to the lack of a free +implementation. If you need a firmware with CSM support, you have to +download one for yourself. Firmware blobs are commonly labelled: + + OVMF_CODE-with-csm.fd + OVMF_VARS-with-csm.fd" + ;; + arm64) DOC_CONTENTS+=" + +WARNING! QEMU_EFI.secboot_INSECURE.qcow2 does have Secure Boot +enabled, but it must not be used in production. The lack of an SMM +implementation for arm64 in this firmware means that the EFI +variable store is unprotected, making the firmware unsafe." + ;; + esac +} + +link_mod() { + rmdir "$2" && ln -sfT "$1" "$2" || die "linking ${2##*/} failed" +} + +src_prepare() { + # Bundled submodules + link_mod "${WORKDIR}/brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}" \ + BaseTools/Source/C/BrotliCompress/brotli + link_mod "${WORKDIR}/brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}" \ + MdeModulePkg/Library/BrotliCustomDecompressLib/brotli + link_mod "${WORKDIR}/libspdm-${BUNDLED_LIBSPDM_SUBMODULE_SHA}" \ + SecurityPkg/DeviceSecurity/SpdmLib/libspdm + link_mod "${WORKDIR}/mbedtls-${BUNDLED_MBEDTLS_SUBMODULE_SHA}" \ + CryptoPkg/Library/MbedTlsLib/mbedtls + link_mod "${WORKDIR}/public-mipi-sys-t-${BUNDLED_MIPI_SYS_T_SUBMODULE_SHA}" \ + MdePkg/Library/MipiSysTLib/mipisyst + link_mod "${WORKDIR}/${BUNDLED_OPENSSL_SUBMODULE_P}" \ + CryptoPkg/Library/OpensslLib/openssl + + [[ -e ${DISTDIR}/pylibfdt-${BUNDLED_LIBFDT_SUBMODULE_SHA}.tar.gz ]] && + link_mod "${WORKDIR}/pylibfdt-${BUNDLED_LIBFDT_SUBMODULE_SHA}" \ + MdePkg/Library/BaseFdtLib/libfdt + + default + + # Fix descriptor paths for prefix. + hprefixify "${FILESDIR}"/descriptors/*.json +} + +my_build() { + edo build \ + -t "${TOOLCHAIN}" \ + -b "${BUILD_TARGET}" \ + -a "${TARGET_ARCH}" \ + -D NETWORK_HTTP_BOOT_ENABLE \ + -D NETWORK_IP6_ENABLE \ + -D NETWORK_TLS_ENABLE \ + -D TPM1_ENABLE \ + -D TPM2_ENABLE \ + -D TPM2_CONFIG_ENABLE \ + "${BUILD_ARGS[@]}" \ + "${@}" +} + +sb_build() { + # DO NOT enable the shell with Secure Boot as it can be used as a bypass! + my_build \ + -D BUILD_SHELL=FALSE \ + -D SECURE_BOOT_ENABLE \ + --pcd PcdDxeNxMemoryProtectionPolicy=0xC000000000007FD5 \ + --pcd PcdImageProtectionPolicy=0x03 \ + --pcd PcdNullPointerDetectionPropertyMask=0x03 \ + --pcd PcdSetNxForStack=TRUE \ + --pcd PcdUninstallMemAttrProtocol=FALSE \ + "${@}" +} + +# Add the MS and Red Hat Secure Boot certificates and update the revocation list +# in the given raw variable images. +mk_fw_vars_raw() { + local input args=() dbx="${DISTDIR}/${ARCH}_DBXUpdate_v${SBO_VER}.bin" + [[ -e ${dbx} ]] && args+=( --set-dbx "${dbx}" ) + + for input; do + edo virt-fw-vars --secure-boot --enroll-redhat "${args[@]}" \ + --inplace "${input}" + done +} + +# Write the MS and Red Hat Secure Boot certificates and the revocation list to a +# JSON file for QEMU. +mk_fw_vars_json() { + local args=() dbx="${DISTDIR}/${ARCH}_DBXUpdate_v${SBO_VER}.bin" + [[ -e ${dbx} ]] && args+=( --set-dbx "${dbx}" ) + + edo virt-fw-vars --secure-boot --enroll-redhat "${args[@]}" \ + --output-json "${S}/${ARCH}.qemuvars.json" +} + +# Convert the given images from raw to QCOW2 and resize them to the amount given +# as the first argument. Specify 0 to not resize. +raw_to_qcow2() { + local SIZE=$1 RAW + shift + + for RAW in "${@}"; do + edo qemu-img convert -f raw -O qcow2 -o cluster_size=4096 -S 4096 "${RAW}" "${RAW%.fd}.qcow2" + [[ ${SIZE} != 0 ]] && edo qemu-img resize -f qcow2 "${RAW%.fd}.qcow2" "${SIZE}" + rm "${RAW}" || die + done +} + +src_compile() { + TOOLCHAIN="GCC5" + BUILD_TARGET="RELEASE" + BUILD_DIR="${BUILD_TARGET}_${TOOLCHAIN}" + BUILD_ARGS=() + + tc-export_build_env + emake -C BaseTools \ + CC="$(tc-getBUILD_CC)" \ + CXX="$(tc-getBUILD_CXX)" \ + EXTRA_OPTFLAGS="${BUILD_CFLAGS}" \ + EXTRA_LDFLAGS="${BUILD_LDFLAGS}" + + export \ + "${TOOLCHAIN}_${TARGET_ARCH}_PREFIX=${CHOST}-" \ + "${TOOLCHAIN}_BIN=${CHOST}-" + + . ./edksetup.sh + + case "${ARCH}" in + amd64) + local SIZE + for SIZE in _2M _4M; do + sb_build -p OvmfPkg/OvmfPkgX64.dsc \ + -D FD_SIZE${SIZE}B \ + -D SMM_REQUIRE + + mv -T Build/OvmfX64{,${SIZE}.secboot} || die + + # shim.efi has broken MemAttr code + my_build -p OvmfPkg/OvmfPkgX64.dsc \ + -D FD_SIZE${SIZE}B \ + --pcd PcdDxeNxMemoryProtectionPolicy=0 \ + --pcd PcdUninstallMemAttrProtocol=TRUE + + mv -T Build/OvmfX64{,${SIZE}} || die + + mk_fw_vars_raw Build/OvmfX64${SIZE}.secboot/"${BUILD_DIR}"/FV/OVMF_VARS.fd + done + + sb_build -p OvmfPkg/OvmfPkgX64.dsc \ + -D FD_SIZE_4MB \ + -D QEMU_PV_VARS + + mv -T Build/OvmfX64{,.qemuvars} || die + + # Fedora only converts newer images to QCOW2. 2MB images are raw. + raw_to_qcow2 0 Build/OvmfX64_4M*/"${BUILD_DIR}"/FV/OVMF_{CODE,VARS}.fd + mk_fw_vars_json + ;; + arm64) + sb_build -p ArmVirtPkg/ArmVirtQemu.dsc + mv -T Build/ArmVirtQemu-AArch64{,.secboot_INSECURE} || die + + sb_build -p ArmVirtPkg/ArmVirtQemu.dsc \ + -D QEMU_PV_VARS + + mv -T Build/ArmVirtQemu-AArch64{,.qemuvars} || die + + # shim.efi has broken MemAttr code + my_build -p ArmVirtPkg/ArmVirtQemu.dsc \ + --pcd PcdDxeNxMemoryProtectionPolicy=0xC000000000007FD1 \ + --pcd PcdUninstallMemAttrProtocol=TRUE + + mk_fw_vars_raw Build/ArmVirtQemu-AArch64.secboot_INSECURE/"${BUILD_DIR}"/FV/QEMU_VARS.fd + raw_to_qcow2 64m Build/ArmVirtQemu-AArch64{,.secboot_INSECURE}/"${BUILD_DIR}"/FV/QEMU_{EFI,VARS}.fd + mk_fw_vars_json + ;; + loong) + my_build -p OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc + raw_to_qcow2 0 Build/LoongArchVirtQemu/"${BUILD_DIR}"/FV/QEMU_{EFI,VARS}.fd + ;; + riscv) + my_build -p OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc + raw_to_qcow2 32m Build/RiscVVirtQemu/"${BUILD_DIR}"/FV/RISCV_VIRT_{CODE,VARS}.fd + ;; + esac + + # The standalone shell is safe so always build it. + my_build -p ShellPkg/ShellPkg.dsc +} + +src_install() { + local SIZE TYPE FMT + + case "${ARCH}" in + amd64) + insinto ${DIR}/OvmfX64 + + for SIZE in _2M _4M; do + for TYPE in "" .secboot; do + [[ ${SIZE} = _4M ]] && FMT=qcow2 || FMT=fd + newins Build/OvmfX64${SIZE}${TYPE}/"${BUILD_DIR}"/FV/OVMF_CODE.${FMT} OVMF_CODE${SIZE#_2M}${TYPE}.${FMT} + newins Build/OvmfX64${SIZE}${TYPE}/"${BUILD_DIR}"/FV/OVMF_VARS.${FMT} OVMF_VARS${SIZE#_2M}${TYPE}.${FMT} + done + done + + newins Build/OvmfX64.qemuvars/"${BUILD_DIR}"/FV/OVMF_CODE.fd OVMF_CODE.qemuvars.fd + newins amd64.qemuvars.json OVMF_VARS.qemuvars.json + + # Compatibility with older package versions. + dosym ${PN}/OvmfX64 /usr/share/edk2-ovmf + ;; + arm64) + insinto ${DIR}/ArmVirtQemu-AARCH64 + + for TYPE in "" .secboot_INSECURE; do + newins Build/ArmVirtQemu-AArch64${TYPE}/"${BUILD_DIR}"/FV/QEMU_EFI.qcow2 QEMU_EFI${TYPE}.qcow2 + newins Build/ArmVirtQemu-AArch64${TYPE}/"${BUILD_DIR}"/FV/QEMU_VARS.qcow2 QEMU_VARS${TYPE}.qcow2 + done + + newins Build/ArmVirtQemu-AArch64.qemuvars/"${BUILD_DIR}"/FV/QEMU_EFI.fd QEMU_EFI.qemuvars.fd + newins arm64.qemuvars.json QEMU_VARS.qemuvars.json + ;; + loong) + insinto ${DIR}/LoongArchVirtQemu + doins Build/LoongArchVirtQemu/"${BUILD_DIR}"/FV/QEMU_{EFI,VARS}.qcow2 + ;; + riscv) + insinto ${DIR}/RiscVVirtQemu + doins Build/RiscVVirtQemu/"${BUILD_DIR}"/FV/RISCV_VIRT_{CODE,VARS}.qcow2 + ;; + esac + + newins Build/Shell/"${BUILD_DIR}/${TARGET_ARCH}"/Shell_EA4BB293-2D7F-4456-A681-1F22F42CD0BC.efi Shell.efi + + insinto /usr/share/qemu/firmware + doins "${FILESDIR}"/descriptors/*"${TARGET_ARCH,,}"*.json + + secureboot_auto_sign --in-place + readme.gentoo_create_doc +} + +pkg_preinst() { + local OLD=${EROOT}/usr/share/edk2-ovmf NEW=${EROOT}/${DIR}/OvmfX64 + if [[ -d ${OLD} && ! -L ${OLD} ]]; then + { + rm -vf "${OLD}"/{OVMF_{CODE,CODE.secboot,VARS}.fd,EnrollDefaultKeys.efi,Shell.efi,UefiShell.img} && + mkdir -p "${NEW}" && + find "${OLD}" -mindepth 1 -maxdepth 1 -execdir mv --update=none-fail -vt "${NEW}"/ {} + && + rmdir "${OLD}" + } || die "unable to replace old directory with compatibility symlink" + fi +} + +pkg_postinst() { + readme.gentoo_print_elog +} diff --git a/sys-firmware/edk2/files/descriptors/30-edk2-aarch64-qcow2-sb-enrolled.json b/sys-firmware/edk2/files/descriptors/30-edk2-aarch64-qcow2-sb-enrolled.json new file mode 100644 index 000000000000..47c3c9f03935 --- /dev/null +++ b/sys-firmware/edk2/files/descriptors/30-edk2-aarch64-qcow2-sb-enrolled.json @@ -0,0 +1,33 @@ +{ + "description": "UEFI for arm64 VMs, with *INSECURE* SB, SB enabled, MS certs enrolled", + "interface-types": [ + "uefi" + ], + "mapping": { + "device": "flash", + "mode" : "split", + "executable": { + "filename": "/usr/share/edk2/ArmVirtQemu-AARCH64/QEMU_EFI.secboot_INSECURE.qcow2", + "format": "qcow2" + }, + "nvram-template": { + "filename": "/usr/share/edk2/ArmVirtQemu-AARCH64/QEMU_VARS.secboot_INSECURE.qcow2", + "format": "qcow2" + } + }, + "targets": [ + { + "architecture": "aarch64", + "machines": [ + "virt-*" + ] + } + ], + "features": [ + "enrolled-keys", + "secure-boot" + ], + "tags": [ + + ] +} diff --git a/sys-firmware/edk2/files/descriptors/30-edk2-ovmf-4m-qcow2-x64-sb-enrolled.json b/sys-firmware/edk2/files/descriptors/30-edk2-ovmf-4m-qcow2-x64-sb-enrolled.json new file mode 100644 index 000000000000..b11c77b5680d --- /dev/null +++ b/sys-firmware/edk2/files/descriptors/30-edk2-ovmf-4m-qcow2-x64-sb-enrolled.json @@ -0,0 +1,36 @@ +{ + "description": "OVMF with SB+SMM, SB enabled, MS certs enrolled", + "interface-types": [ + "uefi" + ], + "mapping": { + "device": "flash", + "mode" : "split", + "executable": { + "filename": "/usr/share/edk2/OvmfX64/OVMF_CODE_4M.secboot.qcow2", + "format": "qcow2" + }, + "nvram-template": { + "filename": "/usr/share/edk2/OvmfX64/OVMF_VARS_4M.secboot.qcow2", + "format": "qcow2" + } + }, + "targets": [ + { + "architecture": "x86_64", + "machines": [ + "pc-q35-*" + ] + } + ], + "features": [ + "acpi-s3", + "enrolled-keys", + "requires-smm", + "secure-boot", + "verbose-dynamic" + ], + "tags": [ + + ] +} diff --git a/sys-firmware/edk2/files/descriptors/31-edk2-ovmf-2m-raw-x64-sb-enrolled.json b/sys-firmware/edk2/files/descriptors/31-edk2-ovmf-2m-raw-x64-sb-enrolled.json new file mode 100644 index 000000000000..ffa28c209905 --- /dev/null +++ b/sys-firmware/edk2/files/descriptors/31-edk2-ovmf-2m-raw-x64-sb-enrolled.json @@ -0,0 +1,36 @@ +{ + "description": "OVMF for x86_64, with SB+SMM, SB enabled, MS certs enrolled", + "interface-types": [ + "uefi" + ], + "mapping": { + "device": "flash", + "mode" : "split", + "executable": { + "filename": "/usr/share/edk2/OvmfX64/OVMF_CODE.secboot.fd", + "format": "raw" + }, + "nvram-template": { + "filename": "/usr/share/edk2/OvmfX64/OVMF_VARS.secboot.fd", + "format": "raw" + } + }, + "targets": [ + { + "architecture": "x86_64", + "machines": [ + "pc-q35-*" + ] + } + ], + "features": [ + "acpi-s3", + "enrolled-keys", + "requires-smm", + "secure-boot", + "verbose-dynamic" + ], + "tags": [ + + ] +} diff --git a/sys-firmware/edk2/files/descriptors/40-edk2-aarch64-qcow2-sb.json b/sys-firmware/edk2/files/descriptors/40-edk2-aarch64-qcow2-sb.json new file mode 100644 index 000000000000..92ac2aea9014 --- /dev/null +++ b/sys-firmware/edk2/files/descriptors/40-edk2-aarch64-qcow2-sb.json @@ -0,0 +1,32 @@ +{ + "description": "UEFI for arm64 VMs, with *INSECURE* SB, empty varstore", + "interface-types": [ + "uefi" + ], + "mapping": { + "device": "flash", + "mode" : "split", + "executable": { + "filename": "/usr/share/edk2/ArmVirtQemu-AARCH64/QEMU_EFI.secboot_INSECURE.qcow2", + "format": "qcow2" + }, + "nvram-template": { + "filename": "/usr/share/edk2/ArmVirtQemu-AARCH64/QEMU_VARS.qcow2", + "format": "qcow2" + } + }, + "targets": [ + { + "architecture": "aarch64", + "machines": [ + "virt-*" + ] + } + ], + "features": [ + "secure-boot" + ], + "tags": [ + + ] +} diff --git a/sys-firmware/edk2/files/descriptors/40-edk2-ovmf-4m-qcow2-x64-sb.json b/sys-firmware/edk2/files/descriptors/40-edk2-ovmf-4m-qcow2-x64-sb.json new file mode 100644 index 000000000000..52daef98cf66 --- /dev/null +++ b/sys-firmware/edk2/files/descriptors/40-edk2-ovmf-4m-qcow2-x64-sb.json @@ -0,0 +1,35 @@ +{ + "description": "OVMF for x86_64, with SB+SMM, empty varstore", + "interface-types": [ + "uefi" + ], + "mapping": { + "device": "flash", + "mode" : "split", + "executable": { + "filename": "/usr/share/edk2/OvmfX64/OVMF_CODE_4M.secboot.qcow2", + "format": "qcow2" + }, + "nvram-template": { + "filename": "/usr/share/edk2/OvmfX64/OVMF_VARS_4M.qcow2", + "format": "qcow2" + } + }, + "targets": [ + { + "architecture": "x86_64", + "machines": [ + "pc-q35-*" + ] + } + ], + "features": [ + "acpi-s3", + "requires-smm", + "secure-boot", + "verbose-dynamic" + ], + "tags": [ + + ] +} diff --git a/sys-firmware/edk2/files/descriptors/41-edk2-ovmf-2m-raw-x64-sb.json b/sys-firmware/edk2/files/descriptors/41-edk2-ovmf-2m-raw-x64-sb.json new file mode 100644 index 000000000000..358f05927653 --- /dev/null +++ b/sys-firmware/edk2/files/descriptors/41-edk2-ovmf-2m-raw-x64-sb.json @@ -0,0 +1,35 @@ +{ + "description": "OVMF for x86_64, with SB+SMM, empty varstore", + "interface-types": [ + "uefi" + ], + "mapping": { + "device": "flash", + "mode" : "split", + "executable": { + "filename": "/usr/share/edk2/OvmfX64/OVMF_CODE.secboot.fd", + "format": "raw" + }, + "nvram-template": { + "filename": "/usr/share/edk2/OvmfX64/OVMF_VARS.fd", + "format": "raw" + } + }, + "targets": [ + { + "architecture": "x86_64", + "machines": [ + "pc-q35-*" + ] + } + ], + "features": [ + "acpi-s3", + "requires-smm", + "secure-boot", + "verbose-dynamic" + ], + "tags": [ + + ] +} diff --git a/sys-firmware/edk2/files/descriptors/50-edk2-aarch64-qcow2-nosb.json b/sys-firmware/edk2/files/descriptors/50-edk2-aarch64-qcow2-nosb.json new file mode 100644 index 000000000000..7a6db3ce9db2 --- /dev/null +++ b/sys-firmware/edk2/files/descriptors/50-edk2-aarch64-qcow2-nosb.json @@ -0,0 +1,32 @@ +{ + "description": "UEFI for arm64 VMs, without SB, empty varstore", + "interface-types": [ + "uefi" + ], + "mapping": { + "device": "flash", + "mode" : "split", + "executable": { + "filename": "/usr/share/edk2/ArmVirtQemu-AARCH64/QEMU_EFI.qcow2", + "format": "qcow2" + }, + "nvram-template": { + "filename": "/usr/share/edk2/ArmVirtQemu-AARCH64/QEMU_VARS.qcow2", + "format": "qcow2" + } + }, + "targets": [ + { + "architecture": "aarch64", + "machines": [ + "virt-*" + ] + } + ], + "features": [ + + ], + "tags": [ + + ] +} diff --git a/sys-firmware/edk2/files/descriptors/50-edk2-loongarch64-qcow2-nosb.json b/sys-firmware/edk2/files/descriptors/50-edk2-loongarch64-qcow2-nosb.json new file mode 100644 index 000000000000..706ddd2f0578 --- /dev/null +++ b/sys-firmware/edk2/files/descriptors/50-edk2-loongarch64-qcow2-nosb.json @@ -0,0 +1,33 @@ +{ + "description": "UEFI for LoongArch VMs", + "interface-types": [ + "uefi" + ], + "mapping": { + "device": "flash", + "mode" : "split", + "executable": { + "filename": "/usr/share/edk2/LoongArchVirtQemu/QEMU_EFI.qcow2", + "format": "qcow2" + }, + "nvram-template": { + "filename": "/usr/share/edk2/LoongArchVirtQemu/QEMU_VARS.qcow2", + "format": "qcow2" + } + }, + "targets": [ + { + "architecture": "loongarch64", + "machines": [ + "virt", + "virt-*" + ] + } + ], + "features": [ + + ], + "tags": [ + + ] +} diff --git a/sys-firmware/edk2/files/descriptors/50-edk2-ovmf-4m-qcow2-x64-nosb.json b/sys-firmware/edk2/files/descriptors/50-edk2-ovmf-4m-qcow2-x64-nosb.json new file mode 100644 index 000000000000..efd4ddbfb632 --- /dev/null +++ b/sys-firmware/edk2/files/descriptors/50-edk2-ovmf-4m-qcow2-x64-nosb.json @@ -0,0 +1,36 @@ +{ + "description": "OVMF for x86_64, without SB+SMM, empty varstore", + "interface-types": [ + "uefi" + ], + "mapping": { + "device": "flash", + "mode" : "split", + "executable": { + "filename": "/usr/share/edk2/OvmfX64/OVMF_CODE_4M.qcow2", + "format": "qcow2" + }, + "nvram-template": { + "filename": "/usr/share/edk2/OvmfX64/OVMF_VARS_4M.qcow2", + "format": "qcow2" + } + }, + "targets": [ + { + "architecture": "x86_64", + "machines": [ + "pc-i440fx-*", + "pc-q35-*" + ] + } + ], + "features": [ + "acpi-s3", + "amd-sev", + "amd-sev-es", + "verbose-dynamic" + ], + "tags": [ + + ] +} diff --git a/sys-firmware/edk2/files/descriptors/50-edk2-riscv64-qcow2-nosb.json b/sys-firmware/edk2/files/descriptors/50-edk2-riscv64-qcow2-nosb.json new file mode 100644 index 000000000000..a8d6e7498dd9 --- /dev/null +++ b/sys-firmware/edk2/files/descriptors/50-edk2-riscv64-qcow2-nosb.json @@ -0,0 +1,33 @@ +{ + "description": "UEFI for RISC-V VMs", + "interface-types": [ + "uefi" + ], + "mapping": { + "device": "flash", + "mode" : "split", + "executable": { + "filename": "/usr/share/edk2/RiscVVirtQemu/RISCV_VIRT_CODE.qcow2", + "format": "qcow2" + }, + "nvram-template": { + "filename": "/usr/share/edk2/RiscVVirtQemu/RISCV_VIRT_VARS.qcow2", + "format": "qcow2" + } + }, + "targets": [ + { + "architecture": "riscv64", + "machines": [ + "virt", + "virt-*" + ] + } + ], + "features": [ + + ], + "tags": [ + + ] +} diff --git a/sys-firmware/edk2/files/descriptors/51-edk2-ovmf-2m-raw-x64-nosb.json b/sys-firmware/edk2/files/descriptors/51-edk2-ovmf-2m-raw-x64-nosb.json new file mode 100644 index 000000000000..309ba626b940 --- /dev/null +++ b/sys-firmware/edk2/files/descriptors/51-edk2-ovmf-2m-raw-x64-nosb.json @@ -0,0 +1,36 @@ +{ + "description": "OVMF for x86_64, without SB+SMM, empty varstore", + "interface-types": [ + "uefi" + ], + "mapping": { + "device": "flash", + "mode" : "split", + "executable": { + "filename": "/usr/share/edk2/OvmfX64/OVMF_CODE.fd", + "format": "raw" + }, + "nvram-template": { + "filename": "/usr/share/edk2/OvmfX64/OVMF_VARS.fd", + "format": "raw" + } + }, + "targets": [ + { + "architecture": "x86_64", + "machines": [ + "pc-i440fx-*", + "pc-q35-*" + ] + } + ], + "features": [ + "acpi-s3", + "amd-sev", + "amd-sev-es", + "verbose-dynamic" + ], + "tags": [ + + ] +} diff --git a/sys-firmware/edk2/files/descriptors/90-edk2-aarch64-qemuvars-sb-enrolled.json b/sys-firmware/edk2/files/descriptors/90-edk2-aarch64-qemuvars-sb-enrolled.json new file mode 100644 index 000000000000..23dacc7a2e5f --- /dev/null +++ b/sys-firmware/edk2/files/descriptors/90-edk2-aarch64-qemuvars-sb-enrolled.json @@ -0,0 +1,29 @@ +{ + "description": "UEFI for arm64 VMs, with QEMU uefi-vars, SB enabled, MS certs enrolled", + "interface-types": [ + "uefi" + ], + "mapping": { + "device": "memory", + "filename": "/usr/share/edk2/ArmVirtQemu-AARCH64/QEMU_EFI.qemuvars.fd", + "uefi-vars": { + "template": "/usr/share/edk2/ArmVirtQemu-AARCH64/QEMU_VARS.qemuvars.json" + } + }, + "targets": [ + { + "architecture": "aarch64", + "machines": [ + "virt-*" + ] + } + ], + "features": [ + "enrolled-keys", + "host-uefi-vars", + "secure-boot" + ], + "tags": [ + + ] +} diff --git a/sys-firmware/edk2/files/descriptors/90-edk2-ovmf-qemuvars-x64-sb-enrolled.json b/sys-firmware/edk2/files/descriptors/90-edk2-ovmf-qemuvars-x64-sb-enrolled.json new file mode 100644 index 000000000000..193adffcd026 --- /dev/null +++ b/sys-firmware/edk2/files/descriptors/90-edk2-ovmf-qemuvars-x64-sb-enrolled.json @@ -0,0 +1,31 @@ +{ + "description": "OVMF for VMs, with QEMU uefi-vars, SB enabled, MS certs enrolled", + "interface-types": [ + "uefi" + ], + "mapping": { + "device": "memory", + "filename": "/usr/share/edk2/OvmfX64/OVMF_CODE.qemuvars.fd", + "uefi-vars": { + "template": "/usr/share/edk2/OvmfX64/OVMF_VARS.qemuvars.json" + } + }, + "targets": [ + { + "architecture": "x86_64", + "machines": [ + "pc-q35-*" + ] + } + ], + "features": [ + "acpi-s3", + "enrolled-keys", + "host-uefi-vars", + "secure-boot", + "verbose-dynamic" + ], + "tags": [ + + ] +} diff --git a/sys-firmware/edk2/files/edk2-202408-binutils-2.41-textrels.patch b/sys-firmware/edk2/files/edk2-202408-binutils-2.41-textrels.patch new file mode 100644 index 000000000000..de404159e99c --- /dev/null +++ b/sys-firmware/edk2/files/edk2-202408-binutils-2.41-textrels.patch @@ -0,0 +1,13 @@ +diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template +index 76aaae7261..f05b32a4e1 100755 +--- a/BaseTools/Conf/tools_def.template ++++ b/BaseTools/Conf/tools_def.template +@@ -961,7 +961,7 @@ DEFINE GCC49_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -fno-pic -fno-pi + DEFINE GCC49_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS)
+ DEFINE GCC49_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40
+ DEFINE GCC49_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,--defsym=PECOFF_HEADER_SIZE=0 DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable
+-DEFINE GCC49_IA32_X64_DLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive
++DEFINE GCC49_IA32_X64_DLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive -Wl,-z,notext
+ DEFINE GCC49_IA32_DLINK2_FLAGS = DEF(GCC48_IA32_DLINK2_FLAGS)
+ DEFINE GCC49_X64_DLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_FLAGS) -Wl,-melf_x86_64,--oformat=elf64-x86-64,-pie
+ DEFINE GCC49_X64_DLINK2_FLAGS = DEF(GCC48_X64_DLINK2_FLAGS)
diff --git a/sys-firmware/edk2/files/edk2-202411-gcc15.patch b/sys-firmware/edk2/files/edk2-202411-gcc15.patch new file mode 100644 index 000000000000..c2d424240b0a --- /dev/null +++ b/sys-firmware/edk2/files/edk2-202411-gcc15.patch @@ -0,0 +1,32 @@ +https://github.com/tianocore/edk2/commit/e063f8b8a53861043b9872cc35b08a3dc03b0942 +From: Gerd Hoffmann <kraxel@redhat.com> +Date: Mon, 20 Jan 2025 09:40:31 +0100 +Subject: [PATCH] BaseTools/Pccts: set C standard + +The prehistoric code base doesn't build with ISO C23. Set the C +standard to C11 (for both clang and gcc) so it continues to build with +gcc 15 (which uses C23 by default). + +Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> +--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile ++++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile +@@ -169,7 +169,7 @@ ANTLR=${BIN_DIR}/antlr + DLG=${BIN_DIR}/dlg
+ OBJ_EXT=o
+ OUT_OBJ = -o
+-CFLAGS= $(COPT) -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN $(COTHER) -DZZLEXBUFSIZE=65536
++CFLAGS= $(COPT) -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN $(COTHER) -DZZLEXBUFSIZE=65536 -std=gnu11
+ CPPFLAGS=
+ #
+ # SGI Users, use this CFLAGS
+--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile ++++ b/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile +@@ -123,7 +123,7 @@ endif + COPT=-O
+ ANTLR=${BIN_DIR}/antlr
+ DLG=${BIN_DIR}/dlg
+-CFLAGS= $(COPT) -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -DZZLEXBUFSIZE=65536
++CFLAGS= $(COPT) -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -DZZLEXBUFSIZE=65536 -std=gnu11
+ CPPFLAGS=
+ OBJ_EXT=o
+ OUT_OBJ = -o
diff --git a/sys-firmware/edk2/files/edk2-202411-loong.patch b/sys-firmware/edk2/files/edk2-202411-loong.patch new file mode 100644 index 000000000000..f2df0376b730 --- /dev/null +++ b/sys-firmware/edk2/files/edk2-202411-loong.patch @@ -0,0 +1,33 @@ +https://github.com/tianocore/edk2/commit/b8f3199595d23c29433528a5207a6aa9fb368d44 +From: Chao Li <lichao@loongson.cn> +Date: Tue, 17 Dec 2024 18:05:45 +0800 +Subject: [PATCH] OvmfPkg/LoongArch: Enabling some base libraries + +BaseCryptLib, RngLib, IntrinsicLib and OpensslLib are enabled by default +on LoongArch VM, since some APPs or OS require them. + +Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> +Cc: Jiewen Yao <jiewen.yao@intel.com> +Cc: Gerd Hoffmann <kraxel@redhat.com> +Signed-off-by: Chao Li <lichao@loongson.cn> +--- a/OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc ++++ b/OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc +@@ -156,6 +156,18 @@ + FileExplorerLib | MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
+ ImagePropertiesRecordLib | MdeModulePkg/Library/ImagePropertiesRecordLib/ImagePropertiesRecordLib.inf
+
++ #
++ # CryptoPkg libraries needed by multiple firmware features
++ #
++ IntrinsicLib | CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
++!if $(NETWORK_TLS_ENABLE) == TRUE
++ OpensslLib | CryptoPkg/Library/OpensslLib/OpensslLib.inf
++!else
++ OpensslLib | CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
++!endif
++ BaseCryptLib | CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
++ RngLib | MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
++
+ !if $(HTTP_BOOT_ENABLE) == TRUE
+ HttpLib | MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf
+ !endif
diff --git a/sys-firmware/edk2/files/edk2-202411-werror.patch b/sys-firmware/edk2/files/edk2-202411-werror.patch new file mode 100644 index 000000000000..e7b63abc1091 --- /dev/null +++ b/sys-firmware/edk2/files/edk2-202411-werror.patch @@ -0,0 +1,56 @@ +diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template +index 14f3b643c4..03fad15ff9 100755 +--- a/BaseTools/Conf/tools_def.template ++++ b/BaseTools/Conf/tools_def.template +@@ -896,7 +896,7 @@ NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink="$(DEBUG_DIR)/$(MODULE_ + *_*_*_DTC_PATH = DEF(DTC_BIN)
+
+ # All supported GCC archs except LOONGARCH64 support -mstack-protector-guard=global, so set that on everything except LOONGARCH64
+-DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common -fstack-protector
++DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Wno-array-bounds -include AutoGen.h -fno-common -fstack-protector
+ DEFINE GCC_IA32_X64_CC_FLAGS = -mstack-protector-guard=global
+ DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -fno-pic -fno-pie -mstack-protector-guard=global
+ DEFINE GCC_LOONGARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mabi=lp64d -fno-asynchronous-unwind-tables -Wno-address -fno-short-enums -fsigned-char -ffunction-sections -fdata-sections
+@@ -1006,7 +1006,7 @@ DEFINE GCC5_ARM_ASLDLINK_FLAGS = DEF(GCC49_ARM_ASLDLINK_FLAGS) + DEFINE GCC5_AARCH64_ASLDLINK_FLAGS = DEF(GCC49_AARCH64_ASLDLINK_FLAGS)
+ DEFINE GCC5_ASLCC_FLAGS = DEF(GCC49_ASLCC_FLAGS) -fno-lto
+
+-DEFINE GCC5_RISCV_ALL_CC_FLAGS = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings -msmall-data-limit=0
++DEFINE GCC5_RISCV_ALL_CC_FLAGS = -g -fshort-wchar -fno-strict-aliasing -Wall -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings -msmall-data-limit=0
+ DEFINE GCC5_RISCV_ALL_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40
+ DEFINE GCC5_RISCV_ALL_DLINK_FLAGS = DEF(GCC5_RISCV_ALL_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
+ DEFINE GCC5_RISCV_ALL_DLINK2_FLAGS = -Wl,--defsym=PECOFF_HEADER_SIZE=0x220,--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
+@@ -1022,7 +1022,7 @@ DEFINE GCC5_RISCV64_DLINK_FLAGS = DEF(GCC5_RISCV_ALL_DLINK_FLAGS) -Wl + DEFINE GCC5_RISCV64_DLINK2_FLAGS = DEF(GCC5_RISCV_ALL_DLINK2_FLAGS)
+ DEFINE GCC5_RISCV64_ASM_FLAGS = DEF(GCC5_RISCV_ALL_ASM_FLAGS) -march=DEF(GCC5_RISCV64_ARCH) -mcmodel=medany -mabi=lp64
+
+-DEFINE GCC5_LOONGARCH64_CC_FLAGS = DEF(GCC_LOONGARCH64_CC_FLAGS) -march=loongarch64 -mno-memcpy -Werror -Wno-maybe-uninitialized -Wno-stringop-overflow -Wno-pointer-to-int-cast -no-pie -fno-stack-protector -mno-explicit-relocs
++DEFINE GCC5_LOONGARCH64_CC_FLAGS = DEF(GCC_LOONGARCH64_CC_FLAGS) -march=loongarch64 -mno-memcpy -Wno-maybe-uninitialized -Wno-stringop-overflow -Wno-pointer-to-int-cast -no-pie -fno-stack-protector -mno-explicit-relocs
+ DEFINE GCC5_LOONGARCH64_DLINK_FLAGS = DEF(GCC_LOONGARCH64_DLINK_FLAGS)
+ DEFINE GCC5_LOONGARCH64_DLINK2_FLAGS = DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--defsym=PECOFF_HEADER_SIZE=0x228
+ DEFINE GCC5_LOONGARCH64_ASLDLINK_FLAGS = DEF(GCC_LOONGARCH64_ASLDLINK_FLAGS) DEF(GCC5_LOONGARCH64_DLINK2_FLAGS)
+diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile +index d369908a09..1bf4caaa53 100644 +--- a/BaseTools/Source/C/Makefiles/header.makefile ++++ b/BaseTools/Source/C/Makefiles/header.makefile +@@ -92,17 +92,17 @@ BUILD_OPTFLAGS = -O2 $(EXTRA_OPTFLAGS) +
+ ifeq ($(DARWIN),Darwin)
+ # assume clang or clang compatible flags on OS X
+-CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \
++CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall \
+ -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -g
+ else
+ ifneq ($(CLANG),)
+ CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
+--fno-delete-null-pointer-checks -Wall -Werror \
++-fno-delete-null-pointer-checks -Wall \
+ -Wno-deprecated-declarations -Wno-self-assign \
+ -Wno-unused-result -nostdlib -g
+ else
+ CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
+--fno-delete-null-pointer-checks -Wall -Werror \
++-fno-delete-null-pointer-checks -Wall \
+ -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict \
+ -Wno-unused-result -nostdlib -g
+ endif
diff --git a/sys-firmware/edk2/files/edk2-202502-nasm-3.patch b/sys-firmware/edk2/files/edk2-202502-nasm-3.patch new file mode 100644 index 000000000000..0a61e2249a1b --- /dev/null +++ b/sys-firmware/edk2/files/edk2-202502-nasm-3.patch @@ -0,0 +1,44 @@ +https://bugs.gentoo.org/964058 +https://github.com/tianocore/edk2/issues/11635 +https://github.com/tianocore/edk2/pull/11691 + +From 034d24a3afb9f7ffe12c896c597e9872dfae0e02 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann <kraxel@redhat.com> +Date: Mon, 3 Nov 2025 09:56:52 +0100 +Subject: [PATCH] UefiCpuPkg/CpuExceptionHandlerLib: fix push instructions + +Nasm 3.0 complains about 'dword' being invalid. The comment talks about +a '8-byte value' so 'qword' should be correct here. + +With this change the extra comment explaining that the instruction +actually pushes an 8-byte value despite the 'dword' keyword is not +needed any more. Drop it. + +Fixes: https://github.com/tianocore/edk2/issues/11635 +Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> +--- + .../CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm +index 3d64ac908010..671ed98f8525 100644 +--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm ++++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm +@@ -57,7 +57,7 @@ ALIGN 8 + AsmIdtVectorBegin:
+ %assign Vector 0
+ %rep 256
+- push strict dword %[Vector] ; This instruction pushes sign-extended 8-byte value on stack
++ push strict qword %[Vector]
+ push rax
+ %ifdef NO_ABSOLUTE_RELOCS_IN_TEXT
+ mov rax, strict qword 0 ; mov rax, ASM_PFX(CommonInterruptEntry)
+@@ -70,7 +70,7 @@ AsmIdtVectorBegin: + AsmIdtVectorEnd:
+
+ HookAfterStubHeaderBegin:
+- push strict dword 0 ; 0 will be fixed
++ push strict qword 0 ; 0 will be fixed
+ VectorNum:
+ push rax
+ %ifdef NO_ABSOLUTE_RELOCS_IN_TEXT
diff --git a/sys-firmware/edk2/files/edk2-202505-UninstallMemAttrProtocol.patch b/sys-firmware/edk2/files/edk2-202505-UninstallMemAttrProtocol.patch new file mode 100644 index 000000000000..1e09ae66efa8 --- /dev/null +++ b/sys-firmware/edk2/files/edk2-202505-UninstallMemAttrProtocol.patch @@ -0,0 +1,117 @@ +From 026b722d415b11edcc04e46bbd394b18b61e554d Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann <kraxel@redhat.com> +Date: Thu, 16 Jan 2025 17:20:38 +0100 +Subject: [PATCH 17/21] OvmfPkg/X64: add + opt/org.tianocore/UninstallMemAttrProtocol support + +Add support for opt/org.tianocore/UninstallMemAttrProtocol, to allow +turning off EFI_MEMORY_ATTRIBUTE_PROTOCOL, simliar to ArmVirtPkg. + +Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> +--- a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf ++++ b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +@@ -64,6 +64,7 @@ [Pcd] + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable
+ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId
+ gUefiOvmfPkgTokenSpaceGuid.PcdBootRestrictToFirmware
++ gUefiOvmfPkgTokenSpaceGuid.PcdUninstallMemAttrProtocol
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable
+ gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
+ gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate ## CONSUMES
+@@ -82,6 +83,7 @@ [Protocols] + gEfiDxeSmmReadyToLockProtocolGuid # PROTOCOL SOMETIMES_PRODUCED
+ gEfiLoadedImageProtocolGuid # PROTOCOL SOMETIMES_PRODUCED
+ gEfiFirmwareVolume2ProtocolGuid # PROTOCOL SOMETIMES_CONSUMED
++ gEfiMemoryAttributeProtocolGuid
+
+ [Guids]
+ gEfiEndOfDxeEventGroupGuid
+--- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c ++++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +@@ -1596,6 +1596,49 @@ SaveS3BootScript ( + ASSERT_EFI_ERROR (Status);
+ }
+
++/**
++ Uninstall the EFI memory attribute protocol if it exists.
++**/
++STATIC
++VOID
++UninstallEfiMemoryAttributesProtocol (
++ VOID
++ )
++{
++ EFI_STATUS Status;
++ EFI_HANDLE Handle;
++ UINTN Size;
++ VOID *MemoryAttributeProtocol;
++
++ Size = sizeof (Handle);
++ Status = gBS->LocateHandle (
++ ByProtocol,
++ &gEfiMemoryAttributeProtocolGuid,
++ NULL,
++ &Size,
++ &Handle
++ );
++
++ if (EFI_ERROR (Status)) {
++ ASSERT (Status == EFI_NOT_FOUND);
++ return;
++ }
++
++ Status = gBS->HandleProtocol (
++ Handle,
++ &gEfiMemoryAttributeProtocolGuid,
++ &MemoryAttributeProtocol
++ );
++ ASSERT_EFI_ERROR (Status);
++
++ Status = gBS->UninstallProtocolInterface (
++ Handle,
++ &gEfiMemoryAttributeProtocolGuid,
++ MemoryAttributeProtocol
++ );
++ ASSERT_EFI_ERROR (Status);
++}
++
+ /**
+ Do the platform specific action after the console is ready
+
+@@ -1616,6 +1659,7 @@ PlatformBootManagerAfterConsole ( + )
+ {
+ EFI_BOOT_MODE BootMode;
++ BOOLEAN Uninstall;
+
+ DEBUG ((DEBUG_INFO, "PlatformBootManagerAfterConsole\n"));
+
+@@ -1660,6 +1704,25 @@ PlatformBootManagerAfterConsole ( + //
+ StoreQemuBootOrder ();
+
++ //
++ // Work around shim's terminally broken use of the EFI memory attributes
++ // protocol, by uninstalling it if requested on the QEMU command line.
++ //
++ // E.g.,
++ // -fw_cfg opt/org.tianocore/UninstallMemAttrProtocol,string=y
++ //
++ Uninstall = FixedPcdGetBool (PcdUninstallMemAttrProtocol);
++ QemuFwCfgParseBool ("opt/org.tianocore/UninstallMemAttrProtocol", &Uninstall);
++ DEBUG ((
++ DEBUG_WARN,
++ "%a: %auninstalling EFI memory protocol\n",
++ __func__,
++ Uninstall ? "" : "not "
++ ));
++ if (Uninstall) {
++ UninstallEfiMemoryAttributesProtocol ();
++ }
++
+ //
+ // Process QEMU's -kernel command line option
+ //
+-- +2.49.0 + diff --git a/sys-firmware/edk2/files/edk2-202511-werror.patch b/sys-firmware/edk2/files/edk2-202511-werror.patch new file mode 100644 index 000000000000..cdfade12808b --- /dev/null +++ b/sys-firmware/edk2/files/edk2-202511-werror.patch @@ -0,0 +1,52 @@ +--- a/BaseTools/Conf/tools_def.template ++++ b/BaseTools/Conf/tools_def.template +@@ -833,7 +833,7 @@ NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink="$(DEBUG_DIR)/$(MODULE_ + *_*_*_DTC_PATH = DEF(DTC_BIN)
+
+ # All supported GCC archs except LOONGARCH64 support -mstack-protector-guard=global, so set that on everything except LOONGARCH64
+-DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common -fstack-protector
++DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Wno-array-bounds -include AutoGen.h -fno-common -fstack-protector
+ DEFINE GCC_IA32_X64_CC_FLAGS = -mstack-protector-guard=global
+ DEFINE GCC_LOONGARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mabi=lp64d -fno-asynchronous-unwind-tables -Wno-address -fno-short-enums -fsigned-char -ffunction-sections -fdata-sections
+ DEFINE GCC_AARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-pic -fno-pie -ffixed-x18 -mstack-protector-guard=global
+@@ -914,7 +914,7 @@ DEFINE GCC5_AARCH64_DLINK2_FLAGS = DEF(GCC49_AARCH64_DLINK2_FLAGS) -Wno-erro + DEFINE GCC5_AARCH64_ASLDLINK_FLAGS = DEF(GCC49_AARCH64_ASLDLINK_FLAGS) DEF(GCC5_DLINK_WARNING_FLAGS)
+ DEFINE GCC5_ASLCC_FLAGS = DEF(GCC49_ASLCC_FLAGS) -fno-lto
+
+-DEFINE GCC5_RISCV_ALL_CC_FLAGS = -g -fshort-wchar -fno-omit-frame-pointer -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings -msmall-data-limit=0
++DEFINE GCC5_RISCV_ALL_CC_FLAGS = -g -fshort-wchar -fno-omit-frame-pointer -fno-strict-aliasing -Wall -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings -msmall-data-limit=0
+ DEFINE GCC5_RISCV_ALL_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40 DEF(GCC5_DLINK_WARNING_FLAGS)
+ DEFINE GCC5_RISCV_ALL_DLINK_FLAGS = DEF(GCC5_RISCV_ALL_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
+ DEFINE GCC5_RISCV_ALL_DLINK2_FLAGS = -Wl,--defsym=PECOFF_HEADER_SIZE=0x220,--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
+@@ -930,7 +930,7 @@ DEFINE GCC5_RISCV64_DLINK_FLAGS = DEF(GCC5_RISCV_ALL_DLINK_FLAGS) -Wl + DEFINE GCC5_RISCV64_DLINK2_FLAGS = DEF(GCC5_RISCV_ALL_DLINK2_FLAGS)
+ DEFINE GCC5_RISCV64_ASM_FLAGS = DEF(GCC5_RISCV_ALL_ASM_FLAGS) -march=DEF(GCC5_RISCV64_ARCH) -mcmodel=medany -mabi=lp64
+
+-DEFINE GCC5_LOONGARCH64_CC_FLAGS = DEF(GCC_LOONGARCH64_CC_FLAGS) -march=loongarch64 -mno-memcpy -Werror -Wno-maybe-uninitialized -Wno-stringop-overflow -Wno-pointer-to-int-cast -no-pie -fno-stack-protector -mno-explicit-relocs -mno-relax
++DEFINE GCC5_LOONGARCH64_CC_FLAGS = DEF(GCC_LOONGARCH64_CC_FLAGS) -march=loongarch64 -mno-memcpy -Wno-maybe-uninitialized -Wno-stringop-overflow -Wno-pointer-to-int-cast -no-pie -fno-stack-protector -mno-explicit-relocs -mno-relax
+ DEFINE GCC5_LOONGARCH64_DLINK_FLAGS = DEF(GCC_LOONGARCH64_DLINK_FLAGS) DEF(GCC5_DLINK_WARNING_FLAGS) -Wl,--no-relax
+ DEFINE GCC5_LOONGARCH64_DLINK2_FLAGS = DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--defsym=PECOFF_HEADER_SIZE=0x228
+ DEFINE GCC5_LOONGARCH64_ASLDLINK_FLAGS = DEF(GCC_LOONGARCH64_ASLDLINK_FLAGS) DEF(GCC5_LOONGARCH64_DLINK2_FLAGS) DEF(GCC5_DLINK_WARNING_FLAGS)
+--- a/BaseTools/Source/C/Makefiles/header.makefile ++++ b/BaseTools/Source/C/Makefiles/header.makefile +@@ -158,17 +158,17 @@ BUILD_OPTFLAGS = -O2 $(EXTRA_OPTFLAGS) +
+ ifeq ($(DARWIN),Darwin)
+ # assume clang or clang compatible flags on OS X
+-CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \
++CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall \
+ -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -g
+ else
+ ifneq ($(CLANG),)
+ CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
+--fno-delete-null-pointer-checks -Wall -Werror \
++-fno-delete-null-pointer-checks -Wall \
+ -Wno-deprecated-declarations -Wno-self-assign \
+ -Wno-unused-result -nostdlib -g
+ else
+ CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
+--fno-delete-null-pointer-checks -Wall -Werror \
++-fno-delete-null-pointer-checks -Wall \
+ -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict \
+ -Wno-unused-result -nostdlib -g
+ endif
diff --git a/sys-firmware/edk2/metadata.xml b/sys-firmware/edk2/metadata.xml new file mode 100644 index 000000000000..7c5f3001e12f --- /dev/null +++ b/sys-firmware/edk2/metadata.xml @@ -0,0 +1,16 @@ +<?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> + <maintainer type="person"> + <email>chewi@gentoo.org</email> + <name>James Le Cuirot</name> + </maintainer> + <upstream> + <remote-id type="github">tianocore/edk2</remote-id> + <remote-id type="cpe">cpe:/a:tianocore:edk2</remote-id> + </upstream> +</pkgmetadata> diff --git a/sys-firmware/firmware-imx/Manifest b/sys-firmware/firmware-imx/Manifest new file mode 100644 index 000000000000..b6d1c1614069 --- /dev/null +++ b/sys-firmware/firmware-imx/Manifest @@ -0,0 +1 @@ +DIST firmware-imx-8.18.bin 1513050 BLAKE2B ce4a8939f11a6580859d208164b225f7ce6bdd225f8488514727bb82360f6edb426a20f61e374cd7e72c32282284a1688368abff683a2907f0dbc12b7ca9379c SHA512 e0b0a73f53e3d97035fadc64f84ba8c3dc73a58db66107cfffc0f9938fa1ad4eb4e1d96a8f23f44ba9711305d5b4dbdf25a9333cce99c6d37aea492d65ae913a diff --git a/sys-firmware/firmware-imx/firmware-imx-8.18.ebuild b/sys-firmware/firmware-imx/firmware-imx-8.18.ebuild new file mode 100644 index 000000000000..1ca9ce550781 --- /dev/null +++ b/sys-firmware/firmware-imx/firmware-imx-8.18.ebuild @@ -0,0 +1,24 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="NXP i.MX firmware" +HOMEPAGE="https://www.timesys.com/" +SRC_URI="http://repository.timesys.com/buildsources/${PN:0:1}/${PN}/${P}/${P}.bin" +LICENSE="LA_OPT_BASE_LICENSE" +SLOT="0" +KEYWORDS="~arm" + +S="${WORKDIR}/${P}/firmware" + +src_unpack() { + eval local $(grep -a -m1 "^filesizes=" "${DISTDIR}/${A}") + tail -c"${filesizes}" "${DISTDIR}/${A}" > "${P}.tar.bz2" || die + unpack "./${P}.tar.bz2" +} + +src_install() { + insinto /lib/firmware + doins -r */ +} diff --git a/sys-firmware/firmware-imx/metadata.xml b/sys-firmware/firmware-imx/metadata.xml new file mode 100644 index 000000000000..374cd4dedb33 --- /dev/null +++ b/sys-firmware/firmware-imx/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="person"> + <email>chewi@gentoo.org</email> + <name>James Le Cuirot</name> + </maintainer> +</pkgmetadata> diff --git a/sys-firmware/intel-microcode/Manifest b/sys-firmware/intel-microcode/Manifest new file mode 100644 index 000000000000..881b9b5724bc --- /dev/null +++ b/sys-firmware/intel-microcode/Manifest @@ -0,0 +1,7 @@ +DIST intel-microcode-collection-20260211.tar.xz 24796412 BLAKE2B a5944ed538a1d7ddae5e92409383f09e10304b39834d8488e5197e1b66d17fadd495f23e0bdab4ed06cd6abee73048617805f902ee95a01f37f79f54851d3ba0 SHA512 7d760a121601c329fdb7ef3d79217b29a6e3e2c7c7b112f701a6e60467641472fe4e3f66bf61d2788c4bfeb17fa2e6c1dc11c5cd18efd99e2acf753fdb3b1b0c +DIST intel-microcode-collection-20260227.tar.xz 26976652 BLAKE2B 7a49dfcd62d9ba1773768954b4aaff98c37ae50a2be16c671a78a4046c5523634bc19809b4bbef03cd7a60e8c710ce477a9b0949ff6a8ddc8aa9f8590143de23 SHA512 1ce5428d50e692015b9c919049bda27215453aaddbcb8bc3c8c3312ad763ca9f102b0cc614905931441e031a5fc1ac7f54dd367a0b4506b41f73e7260e11ee18 +DIST intel-microcode-collection-20260513.tar.xz 27365080 BLAKE2B a2c984da2889ed13e4b671fa957662205ef11c3e3c0bc88c50e56460b7647346393daedbd363daac70e9d7a1d21ab81653186ff1be20e56d04e5345b45d870f5 SHA512 4be613c12063c42867e389a7881195c762ec2a7866fdde226c4e00d4cf9697b305884b02e0c2fc9194c2486c969babcdadd607171c729fa1100d2687f52e98d2 +DIST intel-ucode-sig_0x406e3-rev_0xd6.bin 101376 BLAKE2B 66d55867954d69dda1425febd93bb8c89f7aa836d504f8b5fee127f8505bcf2246f4fcc55cc245bc5e532528d60cca2eee278de7ab5174dc2862db7982a2b36f SHA512 248066b521bf512b5d8e4a8c7e921464ce52169c954d6e4ca580d8c172cd789519e22b4cf56c212e452b4191741f0202019f7061d322c9433b5af9ce5413b567 +DIST microcode-20260210.tar.gz 16622114 BLAKE2B 3b3a8fef499a67af0264550b457ae7de4f6965d9c8c02cc1b5b0f02316580662397016287510e09274e241d8d9cb7d70245f05a584f746515ac7c9bbe4a5cb28 SHA512 ec4ed32600ce1ce2c9c52796458f92205c89c38ba2834d84ab86d800790c709d22cb66e4fca5edda42752363956324f8066d08e3b1d81c50ac879d2749068655 +DIST microcode-20260227.tar.gz 16621772 BLAKE2B 3725dee3af32b545a754a47616c7451a6e7e227af125a8eb35729b2784dfbdecccea6054e1f3190119253041697ce525380e5a98c929e42a4294028d2eca1ebd SHA512 d9de41b1f1b2740d12f0e9e4987b8001d7b9a0ae53382e9bd715936fb7cab7da74a9154df781950738db1c1ebb9ad4f46700355b67a0fb4e8fd5e80711702723 +DIST microcode-20260512.tar.gz 16949219 BLAKE2B 10407aa08481998fb5102bbf517b1cf5c083d16fae8468d25ad2c6ad4b6a665c520cb35f22a44b1f2b385232694bd18b1ee2e75a46658dcdafe40c0c54562c07 SHA512 b6e2e9fb3fe19cd46fcbcd639d16e2348b812eac2bcc535fb839d226218e1cbc724fc49c0d81acf606a22b719ff43ed5b46304fba65ef0ba663290df822649b8 diff --git a/sys-firmware/intel-microcode/files/35-intel-microcode-systemd.install b/sys-firmware/intel-microcode/files/35-intel-microcode-systemd.install new file mode 100644 index 000000000000..58593a675b37 --- /dev/null +++ b/sys-firmware/intel-microcode/files/35-intel-microcode-systemd.install @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +# Copyright 2024 Gentoo Authors +# This script is installed by sys-firmware/intel-microcode, it is executed by +# systemd's kernel-install, NOT by the traditional installkernel. I.e. this +# plugin is run when the systemd USE flag is enabled or +# SYSTEMD_KERNEL_INSTALL=1 is set in the environment. + +COMMAND="${1}" + +if [[ ${COMMAND} != add ]]; then + exit 0 +fi + +if [[ ${KERNEL_INSTALL_INITRD_GENERATOR} == dracut ]]; then + # Dracut bundles microcode in its initramfs images + [[ ${KERNEL_INSTALL_VERBOSE} == 1 ]] && echo \ + "initrd_generator=${KERNEL_INSTALL_INITRD_GENERATOR} bundles CPU microcode, nothing to do here." + exit 0 +fi + +# do nothing if somehow iucode_tool is not installed +if ! command -v iucode_tool >/dev/null; then + [[ ${KERNEL_INSTALL_VERBOSE} == 1 ]] && echo \ + "iucode_tool command not available" + exit 1 +fi + +# use same opts as intel-microcode.ebuild +opts=( + --write-earlyfw="${KERNEL_INSTALL_STAGING_AREA}/microcode-intel" + --overwrite + --strict-checks + --no-ignore-broken + --no-downgrade +) + +if [[ -d /lib/firmware/intel-ucode ]]; then + if [[ ${KERNEL_INSTALL_VERBOSE} == 1 ]]; then + echo "Generating Intel CPU Microcode early initramfs image..." + opts+=( + --list-all + --list + ) + fi + + iucode_tool /lib/firmware/intel-ucode "${opts[@]}" || + { echo "iucode_tool failed" && exit 1; } +else + [[ ${KERNEL_INSTALL_VERBOSE} == 1 ]] && echo \ + "No Intel CPU Microcode installed, nothing to do here." +fi diff --git a/sys-firmware/intel-microcode/files/35-intel-microcode.install b/sys-firmware/intel-microcode/files/35-intel-microcode.install new file mode 100644 index 000000000000..513b3a84d08e --- /dev/null +++ b/sys-firmware/intel-microcode/files/35-intel-microcode.install @@ -0,0 +1,53 @@ +#!/usr/bin/env bash + +# Copyright 2024 Gentoo Authors +# This script is installed by sys-firmware/intel-microcode, it is executed by +# the traditional installkernel, NOT by systemd's kernel-install. I.e. this +# plugin is run when the systemd USE flag is disabled or +# SYSTEMD_KERNEL_INSTALL=0 is set in the environment. + +# familiar helpers, we intentionally don't use Gentoo functions.sh +die() { + echo -e " ${NOCOLOR-\e[1;31m*\e[0m }${*}" >&2 + exit 1 +} + +einfo() { + echo -e " ${NOCOLOR-\e[1;32m*\e[0m }${*}" >&2 +} + +main() { + # re-define for subst to work + [[ -n ${NOCOLOR+yes} ]] && NOCOLOR= + + if [[ ${INSTALLKERNEL_INITRD_GENERATOR} == dracut ]]; then + # Dracut bundles microcode in its initramfs images + echo "initrd_generator=${INSTALLKERNEL_INITRD_GENERATOR} bundles CPU microcode, nothing to do here." + exit 0 + fi + + # do nothing if somehow iucode_tool is not installed + [[ -x $(command -v iucode_tool) ]] || die "iucode_tool command not available" + + [[ ${EUID} -eq 0 ]] || die "Please run this script as root" + + local opts=( + --write-earlyfw="/boot/intel-uc.img" + --overwrite + --strict-checks + --no-ignore-broken + --no-downgrade + --list-all + --list + ) + + if [[ -d /lib/firmware/intel-ucode ]]; then + einfo "Generating Intel CPU Microcode early initramfs image..." + iucode_tool /lib/firmware/intel-ucode "${opts[@]}" || + die "iucode_tool failed" + else + einfo "No Intel CPU Microcode installed, nothing to do here." + fi +} + +main diff --git a/sys-firmware/intel-microcode/intel-microcode-20260210_p20260211.ebuild b/sys-firmware/intel-microcode/intel-microcode-20260210_p20260211.ebuild new file mode 100644 index 000000000000..c7ca5d9bbe76 --- /dev/null +++ b/sys-firmware/intel-microcode/intel-microcode-20260210_p20260211.ebuild @@ -0,0 +1,338 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit dist-kernel-utils linux-info mount-boot + +# Find updates by searching and clicking the first link (hopefully it's the one): +# https://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File +# +# +# Package Maintenance instructions: +# 1. The ebuild is in the form of intel-microcode-<INTEL_SNAPSHOT>_p<COLLECTION_SNAPSHOT>.ebuild +# 2. The INTEL_SNAPSHOT upstream is located at: https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files +# 3. The COLLECTION_SNAPSHOT is created manually using the following steps: +# a. Clone the repository https://github.com/platomav/CPUMicrocodes +# b. Rename the Intel directory to intel-microcode-collection-<YYYYMMDD> +# c. From the CPUMicrocodes directory tar and xz compress the contents of intel-microcode-collection-<YYYYMMDD>: +# tar -cJf intel-microcode-collection-<YYYYMMDD>.tar.xz intel-microcode-collection-<YYYYMMDD>/ +# d. This file can go in your devspace, add the URL to SRC_URI if it's not there +# https://dev.gentoo.org/~<dev nick>/dist/intel-microcode/intel-microcode-collection-${COLLECTION_SNAPSHOT}.tar.xz +# +# PV: +# * the first date is upstream +# * the second date is snapshot (use last commit date in repo) from intel-microcode-collection + +COLLECTION_SNAPSHOT="${PV##*_p}" +INTEL_SNAPSHOT="${PV/_p*}" +#NUM="28087" + +#https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=${NUM} +#https://downloadmirror.intel.com/${NUM}/eng/microcode-${INTEL_SNAPSHOT}.tgz + +DESCRIPTION="Intel IA32/IA64 microcode update data" +HOMEPAGE="https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files https://github.com/platomav/CPUMicrocodes http://inertiawar.com/microcode/" +SRC_URI=" + https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/archive/microcode-${INTEL_SNAPSHOT}.tar.gz + https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/raw/437f382b1be4412b9d03e2bbdcda46d83d581242/intel-ucode/06-4e-03 -> intel-ucode-sig_0x406e3-rev_0xd6.bin + https://dev.gentoo.org/~mpagano/dist/intel-microcode/intel-microcode-collection-${COLLECTION_SNAPSHOT}.tar.xz + https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/intel-microcode-collection-${COLLECTION_SNAPSHOT}.tar.xz +" +S="${WORKDIR}" + +LICENSE="intel-ucode" +SLOT="0" +KEYWORDS="-* amd64 x86" +IUSE="dist-kernel hostonly +initramfs +split-ucode vanilla" +REQUIRED_USE=" + || ( initramfs split-ucode ) + dist-kernel? ( split-ucode ) +" +RESTRICT="binchecks strip" + +BDEPEND=">=sys-apps/iucode_tool-2.3" +# !<sys-apps/microcode-ctl-1.17-r2 due to bug #268586 +RDEPEND=" + dist-kernel? ( + virtual/dist-kernel + initramfs? ( + sys-apps/iucode_tool + ) + ) +" +IDEPEND=" + hostonly? ( sys-apps/iucode_tool ) + dist-kernel? ( + initramfs? ( sys-kernel/installkernel ) + ) +" + +# Blacklist bad microcode here. +# 0x000406f1 aka 06-4f-01 aka CPUID 406F1 require newer microcode loader +MICROCODE_BLACKLIST_DEFAULT="-s !0x000406f1" + +# https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/issues/31 +MICROCODE_BLACKLIST_DEFAULT+=" -s !0x000406e3,0xc0,eq:0x00dc" + +# https://bugs.gentoo.org/722768 +MICROCODE_BLACKLIST_DEFAULT+=" -s !0x000406e3,0xc0,eq:0x00da" + +# https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/commit/49bb67f32a2e3e631ba1a9a73da1c52e1cac7fd9 +MICROCODE_BLACKLIST_DEFAULT+=" -s !0x000806c1,0x80,eq:0x0068" + +# In case we want to set some defaults ... +MICROCODE_SIGNATURES_DEFAULT="" + +# Advanced users only! +# Set MIRCOCODE_SIGNATURES to merge with: +# only current CPU: MICROCODE_SIGNATURES="-S" +# only specific CPU: MICROCODE_SIGNATURES="-s 0x00000f4a -s 0x00010676" +# exclude specific CPU: MICROCODE_SIGNATURES="-s !0x00000686" + +pkg_pretend() { + if use initramfs; then + if use dist-kernel; then + # Check, but don't die because we can fix the problem and then + # emerge --config ... to re-run installation. + nonfatal mount-boot_check_status + else + mount-boot_pkg_pretend + fi + fi +} + +src_prepare() { + default + + if cd Intel-Linux-Processor-Microcode-Data* &>/dev/null; then + # new tarball format from GitHub + mv * ../ || die "Failed to move Intel-Linux-Processor-Microcode-Data*" + cd .. || die + rm -r Intel-Linux-Processor-Microcode-Data* || die + fi + + mkdir intel-ucode-old || die + cp "${DISTDIR}"/intel-ucode-sig_0x406e3-rev_0xd6.bin "${S}"/intel-ucode-old/ || die + + # Prevent "invalid file format" errors from iucode_tool + rm -f "${S}"/intel-ucod*/list || die + + # https://gitlab.com/iucode-tool/iucode-tool/-/issues/4 + rm "${S}"/intel-microcode-collection-${COLLECTION_SNAPSHOT}/cpu106C0_plat01_ver00000007_2007-08-24_PRD_923CDFA3.bin || die + + # Remove non-microcode file from list + rm -f "${S}"/intel-microcode-collection-${COLLECTION_SNAPSHOT}/LICENSE || die + rm -f "${S}"/intel-ucode*/LICENSE || die +} + +src_install() { + # This will take ALL of the upstream microcode sources: + # - microcode.dat + # - intel-ucode/ + # In some cases, they have not contained the same content (eg the directory has newer stuff). + MICROCODE_SRC=( + "${S}"/intel-ucode/ + "${S}"/intel-ucode-with-caveats/ + "${S}"/intel-ucode-old/ + ) + + # Allow users who are scared about microcode updates not included in Intel's official + # microcode tarball to opt-out and comply with Intel marketing + if ! use vanilla; then + MICROCODE_SRC+=( "${S}"/intel-microcode-collection-${COLLECTION_SNAPSHOT} ) + fi + + # These will carry into pkg_preinst via env saving. + : ${MICROCODE_BLACKLIST=${MICROCODE_BLACKLIST_DEFAULT}} + : ${MICROCODE_SIGNATURES=${MICROCODE_SIGNATUES_DEFAULT}} + + opts=( + ${MICROCODE_BLACKLIST} + ${MICROCODE_SIGNATURES} + # be strict about what we are doing + --overwrite + --strict-checks + --no-ignore-broken + # we want to install latest version + --no-downgrade + # show everything we find + --list-all + # show what we selected + --list + ) + + # Instruct Dracut on whether or not we want the microcode in initramfs + # Use here 15 instead of 10, intel-microcode overwrites linux-firmware + ( + insinto /usr/lib/dracut/dracut.conf.d + newins - 15-${PN}.conf <<<"early_microcode=$(usex initramfs)" + ) + if use initramfs; then + # Install installkernel/kernel-install hooks for non-dracut initramfs + # generators that don't bundled the microcode + ( + exeinto /usr/lib/kernel/preinst.d + doexe "${FILESDIR}/35-intel-microcode.install" + exeinto /usr/lib/kernel/install.d + doexe "${FILESDIR}/35-intel-microcode-systemd.install" + ) + fi + + # The earlyfw cpio needs to be in /boot because it must be loaded before + # rootfs is mounted. + if ! use dist-kernel && use initramfs; then + dodir /boot && opts+=( --write-earlyfw="${ED}/boot/intel-uc.img" ) + fi + + keepdir /lib/firmware/intel-ucode + opts+=( --write-firmware="${ED}/lib/firmware/intel-ucode" ) + + iucode_tool \ + "${opts[@]}" \ + "${MICROCODE_SRC[@]}" \ + || die "iucode_tool ${opts[@]} ${MICROCODE_SRC[@]}" + + dodoc releasenote.md +} + +pkg_preinst() { + if [[ ${MICROCODE_BLACKLIST} != ${MICROCODE_BLACKLIST_DEFAULT} ]]; then + ewarn "MICROCODE_BLACKLIST is set to \"${MICROCODE_BLACKLIST}\" instead of default \"${MICROCODE_BLACKLIST_DEFAULT}\". You are on your own!" + fi + + if [[ ${MICROCODE_SIGNATURES} != ${MICROCODE_SIGNATURES_DEFAULT} ]]; then + ewarn "Package was created using advanced options:" + ewarn "MICROCODE_SIGNATURES is set to \"${MICROCODE_SIGNATURES}\" instead of default \"${MICROCODE_SIGNATURES_DEFAULT}\"!" + fi + + # Make sure /boot is available if needed. + use initramfs && ! use dist-kernel && mount-boot_pkg_preinst + + local _initramfs_file="${ED}/boot/intel-uc.img" + + if use hostonly; then + # While this output looks redundant we do this check to detect + # rare cases where iucode_tool was unable to detect system's processor(s). + local _detected_processors=$(iucode_tool --scan-system 2>&1) + if [[ -z "${_detected_processors}" ]]; then + ewarn "Looks like iucode_tool was unable to detect any processor!" + else + einfo "Only installing ucode(s) for ${_detected_processors#iucode_tool: system has } due to USE=hostonly ..." + fi + + opts=( + --scan-system + # be strict about what we are doing + --overwrite + --strict-checks + --no-ignore-broken + # we want to install latest version + --no-downgrade + # show everything we find + --list-all + # show what we selected + --list + ) + + # The earlyfw cpio needs to be in /boot because it must be loaded before + # rootfs is mounted. + if ! use dist-kernel && use initramfs; then + opts+=( --write-earlyfw=${_initramfs_file} ) + fi + + if use split-ucode; then + opts+=( --write-firmware="${ED}/lib/firmware/intel-ucode" ) + fi + + opts+=( "${ED}/lib/firmware/intel-ucode-temp" ) + + mv "${ED}"/lib/firmware/intel-ucode{,-temp} || die + keepdir /lib/firmware/intel-ucode + + iucode_tool "${opts[@]}" || die "iucode_tool ${opts[@]}" + + rm -r "${ED}"/lib/firmware/intel-ucode-temp || die + + elif ! use split-ucode; then # hostonly disabled + rm -r "${ED}"/lib/firmware/intel-ucode || die + fi + + # Because it is possible that this package will install not one single file + # due to user selection which is still somehow unexpected we add the following + # check to inform user so that the user has at least a chance to detect + # a problem/invalid select. + local _has_installed_something= + if use initramfs && [[ -s "${_initramfs_file}" ]]; then + _has_installed_something="yes" + elif use split-ucode; then + _has_installed_something=$(find "${ED}/lib/firmware/intel-ucode" -maxdepth 0 -not -empty -exec echo yes \;) + fi + + if use hostonly && [[ -n "${_has_installed_something}" ]]; then + elog "You only installed ucode(s) for all currently available (=online)" + elog "processor(s). Remember to re-emerge this package whenever you" + elog "change the system's processor model." + elog "" + elif [[ -z "${_has_installed_something}" ]]; then + ewarn "WARNING:" + if [[ ${MICROCODE_SIGNATURES} != ${MICROCODE_SIGNATURES_DEFAULT} ]]; then + ewarn "No ucode was installed! Because you have created this package" + ewarn "using MICROCODE_SIGNATURES variable please double check if you" + ewarn "have an invalid select." + ewarn "It's rare but it is also possible that just no ucode update" + ewarn "is available for your processor(s). In this case it is safe" + ewarn "to ignore this warning." + else + ewarn "No ucode was installed! It's rare but it is also possible" + ewarn "that just no ucode update is available for your processor(s)." + ewarn "In this case it is safe to ignore this warning." + fi + + ewarn "" + + if use hostonly; then + ewarn "Unset \"hostonly\" USE flag to install all available ucodes." + ewarn "" + fi + fi +} + +pkg_prerm() { + # Make sure /boot is mounted so that we can remove /boot/intel-uc.img! + use initramfs && ! use dist-kernel && mount-boot_pkg_prerm +} + +pkg_postrm() { + # Don't forget to umount /boot if it was previously mounted by us. + use initramfs && ! use dist-kernel && mount-boot_pkg_postrm +} + +pkg_postinst() { + if use initramfs; then + if use dist-kernel; then + dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" --all + else + # Don't forget to umount /boot if it was previously mounted by us. + mount-boot_pkg_postinst + fi + fi + + # We cannot give detailed information if user is affected or not: + # If MICROCODE_BLACKLIST wasn't modified, user can still use MICROCODE_SIGNATURES + # to to force a specific, otherwise blacklisted, microcode. So we + # only show a generic warning based on running kernel version: + if kernel_is -lt 4 14 34; then + ewarn "${P} contains microcode updates which require" + ewarn "additional kernel patches which aren't yet included in kernel <4.14.34." + ewarn "Loading such a microcode through kernel interface from an unpatched kernel" + ewarn "can crash your system!" + ewarn "" + ewarn "Those microcodes are blacklisted per default. However, if you have altered" + ewarn "MICROCODE_BLACKLIST or MICROCODE_SIGNATURES, you maybe have unintentionally" + ewarn "re-enabled those microcodes...!" + ewarn "" + ewarn "Check \"${EROOT}/usr/share/doc/${PN}-*/releasenot*\" if your microcode update" + ewarn "requires additional kernel patches or not." + fi +} diff --git a/sys-firmware/intel-microcode/intel-microcode-20260227_p20260227.ebuild b/sys-firmware/intel-microcode/intel-microcode-20260227_p20260227.ebuild new file mode 100644 index 000000000000..d23defd27346 --- /dev/null +++ b/sys-firmware/intel-microcode/intel-microcode-20260227_p20260227.ebuild @@ -0,0 +1,339 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit dist-kernel-utils linux-info mount-boot + +# Find updates by searching and clicking the first link (hopefully it's the one): +# https://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File +# +# +# Package Maintenance instructions: +# 1. The ebuild is in the form of intel-microcode-<INTEL_SNAPSHOT>_p<COLLECTION_SNAPSHOT>.ebuild +# 2. The INTEL_SNAPSHOT upstream is located at: https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files +# 3. The COLLECTION_SNAPSHOT is created manually using the following steps: +# a. Clone the repository https://github.com/platomav/CPUMicrocodes +# b. Rename the Intel directory to intel-microcode-collection-<YYYYMMDD> +# c. From the CPUMicrocodes directory tar and xz compress the contents of intel-microcode-collection-<YYYYMMDD>: +# tar -cJf intel-microcode-collection-<YYYYMMDD>.tar.xz intel-microcode-collection-<YYYYMMDD>/ +# d. This file should be signed and uploaded to masterkup. For detailed instructions, please go to: https://wiki.gentoo.org/wiki/Project:Infrastructure/Project_Distfiles +# e. The SRC_URI will then be of the form: +# https://distfiles.gentoo.org/pub/proj/intel-microcode/intel-microcode-collection-${COLLECTION_SNAPSHOT}.tar.xz +# +# PV: +# * the first date is upstream +# * the second date is snapshot (use last commit date in repo) from intel-microcode-collection + +COLLECTION_SNAPSHOT="${PV##*_p}" +INTEL_SNAPSHOT="${PV/_p*}" +#NUM="28087" + +#https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=${NUM} +#https://downloadmirror.intel.com/${NUM}/eng/microcode-${INTEL_SNAPSHOT}.tgz + +DESCRIPTION="Intel IA32/IA64 microcode update data" +HOMEPAGE="https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files https://github.com/platomav/CPUMicrocodes http://inertiawar.com/microcode/" +SRC_URI=" + https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/archive/microcode-${INTEL_SNAPSHOT}.tar.gz + https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/raw/437f382b1be4412b9d03e2bbdcda46d83d581242/intel-ucode/06-4e-03 -> intel-ucode-sig_0x406e3-rev_0xd6.bin + https://dev.gentoo.org/~mpagano/dist/intel-microcode/intel-microcode-collection-${COLLECTION_SNAPSHOT}.tar.xz + https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/intel-microcode-collection-${COLLECTION_SNAPSHOT}.tar.xz +" +S="${WORKDIR}" + +LICENSE="intel-ucode" +SLOT="0" +KEYWORDS="-* amd64 x86" +IUSE="dist-kernel hostonly +initramfs +split-ucode vanilla" +REQUIRED_USE=" + || ( initramfs split-ucode ) + dist-kernel? ( split-ucode ) +" +RESTRICT="binchecks strip" + +BDEPEND=">=sys-apps/iucode_tool-2.3" +# !<sys-apps/microcode-ctl-1.17-r2 due to bug #268586 +RDEPEND=" + dist-kernel? ( + virtual/dist-kernel + initramfs? ( + sys-apps/iucode_tool + ) + ) +" +IDEPEND=" + hostonly? ( sys-apps/iucode_tool ) + dist-kernel? ( + initramfs? ( sys-kernel/installkernel ) + ) +" + +# Blacklist bad microcode here. +# 0x000406f1 aka 06-4f-01 aka CPUID 406F1 require newer microcode loader +MICROCODE_BLACKLIST_DEFAULT="-s !0x000406f1" + +# https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/issues/31 +MICROCODE_BLACKLIST_DEFAULT+=" -s !0x000406e3,0xc0,eq:0x00dc" + +# https://bugs.gentoo.org/722768 +MICROCODE_BLACKLIST_DEFAULT+=" -s !0x000406e3,0xc0,eq:0x00da" + +# https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/commit/49bb67f32a2e3e631ba1a9a73da1c52e1cac7fd9 +MICROCODE_BLACKLIST_DEFAULT+=" -s !0x000806c1,0x80,eq:0x0068" + +# In case we want to set some defaults ... +MICROCODE_SIGNATURES_DEFAULT="" + +# Advanced users only! +# Set MIRCOCODE_SIGNATURES to merge with: +# only current CPU: MICROCODE_SIGNATURES="-S" +# only specific CPU: MICROCODE_SIGNATURES="-s 0x00000f4a -s 0x00010676" +# exclude specific CPU: MICROCODE_SIGNATURES="-s !0x00000686" + +pkg_pretend() { + if use initramfs; then + if use dist-kernel; then + # Check, but don't die because we can fix the problem and then + # emerge --config ... to re-run installation. + nonfatal mount-boot_check_status + else + mount-boot_pkg_pretend + fi + fi +} + +src_prepare() { + default + + if cd Intel-Linux-Processor-Microcode-Data* &>/dev/null; then + # new tarball format from GitHub + mv * ../ || die "Failed to move Intel-Linux-Processor-Microcode-Data*" + cd .. || die + rm -r Intel-Linux-Processor-Microcode-Data* || die + fi + + mkdir intel-ucode-old || die + cp "${DISTDIR}"/intel-ucode-sig_0x406e3-rev_0xd6.bin "${S}"/intel-ucode-old/ || die + + # Prevent "invalid file format" errors from iucode_tool + rm -f "${S}"/intel-ucod*/list || die + + # https://gitlab.com/iucode-tool/iucode-tool/-/issues/4 + rm "${S}"/intel-microcode-collection-${COLLECTION_SNAPSHOT}/cpu106C0_plat01_ver00000007_2007-08-24_PRD_923CDFA3.bin || die + + # Remove non-microcode file from list + rm -f "${S}"/intel-microcode-collection-${COLLECTION_SNAPSHOT}/LICENSE || die + rm -f "${S}"/intel-ucode*/LICENSE || die +} + +src_install() { + # This will take ALL of the upstream microcode sources: + # - microcode.dat + # - intel-ucode/ + # In some cases, they have not contained the same content (eg the directory has newer stuff). + MICROCODE_SRC=( + "${S}"/intel-ucode/ + "${S}"/intel-ucode-with-caveats/ + "${S}"/intel-ucode-old/ + ) + + # Allow users who are scared about microcode updates not included in Intel's official + # microcode tarball to opt-out and comply with Intel marketing + if ! use vanilla; then + MICROCODE_SRC+=( "${S}"/intel-microcode-collection-${COLLECTION_SNAPSHOT} ) + fi + + # These will carry into pkg_preinst via env saving. + : ${MICROCODE_BLACKLIST=${MICROCODE_BLACKLIST_DEFAULT}} + : ${MICROCODE_SIGNATURES=${MICROCODE_SIGNATUES_DEFAULT}} + + opts=( + ${MICROCODE_BLACKLIST} + ${MICROCODE_SIGNATURES} + # be strict about what we are doing + --overwrite + --strict-checks + --no-ignore-broken + # we want to install latest version + --no-downgrade + # show everything we find + --list-all + # show what we selected + --list + ) + + # Instruct Dracut on whether or not we want the microcode in initramfs + # Use here 15 instead of 10, intel-microcode overwrites linux-firmware + ( + insinto /usr/lib/dracut/dracut.conf.d + newins - 15-${PN}.conf <<<"early_microcode=$(usex initramfs)" + ) + if use initramfs; then + # Install installkernel/kernel-install hooks for non-dracut initramfs + # generators that don't bundled the microcode + ( + exeinto /usr/lib/kernel/preinst.d + doexe "${FILESDIR}/35-intel-microcode.install" + exeinto /usr/lib/kernel/install.d + doexe "${FILESDIR}/35-intel-microcode-systemd.install" + ) + fi + + # The earlyfw cpio needs to be in /boot because it must be loaded before + # rootfs is mounted. + if ! use dist-kernel && use initramfs; then + dodir /boot && opts+=( --write-earlyfw="${ED}/boot/intel-uc.img" ) + fi + + keepdir /lib/firmware/intel-ucode + opts+=( --write-firmware="${ED}/lib/firmware/intel-ucode" ) + + iucode_tool \ + "${opts[@]}" \ + "${MICROCODE_SRC[@]}" \ + || die "iucode_tool ${opts[@]} ${MICROCODE_SRC[@]}" + + dodoc releasenote.md +} + +pkg_preinst() { + if [[ ${MICROCODE_BLACKLIST} != ${MICROCODE_BLACKLIST_DEFAULT} ]]; then + ewarn "MICROCODE_BLACKLIST is set to \"${MICROCODE_BLACKLIST}\" instead of default \"${MICROCODE_BLACKLIST_DEFAULT}\". You are on your own!" + fi + + if [[ ${MICROCODE_SIGNATURES} != ${MICROCODE_SIGNATURES_DEFAULT} ]]; then + ewarn "Package was created using advanced options:" + ewarn "MICROCODE_SIGNATURES is set to \"${MICROCODE_SIGNATURES}\" instead of default \"${MICROCODE_SIGNATURES_DEFAULT}\"!" + fi + + # Make sure /boot is available if needed. + use initramfs && ! use dist-kernel && mount-boot_pkg_preinst + + local _initramfs_file="${ED}/boot/intel-uc.img" + + if use hostonly; then + # While this output looks redundant we do this check to detect + # rare cases where iucode_tool was unable to detect system's processor(s). + local _detected_processors=$(iucode_tool --scan-system 2>&1) + if [[ -z "${_detected_processors}" ]]; then + ewarn "Looks like iucode_tool was unable to detect any processor!" + else + einfo "Only installing ucode(s) for ${_detected_processors#iucode_tool: system has } due to USE=hostonly ..." + fi + + opts=( + --scan-system + # be strict about what we are doing + --overwrite + --strict-checks + --no-ignore-broken + # we want to install latest version + --no-downgrade + # show everything we find + --list-all + # show what we selected + --list + ) + + # The earlyfw cpio needs to be in /boot because it must be loaded before + # rootfs is mounted. + if ! use dist-kernel && use initramfs; then + opts+=( --write-earlyfw=${_initramfs_file} ) + fi + + if use split-ucode; then + opts+=( --write-firmware="${ED}/lib/firmware/intel-ucode" ) + fi + + opts+=( "${ED}/lib/firmware/intel-ucode-temp" ) + + mv "${ED}"/lib/firmware/intel-ucode{,-temp} || die + keepdir /lib/firmware/intel-ucode + + iucode_tool "${opts[@]}" || die "iucode_tool ${opts[@]}" + + rm -r "${ED}"/lib/firmware/intel-ucode-temp || die + + elif ! use split-ucode; then # hostonly disabled + rm -r "${ED}"/lib/firmware/intel-ucode || die + fi + + # Because it is possible that this package will install not one single file + # due to user selection which is still somehow unexpected we add the following + # check to inform user so that the user has at least a chance to detect + # a problem/invalid select. + local _has_installed_something= + if use initramfs && [[ -s "${_initramfs_file}" ]]; then + _has_installed_something="yes" + elif use split-ucode; then + _has_installed_something=$(find "${ED}/lib/firmware/intel-ucode" -maxdepth 0 -not -empty -exec echo yes \;) + fi + + if use hostonly && [[ -n "${_has_installed_something}" ]]; then + elog "You only installed ucode(s) for all currently available (=online)" + elog "processor(s). Remember to re-emerge this package whenever you" + elog "change the system's processor model." + elog "" + elif [[ -z "${_has_installed_something}" ]]; then + ewarn "WARNING:" + if [[ ${MICROCODE_SIGNATURES} != ${MICROCODE_SIGNATURES_DEFAULT} ]]; then + ewarn "No ucode was installed! Because you have created this package" + ewarn "using MICROCODE_SIGNATURES variable please double check if you" + ewarn "have an invalid select." + ewarn "It's rare but it is also possible that just no ucode update" + ewarn "is available for your processor(s). In this case it is safe" + ewarn "to ignore this warning." + else + ewarn "No ucode was installed! It's rare but it is also possible" + ewarn "that just no ucode update is available for your processor(s)." + ewarn "In this case it is safe to ignore this warning." + fi + + ewarn "" + + if use hostonly; then + ewarn "Unset \"hostonly\" USE flag to install all available ucodes." + ewarn "" + fi + fi +} + +pkg_prerm() { + # Make sure /boot is mounted so that we can remove /boot/intel-uc.img! + use initramfs && ! use dist-kernel && mount-boot_pkg_prerm +} + +pkg_postrm() { + # Don't forget to umount /boot if it was previously mounted by us. + use initramfs && ! use dist-kernel && mount-boot_pkg_postrm +} + +pkg_postinst() { + if use initramfs; then + if use dist-kernel; then + dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" --all + else + # Don't forget to umount /boot if it was previously mounted by us. + mount-boot_pkg_postinst + fi + fi + + # We cannot give detailed information if user is affected or not: + # If MICROCODE_BLACKLIST wasn't modified, user can still use MICROCODE_SIGNATURES + # to to force a specific, otherwise blacklisted, microcode. So we + # only show a generic warning based on running kernel version: + if kernel_is -lt 4 14 34; then + ewarn "${P} contains microcode updates which require" + ewarn "additional kernel patches which aren't yet included in kernel <4.14.34." + ewarn "Loading such a microcode through kernel interface from an unpatched kernel" + ewarn "can crash your system!" + ewarn "" + ewarn "Those microcodes are blacklisted per default. However, if you have altered" + ewarn "MICROCODE_BLACKLIST or MICROCODE_SIGNATURES, you maybe have unintentionally" + ewarn "re-enabled those microcodes...!" + ewarn "" + ewarn "Check \"${EROOT}/usr/share/doc/${PN}-*/releasenot*\" if your microcode update" + ewarn "requires additional kernel patches or not." + fi +} diff --git a/sys-firmware/intel-microcode/intel-microcode-20260512_p20260513.ebuild b/sys-firmware/intel-microcode/intel-microcode-20260512_p20260513.ebuild new file mode 100644 index 000000000000..d23defd27346 --- /dev/null +++ b/sys-firmware/intel-microcode/intel-microcode-20260512_p20260513.ebuild @@ -0,0 +1,339 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit dist-kernel-utils linux-info mount-boot + +# Find updates by searching and clicking the first link (hopefully it's the one): +# https://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File +# +# +# Package Maintenance instructions: +# 1. The ebuild is in the form of intel-microcode-<INTEL_SNAPSHOT>_p<COLLECTION_SNAPSHOT>.ebuild +# 2. The INTEL_SNAPSHOT upstream is located at: https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files +# 3. The COLLECTION_SNAPSHOT is created manually using the following steps: +# a. Clone the repository https://github.com/platomav/CPUMicrocodes +# b. Rename the Intel directory to intel-microcode-collection-<YYYYMMDD> +# c. From the CPUMicrocodes directory tar and xz compress the contents of intel-microcode-collection-<YYYYMMDD>: +# tar -cJf intel-microcode-collection-<YYYYMMDD>.tar.xz intel-microcode-collection-<YYYYMMDD>/ +# d. This file should be signed and uploaded to masterkup. For detailed instructions, please go to: https://wiki.gentoo.org/wiki/Project:Infrastructure/Project_Distfiles +# e. The SRC_URI will then be of the form: +# https://distfiles.gentoo.org/pub/proj/intel-microcode/intel-microcode-collection-${COLLECTION_SNAPSHOT}.tar.xz +# +# PV: +# * the first date is upstream +# * the second date is snapshot (use last commit date in repo) from intel-microcode-collection + +COLLECTION_SNAPSHOT="${PV##*_p}" +INTEL_SNAPSHOT="${PV/_p*}" +#NUM="28087" + +#https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=${NUM} +#https://downloadmirror.intel.com/${NUM}/eng/microcode-${INTEL_SNAPSHOT}.tgz + +DESCRIPTION="Intel IA32/IA64 microcode update data" +HOMEPAGE="https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files https://github.com/platomav/CPUMicrocodes http://inertiawar.com/microcode/" +SRC_URI=" + https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/archive/microcode-${INTEL_SNAPSHOT}.tar.gz + https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/raw/437f382b1be4412b9d03e2bbdcda46d83d581242/intel-ucode/06-4e-03 -> intel-ucode-sig_0x406e3-rev_0xd6.bin + https://dev.gentoo.org/~mpagano/dist/intel-microcode/intel-microcode-collection-${COLLECTION_SNAPSHOT}.tar.xz + https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/intel-microcode-collection-${COLLECTION_SNAPSHOT}.tar.xz +" +S="${WORKDIR}" + +LICENSE="intel-ucode" +SLOT="0" +KEYWORDS="-* amd64 x86" +IUSE="dist-kernel hostonly +initramfs +split-ucode vanilla" +REQUIRED_USE=" + || ( initramfs split-ucode ) + dist-kernel? ( split-ucode ) +" +RESTRICT="binchecks strip" + +BDEPEND=">=sys-apps/iucode_tool-2.3" +# !<sys-apps/microcode-ctl-1.17-r2 due to bug #268586 +RDEPEND=" + dist-kernel? ( + virtual/dist-kernel + initramfs? ( + sys-apps/iucode_tool + ) + ) +" +IDEPEND=" + hostonly? ( sys-apps/iucode_tool ) + dist-kernel? ( + initramfs? ( sys-kernel/installkernel ) + ) +" + +# Blacklist bad microcode here. +# 0x000406f1 aka 06-4f-01 aka CPUID 406F1 require newer microcode loader +MICROCODE_BLACKLIST_DEFAULT="-s !0x000406f1" + +# https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/issues/31 +MICROCODE_BLACKLIST_DEFAULT+=" -s !0x000406e3,0xc0,eq:0x00dc" + +# https://bugs.gentoo.org/722768 +MICROCODE_BLACKLIST_DEFAULT+=" -s !0x000406e3,0xc0,eq:0x00da" + +# https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/commit/49bb67f32a2e3e631ba1a9a73da1c52e1cac7fd9 +MICROCODE_BLACKLIST_DEFAULT+=" -s !0x000806c1,0x80,eq:0x0068" + +# In case we want to set some defaults ... +MICROCODE_SIGNATURES_DEFAULT="" + +# Advanced users only! +# Set MIRCOCODE_SIGNATURES to merge with: +# only current CPU: MICROCODE_SIGNATURES="-S" +# only specific CPU: MICROCODE_SIGNATURES="-s 0x00000f4a -s 0x00010676" +# exclude specific CPU: MICROCODE_SIGNATURES="-s !0x00000686" + +pkg_pretend() { + if use initramfs; then + if use dist-kernel; then + # Check, but don't die because we can fix the problem and then + # emerge --config ... to re-run installation. + nonfatal mount-boot_check_status + else + mount-boot_pkg_pretend + fi + fi +} + +src_prepare() { + default + + if cd Intel-Linux-Processor-Microcode-Data* &>/dev/null; then + # new tarball format from GitHub + mv * ../ || die "Failed to move Intel-Linux-Processor-Microcode-Data*" + cd .. || die + rm -r Intel-Linux-Processor-Microcode-Data* || die + fi + + mkdir intel-ucode-old || die + cp "${DISTDIR}"/intel-ucode-sig_0x406e3-rev_0xd6.bin "${S}"/intel-ucode-old/ || die + + # Prevent "invalid file format" errors from iucode_tool + rm -f "${S}"/intel-ucod*/list || die + + # https://gitlab.com/iucode-tool/iucode-tool/-/issues/4 + rm "${S}"/intel-microcode-collection-${COLLECTION_SNAPSHOT}/cpu106C0_plat01_ver00000007_2007-08-24_PRD_923CDFA3.bin || die + + # Remove non-microcode file from list + rm -f "${S}"/intel-microcode-collection-${COLLECTION_SNAPSHOT}/LICENSE || die + rm -f "${S}"/intel-ucode*/LICENSE || die +} + +src_install() { + # This will take ALL of the upstream microcode sources: + # - microcode.dat + # - intel-ucode/ + # In some cases, they have not contained the same content (eg the directory has newer stuff). + MICROCODE_SRC=( + "${S}"/intel-ucode/ + "${S}"/intel-ucode-with-caveats/ + "${S}"/intel-ucode-old/ + ) + + # Allow users who are scared about microcode updates not included in Intel's official + # microcode tarball to opt-out and comply with Intel marketing + if ! use vanilla; then + MICROCODE_SRC+=( "${S}"/intel-microcode-collection-${COLLECTION_SNAPSHOT} ) + fi + + # These will carry into pkg_preinst via env saving. + : ${MICROCODE_BLACKLIST=${MICROCODE_BLACKLIST_DEFAULT}} + : ${MICROCODE_SIGNATURES=${MICROCODE_SIGNATUES_DEFAULT}} + + opts=( + ${MICROCODE_BLACKLIST} + ${MICROCODE_SIGNATURES} + # be strict about what we are doing + --overwrite + --strict-checks + --no-ignore-broken + # we want to install latest version + --no-downgrade + # show everything we find + --list-all + # show what we selected + --list + ) + + # Instruct Dracut on whether or not we want the microcode in initramfs + # Use here 15 instead of 10, intel-microcode overwrites linux-firmware + ( + insinto /usr/lib/dracut/dracut.conf.d + newins - 15-${PN}.conf <<<"early_microcode=$(usex initramfs)" + ) + if use initramfs; then + # Install installkernel/kernel-install hooks for non-dracut initramfs + # generators that don't bundled the microcode + ( + exeinto /usr/lib/kernel/preinst.d + doexe "${FILESDIR}/35-intel-microcode.install" + exeinto /usr/lib/kernel/install.d + doexe "${FILESDIR}/35-intel-microcode-systemd.install" + ) + fi + + # The earlyfw cpio needs to be in /boot because it must be loaded before + # rootfs is mounted. + if ! use dist-kernel && use initramfs; then + dodir /boot && opts+=( --write-earlyfw="${ED}/boot/intel-uc.img" ) + fi + + keepdir /lib/firmware/intel-ucode + opts+=( --write-firmware="${ED}/lib/firmware/intel-ucode" ) + + iucode_tool \ + "${opts[@]}" \ + "${MICROCODE_SRC[@]}" \ + || die "iucode_tool ${opts[@]} ${MICROCODE_SRC[@]}" + + dodoc releasenote.md +} + +pkg_preinst() { + if [[ ${MICROCODE_BLACKLIST} != ${MICROCODE_BLACKLIST_DEFAULT} ]]; then + ewarn "MICROCODE_BLACKLIST is set to \"${MICROCODE_BLACKLIST}\" instead of default \"${MICROCODE_BLACKLIST_DEFAULT}\". You are on your own!" + fi + + if [[ ${MICROCODE_SIGNATURES} != ${MICROCODE_SIGNATURES_DEFAULT} ]]; then + ewarn "Package was created using advanced options:" + ewarn "MICROCODE_SIGNATURES is set to \"${MICROCODE_SIGNATURES}\" instead of default \"${MICROCODE_SIGNATURES_DEFAULT}\"!" + fi + + # Make sure /boot is available if needed. + use initramfs && ! use dist-kernel && mount-boot_pkg_preinst + + local _initramfs_file="${ED}/boot/intel-uc.img" + + if use hostonly; then + # While this output looks redundant we do this check to detect + # rare cases where iucode_tool was unable to detect system's processor(s). + local _detected_processors=$(iucode_tool --scan-system 2>&1) + if [[ -z "${_detected_processors}" ]]; then + ewarn "Looks like iucode_tool was unable to detect any processor!" + else + einfo "Only installing ucode(s) for ${_detected_processors#iucode_tool: system has } due to USE=hostonly ..." + fi + + opts=( + --scan-system + # be strict about what we are doing + --overwrite + --strict-checks + --no-ignore-broken + # we want to install latest version + --no-downgrade + # show everything we find + --list-all + # show what we selected + --list + ) + + # The earlyfw cpio needs to be in /boot because it must be loaded before + # rootfs is mounted. + if ! use dist-kernel && use initramfs; then + opts+=( --write-earlyfw=${_initramfs_file} ) + fi + + if use split-ucode; then + opts+=( --write-firmware="${ED}/lib/firmware/intel-ucode" ) + fi + + opts+=( "${ED}/lib/firmware/intel-ucode-temp" ) + + mv "${ED}"/lib/firmware/intel-ucode{,-temp} || die + keepdir /lib/firmware/intel-ucode + + iucode_tool "${opts[@]}" || die "iucode_tool ${opts[@]}" + + rm -r "${ED}"/lib/firmware/intel-ucode-temp || die + + elif ! use split-ucode; then # hostonly disabled + rm -r "${ED}"/lib/firmware/intel-ucode || die + fi + + # Because it is possible that this package will install not one single file + # due to user selection which is still somehow unexpected we add the following + # check to inform user so that the user has at least a chance to detect + # a problem/invalid select. + local _has_installed_something= + if use initramfs && [[ -s "${_initramfs_file}" ]]; then + _has_installed_something="yes" + elif use split-ucode; then + _has_installed_something=$(find "${ED}/lib/firmware/intel-ucode" -maxdepth 0 -not -empty -exec echo yes \;) + fi + + if use hostonly && [[ -n "${_has_installed_something}" ]]; then + elog "You only installed ucode(s) for all currently available (=online)" + elog "processor(s). Remember to re-emerge this package whenever you" + elog "change the system's processor model." + elog "" + elif [[ -z "${_has_installed_something}" ]]; then + ewarn "WARNING:" + if [[ ${MICROCODE_SIGNATURES} != ${MICROCODE_SIGNATURES_DEFAULT} ]]; then + ewarn "No ucode was installed! Because you have created this package" + ewarn "using MICROCODE_SIGNATURES variable please double check if you" + ewarn "have an invalid select." + ewarn "It's rare but it is also possible that just no ucode update" + ewarn "is available for your processor(s). In this case it is safe" + ewarn "to ignore this warning." + else + ewarn "No ucode was installed! It's rare but it is also possible" + ewarn "that just no ucode update is available for your processor(s)." + ewarn "In this case it is safe to ignore this warning." + fi + + ewarn "" + + if use hostonly; then + ewarn "Unset \"hostonly\" USE flag to install all available ucodes." + ewarn "" + fi + fi +} + +pkg_prerm() { + # Make sure /boot is mounted so that we can remove /boot/intel-uc.img! + use initramfs && ! use dist-kernel && mount-boot_pkg_prerm +} + +pkg_postrm() { + # Don't forget to umount /boot if it was previously mounted by us. + use initramfs && ! use dist-kernel && mount-boot_pkg_postrm +} + +pkg_postinst() { + if use initramfs; then + if use dist-kernel; then + dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" --all + else + # Don't forget to umount /boot if it was previously mounted by us. + mount-boot_pkg_postinst + fi + fi + + # We cannot give detailed information if user is affected or not: + # If MICROCODE_BLACKLIST wasn't modified, user can still use MICROCODE_SIGNATURES + # to to force a specific, otherwise blacklisted, microcode. So we + # only show a generic warning based on running kernel version: + if kernel_is -lt 4 14 34; then + ewarn "${P} contains microcode updates which require" + ewarn "additional kernel patches which aren't yet included in kernel <4.14.34." + ewarn "Loading such a microcode through kernel interface from an unpatched kernel" + ewarn "can crash your system!" + ewarn "" + ewarn "Those microcodes are blacklisted per default. However, if you have altered" + ewarn "MICROCODE_BLACKLIST or MICROCODE_SIGNATURES, you maybe have unintentionally" + ewarn "re-enabled those microcodes...!" + ewarn "" + ewarn "Check \"${EROOT}/usr/share/doc/${PN}-*/releasenot*\" if your microcode update" + ewarn "requires additional kernel patches or not." + fi +} diff --git a/sys-firmware/intel-microcode/metadata.xml b/sys-firmware/intel-microcode/metadata.xml new file mode 100644 index 000000000000..ac0a10c5c118 --- /dev/null +++ b/sys-firmware/intel-microcode/metadata.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>base-system@gentoo.org</email> + <name>Gentoo Base System</name> + </maintainer> + <maintainer type="person"> + <email>mpagano@gentoo.org</email> + <name>Mike Pagano</name> + </maintainer> + <use> + <flag name="dist-kernel">Delegate microcode initramfs generation to <pkg>sys-kernel/installkernel</pkg></flag> + <flag name="initramfs">Install a small initramfs for use with CONFIG_MICROCODE_EARLY</flag> + <flag name="hostonly">Only install ucode(s) supported by currently available (=online) processor(s)</flag> + <flag name="split-ucode">Install the split binary ucode files (used by the kernel directly)</flag> + <flag name="vanilla">Only install microcode updates from Intel's official microcode tarball</flag> + </use> + <upstream> + <remote-id type="github">intel/Intel-Linux-Processor-Microcode-Data-Files</remote-id> + <remote-id type="github">platomav/CPUMicrocodes</remote-id> + </upstream> +</pkgmetadata> diff --git a/sys-firmware/ipw2100-firmware/Manifest b/sys-firmware/ipw2100-firmware/Manifest new file mode 100644 index 000000000000..d0f7e0f61009 --- /dev/null +++ b/sys-firmware/ipw2100-firmware/Manifest @@ -0,0 +1 @@ +DIST ipw2100-fw-1.3.tgz 248471 BLAKE2B 97c56f1887cc6f577b99f8b0e9c1f30f424f28209d6d587922c539b8eacc8663960ea7d4e8713e774fa85ad5d8d38e9ce86bdadcab4d64599ef231294e4ba6e8 SHA512 1e1b8406a795a2f7f9d4d5ba533293daf1a3f3583dbe6eac45849176da8fc46d261bf4ca6a0b236c67c48313b6ff0feb5f9f2019cacbef65471dc0d36e1e1114 diff --git a/sys-firmware/ipw2100-firmware/ipw2100-firmware-1.3-r1.ebuild b/sys-firmware/ipw2100-firmware/ipw2100-firmware-1.3-r1.ebuild new file mode 100644 index 000000000000..0d73fb83f63e --- /dev/null +++ b/sys-firmware/ipw2100-firmware/ipw2100-firmware-1.3-r1.ebuild @@ -0,0 +1,21 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_P=${P/firmware/fw} + +DESCRIPTION="Firmware for the Intel PRO/Wireless 2100 3B miniPCI adapter" +HOMEPAGE="http://ipw2100.sourceforge.net/" +SRC_URI="mirror://gentoo/${MY_P}.tgz" + +LICENSE="ipw2100-fw" +SLOT="${PV}" +KEYWORDS="amd64 ~arm arm64 ~loong ~riscv x86" + +S=${WORKDIR} + +src_install() { + insinto /lib/firmware + doins ipw2100-${PV}{,-i,-p}.fw +} diff --git a/sys-firmware/ipw2100-firmware/metadata.xml b/sys-firmware/ipw2100-firmware/metadata.xml new file mode 100644 index 000000000000..59f4c6b4dfdd --- /dev/null +++ b/sys-firmware/ipw2100-firmware/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-needed --> + <upstream> + <remote-id type="sourceforge">ipw2100</remote-id> + </upstream> +</pkgmetadata> diff --git a/sys-firmware/ipw2200-firmware/Manifest b/sys-firmware/ipw2200-firmware/Manifest new file mode 100644 index 000000000000..833d29ff7407 --- /dev/null +++ b/sys-firmware/ipw2200-firmware/Manifest @@ -0,0 +1 @@ +DIST ipw2200-fw-3.1.tgz 270042 BLAKE2B f6ab1abb14a48a027da86d2c1823964abc70f7972da602338bee2cdd0ef351683adf9ffe31a292aea2ad7397e5669b998e2394cf59586f03a3afb436f2cdcbd1 SHA512 b588566d67a31e8e5c464991f2de5420822816528a388829e36ba47080d2edd10794b0b1d05562035c54e9bb9a9999504a2ff099a37157c39b3c71b125748ad8 diff --git a/sys-firmware/ipw2200-firmware/ipw2200-firmware-3.1-r1.ebuild b/sys-firmware/ipw2200-firmware/ipw2200-firmware-3.1-r1.ebuild new file mode 100644 index 000000000000..81ceca6d4d0f --- /dev/null +++ b/sys-firmware/ipw2200-firmware/ipw2200-firmware-3.1-r1.ebuild @@ -0,0 +1,21 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_P=${P/firmware/fw} + +DESCRIPTION="Firmware for the Intel PRO/Wireless 2200BG/2915ABG miniPCI and 2225BG PCI" +HOMEPAGE="http://ipw2200.sourceforge.net/" +SRC_URI="mirror://gentoo/${MY_P}.tgz" + +LICENSE="ipw2200-fw" +SLOT="0" +KEYWORDS="amd64 ~arm arm64 ~loong ~riscv x86" + +S=${WORKDIR}/${MY_P} + +src_install() { + insinto /lib/firmware + doins ipw2200-{bss,ibss,sniffer}.fw +} diff --git a/sys-firmware/ipw2200-firmware/metadata.xml b/sys-firmware/ipw2200-firmware/metadata.xml new file mode 100644 index 000000000000..6cdf042473a2 --- /dev/null +++ b/sys-firmware/ipw2200-firmware/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-needed --> + <upstream> + <remote-id type="sourceforge">ipw2200</remote-id> + </upstream> +</pkgmetadata> diff --git a/sys-firmware/ipxe/Manifest b/sys-firmware/ipxe/Manifest new file mode 100644 index 000000000000..03e4b585e3cd --- /dev/null +++ b/sys-firmware/ipxe/Manifest @@ -0,0 +1,4 @@ +DIST ipxe-1.21.1-bin.tar.xz 1860424 BLAKE2B 9d621c92be1058389758f885a02b601169d645335bba366a18d16326a7616345e44eb0cd5007d32ac034e7e3c8f8eecd90ade3346e34ca0df899622321f38017 SHA512 85afacfb70e562a935380b7d14ab7328e418478a6f6124eaec7cd0fefb9ba13b8a3f04833fab7b724ceb4c94897a7be2c67faa8be59373719a972ad51e6a5ab3 +DIST ipxe-1.21.1.tar.gz 3934045 BLAKE2B 03871b5f89c6228a9082bb89c7b102d85e5f3afcd5fe0d93762e220fe162c9c3037a9918f30251fd103835d949335f99109a12559f560a5b686e65a7c24c6501 SHA512 47400975110ed4ab95835aa1b7c8d5a6917c19c5713c6ab88bc0741a3adcd62245a9c4251d1f46fffc45289c6b18bf893f86dbc3b67d3189c41b7f198367ecaa +DIST ipxe-1.21.1_p20230601-bin.tar.xz 2248076 BLAKE2B aac91488a4df65548b857980283fc66b3d6d245e400a8dc1115be1708439d09aafb9d6fe93366feafa889035bdfb13edd15be34bf47aa52b75f14f75a1956618 SHA512 2dbcc5b6bf764f9fecf0fd18e304d4ac21ae081a590ceda710a2984e2cd500cff3f26f36d4abb15f806ee64f11ee1b1eb299e6e184f54d85ce74843918a4f02a +DIST ipxe-1.21.1_p20230601.gh.tar.gz 4137586 BLAKE2B 51d8e0f5c95e77707d934a0d8c16104c0d7c500ca33f408c2d94b77244d4b198e7a4b40ee091eb059a55bc0f780572bee8d3556de28f9fdae498206c24139276 SHA512 3fbb803bd679adbeb805c7d3a8ac952e14ff41fdbb7b0c30d8ccb196e39da346faf4c3e2588466bc82400b9f113f08aa8a8056d4ed2393d1aa0fee0d22b67111 diff --git a/sys-firmware/ipxe/ipxe-1.21.1.ebuild b/sys-firmware/ipxe/ipxe-1.21.1.ebuild new file mode 100644 index 000000000000..bb59185a372f --- /dev/null +++ b/sys-firmware/ipxe/ipxe-1.21.1.ebuild @@ -0,0 +1,117 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit savedconfig toolchain-funcs + +DESCRIPTION="Open source network boot (PXE) firmware" +HOMEPAGE="https://ipxe.org/" +SRC_URI=" + !binary? ( https://github.com/${PN}/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz ) + binary? ( https://dev.gentoo.org/~tamiko/distfiles/${P}-bin.tar.xz )" +S="${WORKDIR}/${P}/src" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~loong ~mips ~ppc ppc64 ~riscv x86" +IUSE="+binary uefi ipv6 iso lkrn +qemu undi usb vmware" +REQUIRED_USE="!amd64? ( !x86? ( binary ) )" + +SOURCE_DEPEND=" + app-arch/xz-utils + dev-lang/perl + iso? ( + app-cdr/cdrtools + sys-boot/syslinux + )" +BDEPEND=" + !binary? ( + amd64? ( ${SOURCE_DEPEND} ) + x86? ( ${SOURCE_DEPEND} ) + )" + +src_configure() { + use binary && return + + cat > config/local/general.h <<-EOF || die + #undef BANNER_TIMEOUT + #define BANNER_TIMEOUT 0 + EOF + + if use ipv6; then + cat >> config/local/general.h <<-EOF || die + #define NET_PROTO_IPV6 + EOF + fi + + if use vmware; then + cat >> config/local/general.h <<-EOF || die + #define VMWARE_SETTINGS + #define CONSOLE_VMWARE + EOF + fi + + restore_config config/local/general.h + + tc-ld-disable-gold +} + +ipxemake() { + # Q='' makes the build verbose since that's what everyone loves now + emake Q='' \ + CC="$(tc-getCC)" \ + LD="$(tc-getLD)" \ + AS="$(tc-getAS)" \ + AR="$(tc-getAR)" \ + NM="$(tc-getNM)" \ + OBJCOPY="$(tc-getOBJCOPY)" \ + RANLIB="$(tc-getRANLIB)" \ + OBJDUMP="$(tc-getOBJDUMP)" \ + HOST_CC="$(tc-getBUILD_CC)" \ + "$@" +} + +src_compile() { + use binary && return + + export NO_WERROR=1 + if use qemu; then + ipxemake bin/808610de.rom # pxe-e1000.rom (old) + ipxemake bin/8086100e.rom # pxe-e1000.rom + ipxemake bin/80861209.rom # pxe-eepro100.rom + ipxemake bin/10500940.rom # pxe-ne2k_pci.rom + ipxemake bin/10222000.rom # pxe-pcnet.rom + ipxemake bin/10ec8139.rom # pxe-rtl8139.rom + ipxemake bin/1af41000.rom # pxe-virtio.rom + fi + + if use vmware; then + ipxemake bin/8086100f.mrom # e1000 + ipxemake bin/808610d3.mrom # e1000e + ipxemake bin/10222000.mrom # vlance + ipxemake bin/15ad07b0.rom # vmxnet3 + fi + + use uefi && ipxemake PLATFORM=efi BIN=bin-efi bin-efi/ipxe.efi + use iso && ipxemake bin/ipxe.iso + use undi && ipxemake bin/undionly.kpxe + use usb && ipxemake bin/ipxe.usb + use lkrn && ipxemake bin/ipxe.lkrn +} + +src_install() { + insinto /usr/share/ipxe/ + + if use qemu || use vmware; then + doins bin/*.rom + fi + use vmware && doins bin/*.mrom + use uefi && doins bin-efi/*.efi + use iso && doins bin/*.iso + use undi && doins bin/*.kpxe + use usb && doins bin/*.usb + use lkrn && doins bin/*.lkrn + + save_config config/local/general.h +} diff --git a/sys-firmware/ipxe/ipxe-1.21.1_p20230601-r1.ebuild b/sys-firmware/ipxe/ipxe-1.21.1_p20230601-r1.ebuild new file mode 100644 index 000000000000..3100d26429e5 --- /dev/null +++ b/sys-firmware/ipxe/ipxe-1.21.1_p20230601-r1.ebuild @@ -0,0 +1,138 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit savedconfig secureboot toolchain-funcs + +# for 1.21.1_p20230601 +COMMIT_SHA1="4fa4052c7ebb59e4d4aa396f1563c89118623ec7" + +DESCRIPTION="Open source network boot (PXE) firmware" +HOMEPAGE="https://ipxe.org/" +SRC_URI=" + !binary? ( https://github.com/${PN}/${PN}/archive/${COMMIT_SHA1}.tar.gz -> ${P}.gh.tar.gz ) + binary? ( https://dev.gentoo.org/~tamiko/distfiles/${P}-bin.tar.xz )" +S="${WORKDIR}/${PN}-${COMMIT_SHA1}/src" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~loong ~mips ~ppc ppc64 ~riscv x86" +IUSE="+binary uefi32 uefi64 ipv6 iso lkrn +qemu undi usb vmware" +REQUIRED_USE="!amd64? ( !x86? ( binary ) )" + +SOURCE_DEPEND=" + app-arch/xz-utils + dev-lang/perl + iso? ( + app-cdr/cdrtools + sys-boot/syslinux + )" +BDEPEND=" + !binary? ( + amd64? ( ${SOURCE_DEPEND} ) + x86? ( ${SOURCE_DEPEND} ) + )" + +pkg_setup() { + if use uefi32 || use uefi64; then + secureboot_pkg_setup + fi +} + +src_configure() { + use binary && return + + cat > config/local/general.h <<-EOF || die + #undef BANNER_TIMEOUT + #define BANNER_TIMEOUT 0 + EOF + + if use ipv6; then + cat >> config/local/general.h <<-EOF || die + #define NET_PROTO_IPV6 + EOF + fi + + if use vmware; then + cat >> config/local/general.h <<-EOF || die + #define VMWARE_SETTINGS + #define CONSOLE_VMWARE + EOF + fi + + restore_config config/local/general.h + + tc-ld-disable-gold +} + +ipxemake() { + # Q='' makes the build verbose since that's what everyone loves now + emake Q='' \ + VERSION="${PV}" \ + CC="$(tc-getCC)" \ + LD="$(tc-getLD)" \ + AS="$(tc-getAS)" \ + AR="$(tc-getAR)" \ + NM="$(tc-getNM)" \ + OBJCOPY="$(tc-getOBJCOPY)" \ + RANLIB="$(tc-getRANLIB)" \ + OBJDUMP="$(tc-getOBJDUMP)" \ + HOST_CC="$(tc-getBUILD_CC)" \ + "$@" +} + +src_compile() { + use binary && return + + export NO_WERROR=1 + if use qemu; then + ipxemake bin/808610de.rom # pxe-e1000.rom (old) + ipxemake bin/8086100e.rom # pxe-e1000.rom + ipxemake bin/80861209.rom # pxe-eepro100.rom + ipxemake bin/10500940.rom # pxe-ne2k_pci.rom + ipxemake bin/10222000.rom # pxe-pcnet.rom + ipxemake bin/10ec8139.rom # pxe-rtl8139.rom + ipxemake bin/1af41000.rom # pxe-virtio.rom + fi + + if use vmware; then + ipxemake bin/8086100f.mrom # e1000 + ipxemake bin/808610d3.mrom # e1000e + ipxemake bin/10222000.mrom # vlance + ipxemake bin/15ad07b0.rom # vmxnet3 + fi + + use uefi32 && ipxemake PLATFORM=efi BIN=bin-i386-efi bin-i386-efi/ipxe.efi + use uefi64 && ipxemake PLATFORM=efi BIN=bin-x86_64-efi bin-x86_64-efi/ipxe.efi + use iso && ipxemake bin/ipxe.iso + use undi && ipxemake bin/undionly.kpxe + use usb && ipxemake bin/ipxe.usb + use lkrn && ipxemake bin/ipxe.lkrn +} + +src_install() { + insinto /usr/share/ipxe/ + + if use qemu || use vmware; then + doins bin/*.rom + fi + use vmware && doins bin/*.mrom + use uefi32 && newins bin-i386-efi/ipxe.efi ipxe-i386.efi + use uefi64 && newins bin-x86_64-efi/ipxe.efi ipxe-x86_64.efi + # Add a symlink for backwards compatiblity, in case both variants are + # enabled the x86_64 bit variant takes presedence. + use uefi32 && dosym ipxe-i386.efi /usr/share/ipxe/ipxe.efi + use uefi64 && dosym ipxe-x86_64.efi /usr/share/ipxe/ipxe.efi + + use iso && doins bin/*.iso + use undi && doins bin/*.kpxe + use usb && doins bin/*.usb + use lkrn && doins bin/*.lkrn + + if use uefi32 || use uefi64; then + secureboot_auto_sign --in-place + fi + + save_config config/local/general.h +} diff --git a/sys-firmware/ipxe/ipxe-1.21.1_p20230601.ebuild b/sys-firmware/ipxe/ipxe-1.21.1_p20230601.ebuild new file mode 100644 index 000000000000..efea10128f34 --- /dev/null +++ b/sys-firmware/ipxe/ipxe-1.21.1_p20230601.ebuild @@ -0,0 +1,137 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit savedconfig secureboot toolchain-funcs + +# for 1.21.1_p20230601 +COMMIT_SHA1="4fa4052c7ebb59e4d4aa396f1563c89118623ec7" + +DESCRIPTION="Open source network boot (PXE) firmware" +HOMEPAGE="https://ipxe.org/" +SRC_URI=" + !binary? ( https://github.com/${PN}/${PN}/archive/${COMMIT_SHA1}.tar.gz -> ${P}.gh.tar.gz ) + binary? ( https://dev.gentoo.org/~tamiko/distfiles/${P}-bin.tar.xz )" +S="${WORKDIR}/${PN}-${COMMIT_SHA1}/src" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~loong ~mips ~ppc ppc64 ~riscv x86" +IUSE="+binary uefi32 uefi64 ipv6 iso lkrn +qemu undi usb vmware" +REQUIRED_USE="!amd64? ( !x86? ( binary ) )" + +SOURCE_DEPEND=" + app-arch/xz-utils + dev-lang/perl + iso? ( + app-cdr/cdrtools + sys-boot/syslinux + )" +BDEPEND=" + !binary? ( + amd64? ( ${SOURCE_DEPEND} ) + x86? ( ${SOURCE_DEPEND} ) + )" + +pkg_setup() { + if use uefi32 || use uefi64; then + secureboot_pkg_setup + fi +} + +src_configure() { + use binary && return + + cat > config/local/general.h <<-EOF || die + #undef BANNER_TIMEOUT + #define BANNER_TIMEOUT 0 + EOF + + if use ipv6; then + cat >> config/local/general.h <<-EOF || die + #define NET_PROTO_IPV6 + EOF + fi + + if use vmware; then + cat >> config/local/general.h <<-EOF || die + #define VMWARE_SETTINGS + #define CONSOLE_VMWARE + EOF + fi + + restore_config config/local/general.h + + tc-ld-disable-gold +} + +ipxemake() { + # Q='' makes the build verbose since that's what everyone loves now + emake Q='' \ + CC="$(tc-getCC)" \ + LD="$(tc-getLD)" \ + AS="$(tc-getAS)" \ + AR="$(tc-getAR)" \ + NM="$(tc-getNM)" \ + OBJCOPY="$(tc-getOBJCOPY)" \ + RANLIB="$(tc-getRANLIB)" \ + OBJDUMP="$(tc-getOBJDUMP)" \ + HOST_CC="$(tc-getBUILD_CC)" \ + "$@" +} + +src_compile() { + use binary && return + + export NO_WERROR=1 + if use qemu; then + ipxemake bin/808610de.rom # pxe-e1000.rom (old) + ipxemake bin/8086100e.rom # pxe-e1000.rom + ipxemake bin/80861209.rom # pxe-eepro100.rom + ipxemake bin/10500940.rom # pxe-ne2k_pci.rom + ipxemake bin/10222000.rom # pxe-pcnet.rom + ipxemake bin/10ec8139.rom # pxe-rtl8139.rom + ipxemake bin/1af41000.rom # pxe-virtio.rom + fi + + if use vmware; then + ipxemake bin/8086100f.mrom # e1000 + ipxemake bin/808610d3.mrom # e1000e + ipxemake bin/10222000.mrom # vlance + ipxemake bin/15ad07b0.rom # vmxnet3 + fi + + use uefi32 && ipxemake PLATFORM=efi BIN=bin-i386-efi bin-i386-efi/ipxe.efi + use uefi64 && ipxemake PLATFORM=efi BIN=bin-x86_64-efi bin-x86_64-efi/ipxe.efi + use iso && ipxemake bin/ipxe.iso + use undi && ipxemake bin/undionly.kpxe + use usb && ipxemake bin/ipxe.usb + use lkrn && ipxemake bin/ipxe.lkrn +} + +src_install() { + insinto /usr/share/ipxe/ + + if use qemu || use vmware; then + doins bin/*.rom + fi + use vmware && doins bin/*.mrom + use uefi32 && newins bin-i386-efi/ipxe.efi ipxe-i386.efi + use uefi64 && newins bin-x86_64-efi/ipxe.efi ipxe-x86_64.efi + # Add a symlink for backwards compatiblity, in case both variants are + # enabled the x86_64 bit variant takes presedence. + use uefi32 && dosym ipxe-i386.efi /usr/share/ipxe/ipxe.efi + use uefi64 && dosym ipxe-x86_64.efi /usr/share/ipxe/ipxe.efi + + use iso && doins bin/*.iso + use undi && doins bin/*.kpxe + use usb && doins bin/*.usb + use lkrn && doins bin/*.lkrn + + if use uefi32 || use uefi64; then + secureboot_auto_sign --in-place + fi + + save_config config/local/general.h +} diff --git a/sys-firmware/ipxe/metadata.xml b/sys-firmware/ipxe/metadata.xml new file mode 100644 index 000000000000..f78b98126bc7 --- /dev/null +++ b/sys-firmware/ipxe/metadata.xml @@ -0,0 +1,23 @@ +<?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> + <use> + <flag name="binary">Use pre-built binaries</flag> + <flag name="uefi32">Build a 32bit UEFI program for using PXE</flag> + <flag name="uefi64">Build a 64bit UEFI program for using PXE</flag> + <flag name="iso">Build a bootable ISO for using PXE</flag> + <flag name="lkrn">Build a linux kernel bootable file for using with grub/etc...</flag> + <flag name="usb">Build a bootable USB image for using PXE</flag> + <flag name="undi">Build a Universal Network Device Interface driver + chainloading your existing PXE NIC into iPXE</flag> + <flag name="qemu">Build the required PXE ROM images for <pkg>app-emulation/qemu</pkg></flag> + <flag name="vmware">Build the PXE ROM images that VMWare uses</flag> + </use> + <upstream> + <remote-id type="github">ipxe/ipxe</remote-id> + </upstream> +</pkgmetadata> diff --git a/sys-firmware/ivtv-firmware/Manifest b/sys-firmware/ivtv-firmware/Manifest new file mode 100644 index 000000000000..f8d56a04291e --- /dev/null +++ b/sys-firmware/ivtv-firmware/Manifest @@ -0,0 +1 @@ +DIST ivtv-firmware-20080701.tar.gz 125526 BLAKE2B e0f21c3d06723257609aa12d81120fde30cd920c4aa4b4eb407c569c8280a81fe64d15375f6d3f3c38826105a1eb1a8e35c076f0848f54a386d7850d931b6656 SHA512 1ad00fb55721f5161e0b64d04ea004cd0e24f31b3c47cadb181c0a8f24a0064356b56479cd54d834d4575f6cb5d826bca5fd061634b1e10f0e4b5737c1fb192b diff --git a/sys-firmware/ivtv-firmware/ivtv-firmware-20080701-r2.ebuild b/sys-firmware/ivtv-firmware/ivtv-firmware-20080701-r2.ebuild new file mode 100644 index 000000000000..112373f1a2be --- /dev/null +++ b/sys-firmware/ivtv-firmware/ivtv-firmware-20080701-r2.ebuild @@ -0,0 +1,20 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="firmware for Hauppauge PVR-x50 and Conexant 2341x based cards" +HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage" +SRC_URI="mirror://gentoo/${P}.tar.gz" + +LICENSE="Hauppauge-Firmware" +SLOT="0" +KEYWORDS="amd64 ppc x86" + +S=${WORKDIR} + +src_install() { + insinto /lib/firmware + doins v4l-cx2341x-*.fw v4l-pvrusb2-*.fw + doins *.mpg +} diff --git a/sys-firmware/ivtv-firmware/metadata.xml b/sys-firmware/ivtv-firmware/metadata.xml new file mode 100644 index 000000000000..115e9d64a669 --- /dev/null +++ b/sys-firmware/ivtv-firmware/metadata.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <!-- maintainer-needed --> +</pkgmetadata> diff --git a/sys-firmware/lenovolegionlinux/lenovolegionlinux-9999.ebuild b/sys-firmware/lenovolegionlinux/lenovolegionlinux-9999.ebuild new file mode 100644 index 000000000000..7bb5084bfbc5 --- /dev/null +++ b/sys-firmware/lenovolegionlinux/lenovolegionlinux-9999.ebuild @@ -0,0 +1,117 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +M_PN=LenovoLegionLinux + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{13..14} ) + +inherit linux-mod-r1 distutils-r1 systemd optfeature + +if [[ ${PV} == "9999" ]]; then + EGIT_REPO_URI="https://github.com/johnfanv2/${M_PN}.git" + inherit git-r3 +else + SRC_URI="https://github.com/johnfanv2/${M_PN}/archive/refs/tags/v${PV}.tar.gz" + KEYWORDS="~amd64" +fi + +DESCRIPTION="Lenovo Legion Linux kernel module" +HOMEPAGE="https://github.com/johnfanv2/LenovoLegionLinux" + +BDEPEND=" + sys-kernel/linux-headers + sys-apps/lm-sensors + sys-apps/dmidecode + sys-apps/sed + dev-libs/inih +" + +RDEPEND=" + gui? ( + dev-python/pyqt6[gui,widgets] + dev-python/pyyaml + dev-python/argcomplete + dev-python/darkdetect + ) + downgrade-nvidia? ( <=x11-drivers/nvidia-drivers-525 ) +" + +DEPEND="${RDEPEND}" + +LICENSE="GPL-2" +SLOT="0" +IUSE="+gui downgrade-nvidia elogind" +MODULES_KERNEL_MIN=5.10 + +src_compile() { + local modlist=( + legion-laptop=kernel/drivers/platform/x86:kernel_module:kernel_module:all + ) + export KERNELVERSION=${KV_FULL} + linux-mod-r1_src_compile + if use gui; then + if [[ ${PV} == "9999" ]]; then + #fix python package version + sed -i "s/version = _VERSION/version = 9999/g" "${WORKDIR}/${P}/python/legion_linux/setup.cfg" + else + #fix python package version + sed -i "s/version = _VERSION/version = ${PV}/g" "${WORKDIR}/${P}/python/legion_linux/setup.cfg" + fi + #Define build dir (fix sandboxed) + cd "${WORKDIR}/${P}/python/legion_linux" || die + distutils-r1_src_compile --build-dir "${WORKDIR}/${P}/python/legion_linux/build" + cd "legion_linux/extra/service/legiond" || die + emake + fi +} + +src_install() { + linux-mod-r1_src_install + if use gui; then + #Define build dir (fix sandboxed) + cd "${WORKDIR}/${P}/python/legion_linux/" || die + distutils-r1_src_install --build-dir "${WORKDIR}/${P}/python/legion_linux/build" + + cd "${WORKDIR}/${P}/extra" || die + + systemd_dounit service/legiond.service service/legiond-onresume.service service/legiond-cpuset.service service/legiond-cpuset.timer + + newinitd service/legiond.initd legiond + newinitd service/legiond-cpuset.initd legiond + newsbin service/legiond-cpuset.sh legiond-cpuset + + if use elogind; then + exeinto /lib64/elogind/system-sleep/ + doexe service/legiond-onresume.sh + fi + + dobin service/legiond/legiond + dobin service/legiond/legiond-ctl + fi +} + +pkg_postinst() { + linux-mod-r1_pkg_postinst + + ewarn "Default config files are present in /usr/share/legion_linux" + ewarn "Copy folder /usr/share/legion_linux to /etc/legion_linux" + ewarn "Note: Fancurve can be edit using the gui app" + ewarn "Dont forget to edit /etc/legion_linux/legiond.ini (previous .env) to enable and disable extra features" + ewarn "Note the CPU and APU control command both for undervolt an ryzenadj are edit in /etc/legion_linux/.env" + if !use downgrade-nvidia; then + ewarn "Note: use flag downgrade-nvidia if you need for nvidia TDP control (requires driver 525 to work)\n" + ewarn "This useflag will be drop soon since 525 is almost 6 months old" + else + ewarn "Note: Edit /etc/legion_linux/.env to enable nvidia TDP control\n" + fi + ewarn "Note for 2023-2023 Legion user: It need help for testing the features" + ewarn "Pls test the feature how is decribe in the README of the project!" + ewarn "and also go to this issue in github: https://github.com/johnfanv2/LenovoLegionLinux/issues/46" + + optfeature "radeon dgpu power management" dev-util/rocm-smi + optfeature "ryzen CPU tweaks" sys-power/RyzenAdj + optfeature "intel CPU tweaks" dev-python/undervolt +} diff --git a/sys-firmware/lenovolegionlinux/metadata.xml b/sys-firmware/lenovolegionlinux/metadata.xml new file mode 100644 index 000000000000..86f7aaa7230e --- /dev/null +++ b/sys-firmware/lenovolegionlinux/metadata.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <use> + <flag name="gui">Build and install legion_gui and legion_cli</flag> + <flag name="downgrade-nvidia">Downgrade nvidia for 525 to enable TDP control (systemd-service)</flag> + <flag name="elogind">Enable legiond-onresume openrc support</flag> + </use> + <maintainer type="person"> + <email>gonegrier.duarte@gmail.com</email> + <name>Gonçalo Negrier Duarte</name> + </maintainer> + <maintainer type="person"> + <email>ston.jia@outlook.com</email> + <name>ston</name> + </maintainer> + <upstream> + <remote-id type="github">johnfanv2/LenovoLegionLinux</remote-id> + <bugs-to>https://github.com/johnfanv2/LenovoLegionLinux/issues</bugs-to> + <changelog>https://github.com/johnfanv2/LenovoLegionLinux/blob/main/README.md</changelog> + </upstream> +</pkgmetadata> + diff --git a/sys-firmware/metadata.xml b/sys-firmware/metadata.xml new file mode 100644 index 000000000000..73e9caa45736 --- /dev/null +++ b/sys-firmware/metadata.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE catmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<catmetadata> + <longdescription lang="en"> + The sys-firmware category contains misc. firmware and microcode. + </longdescription> + <longdescription lang="de"> + Die Kategorie sys-firmware enthält verschiedene Firmware und + Mikrocode. + </longdescription> + <longdescription lang="es"> + La categorÃa sys-firmware contiene firmware y microcódigo para + diversos dispositivos. + </longdescription> +</catmetadata> diff --git a/sys-firmware/midisport-firmware/Manifest b/sys-firmware/midisport-firmware/Manifest new file mode 100644 index 000000000000..29542ce4eed0 --- /dev/null +++ b/sys-firmware/midisport-firmware/Manifest @@ -0,0 +1 @@ +DIST midisport-firmware-1.2.tar.gz 62948 BLAKE2B e451816d14d6ff6c6627bbf7ba71de4737aace53b0e22d75802f34d2f1aca557dfa4a29f9eccf131a16f1490e02fb38708c3d64e55d0ea7fecd8c828a34df089 SHA512 ac46b1e16dbee628d41e0c5b39730a4ee51e1f62187e5e56ed393f136937fdffa86ca84882d2627397f074ca2eb12be3a8701a5027999a0d00b84b706e227a0b diff --git a/sys-firmware/midisport-firmware/files/midisport-firmware-1.2-configure.patch b/sys-firmware/midisport-firmware/files/midisport-firmware-1.2-configure.patch new file mode 100644 index 000000000000..bb4338809a92 --- /dev/null +++ b/sys-firmware/midisport-firmware/files/midisport-firmware-1.2-configure.patch @@ -0,0 +1,36 @@ +--- midisport-firmware-1.2.orig/configure.ac 2006-03-05 22:01:45.000000000 +0100 ++++ midisport-firmware-1.2/configure.ac 2013-01-06 22:08:40.479938650 +0100 +@@ -1,9 +1,12 @@ + # Process this file with autoconf to produce a configure script + AC_PREREQ(2.0) + AC_INIT(midisport-firmware, 1.2, [usb-midi-fw-user@lists.sourceforge.net]) +-AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION) ++AM_INIT_AUTOMAKE + AC_REVISION($Revision$) + AC_CONFIG_SRCDIR(MidiSportLoader.ihx) ++m4_ifndef([PKG_PROG_PKG_CONFIG], ++ [m4_fatal([pkg-config is required])]) ++PKG_PROG_PKG_CONFIG + + AC_ARG_WITH([fxload], + AS_HELP_STRING([--with-fxload=name], +@@ -22,17 +25,8 @@ + AC_MSG_ERROR([$FXLOAD not found; please install the fxload package first]) + fi + +-AC_MSG_CHECKING([for udev version]) +-udev_ver=`udevinfo -V | awk '{ print $3 }'` +-if test -n "$udev_ver"; then +- AC_MSG_RESULT([$udev_ver]) +-else +- AC_MSG_RESULT([none]) +- udev_ver="0" +-fi +-if test "$udev_ver" -lt 057; then +- AC_MSG_ERROR([udev version 057 or later is required]) +-fi ++PKG_CHECK_MODULES([udev], [udev >= 057], [], [ ++ AC_MSG_ERROR(["udev of at least version 057 is required"])]) + + AC_ARG_WITH([udev], + AS_HELP_STRING([--with-udev=dir], diff --git a/sys-firmware/midisport-firmware/files/midisport-firmware-1.2-rules.patch b/sys-firmware/midisport-firmware/files/midisport-firmware-1.2-rules.patch new file mode 100644 index 000000000000..46d86c8b2917 --- /dev/null +++ b/sys-firmware/midisport-firmware/files/midisport-firmware-1.2-rules.patch @@ -0,0 +1,26 @@ +--- midisport-firmware-1.2/42-midisport-firmware.rules.in 2013-01-06 22:07:03.385941852 +0100 ++++ midisport-firmware-1.2/42-midisport-firmware.rules.in 2020-07-25 13:47:11.910148029 -0400 +@@ -1,18 +1,12 @@ + # midisport-firmware.rules - udev rules for loading firmware into MidiSport devices + +-# DEVPATH=="/*.0" selects interface 0 only +-# (some udev versions don't work with SYSFS{bInterfaceNumber}) +- + # MidiSport 2x2 +-ACTION=="add", SUBSYSTEM=="usb", DEVPATH=="/*.0", ENV{PRODUCT}=="763/1001/*", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport2x2.ihx" ++ACTION=="add", SUBSYSTEM=="usb*", ATTRS{idVendor}=="0763", ATTRS{idProduct}=="1001", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport2x2.ihx -D %N" + # MidiSport 1x1 +-ACTION=="add", SUBSYSTEM=="usb", DEVPATH=="/*.0", ENV{PRODUCT}=="763/1010/*", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport1x1.ihx" ++ACTION=="add", SUBSYSTEM=="usb*", ATTRS{idVendor}=="0763", ATTRS{idProduct}=="1010", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport1x1.ihx -D %N" + # KeyStation +-ACTION=="add", SUBSYSTEM=="usb", DEVPATH=="/*.0", ENV{PRODUCT}=="763/1014/*", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSportKS.ihx" ++ACTION=="add", SUBSYSTEM=="usb*", ATTRS{idVendor}=="0763", ATTRS{idProduct}=="1014", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSportKS.ihx -D %N" + # MidiSport 4x4 +-ACTION=="add", SUBSYSTEM=="usb", DEVPATH=="/*.0", ENV{PRODUCT}=="763/1020/*", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport4x4.ihx" ++ACTION=="add", SUBSYSTEM=="usb*", ATTRS{idVendor}=="0763", ATTRS{idProduct}=="1020", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport4x4.ihx -D %N" + # MidiSport 8x8 +-ACTION=="add", SUBSYSTEM=="usb", DEVPATH=="/*.0", ENV{PRODUCT}=="763/1031/110", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport8x8-2.10.ihx" +-ACTION=="add", SUBSYSTEM=="usb", DEVPATH=="/*.0", ENV{PRODUCT}=="763/1031/121", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport8x8-2.21.ihx" +- +-# vim: ft=conf ++ACTION=="add", SUBSYSTEM=="usb*", ATTRS{idVendor}=="0763", ATTRS{idProduct}=="1031", RUN+="@fxload@ -s @firmwaredir@/MidiSportLoader.ihx -I @firmwaredir@/MidiSport8x8-2.21.ihx -D %N" diff --git a/sys-firmware/midisport-firmware/metadata.xml b/sys-firmware/midisport-firmware/metadata.xml new file mode 100644 index 000000000000..e5c4248bc00f --- /dev/null +++ b/sys-firmware/midisport-firmware/metadata.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <!-- maintainer-needed --> +</pkgmetadata> diff --git a/sys-firmware/midisport-firmware/midisport-firmware-1.2-r2.ebuild b/sys-firmware/midisport-firmware/midisport-firmware-1.2-r2.ebuild new file mode 100644 index 000000000000..1c341163476a --- /dev/null +++ b/sys-firmware/midisport-firmware/midisport-firmware-1.2-r2.ebuild @@ -0,0 +1,45 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools linux-info udev + +DESCRIPTION="Firmware for M-Audio/Midiman USB MIDI devices" +HOMEPAGE="http://usb-midi-fw.sourceforge.net" +SRC_URI="http://downloads.sourceforge.net/usb-midi-fw/${P}.tar.gz" + +LICENSE="Midisport" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +RDEPEND=" + sys-apps/fxload + virtual/udev +" +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +CONFIG_CHECK="~SND_USB_AUDIO" + +PATCHES=( + "${FILESDIR}"/${P}-configure.patch + "${FILESDIR}"/${P}-rules.patch +) + +src_prepare() { + default + eautoreconf +} + +src_configure() { + econf --with-udev="$(get_udevdir)" +} + +pkg_postinst() { + udev_reload +} + +pkg_postrm() { + udev_reload +} diff --git a/sys-firmware/nvidia-firmware/Manifest b/sys-firmware/nvidia-firmware/Manifest new file mode 100644 index 000000000000..1c1fffcece3a --- /dev/null +++ b/sys-firmware/nvidia-firmware/Manifest @@ -0,0 +1,2 @@ +DIST NVIDIA-Linux-x86-340.32.run 38587515 BLAKE2B d7ebf5ece0f01c132c91e1f45cbfe8bd8354cf8a97e64820938c0cd0d3f3091a1ff778950f25b53c863a8e95d31b1656efbd516293c75a0e5395b264d95b8af1 SHA512 a67e57a1bd70a9cd5ae2bed70403920ed94d8eac9d08dcd380f6065cd597d5824e26ae25a0bcd56626190124c07d128f3b0429040794c8e8d3ead85860fcb646 +DIST nvidia_extract_firmware-a0b9f9be0efad90cc84b8b2eaf587c3d7d350ea9.py 13869 BLAKE2B 1e59322523c5ec3162dca9792b3cc63c7e71f88dd32650141ffaab49e694022ba155b3691261df96f838e6c80f86c7e42b2a46103baa27a93bd8b9525e839f59 SHA512 1b3fbf2e09cd4cbd63d8f86fde88560e1be2e187abd086a8737e69d66a21fc33079be2ab161186f76f42e2e54881325528e425b1f6f350ea3c37222f4e0d1a47 diff --git a/sys-firmware/nvidia-firmware/metadata.xml b/sys-firmware/nvidia-firmware/metadata.xml new file mode 100644 index 000000000000..df90b41cf905 --- /dev/null +++ b/sys-firmware/nvidia-firmware/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="person"> + <email>idl0r@gentoo.org</email> + <name>Christian Ruppert</name> + </maintainer> +</pkgmetadata> diff --git a/sys-firmware/nvidia-firmware/nvidia-firmware-340.32-r1.ebuild b/sys-firmware/nvidia-firmware/nvidia-firmware-340.32-r1.ebuild new file mode 100644 index 000000000000..2ee3c5cdbc89 --- /dev/null +++ b/sys-firmware/nvidia-firmware/nvidia-firmware-340.32-r1.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{13..14} ) + +inherit python-any-r1 unpacker + +NV_URI="http://us.download.nvidia.com/XFree86/" +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" + +FIRMWARE_REV="a0b9f9be0efad90cc84b8b2eaf587c3d7d350ea9" + +DESCRIPTION="Kernel and mesa firmware for nouveau (video accel and pgraph)" +HOMEPAGE="https://nouveau.freedesktop.org/wiki/VideoAcceleration/" +SRC_URI="${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run + https://raw.githubusercontent.com/envytools/firmware/${FIRMWARE_REV}/extract_firmware.py + -> nvidia_extract_firmware-${FIRMWARE_REV}.py" + +LICENSE="MIT NVIDIA-r2" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~x86" +RESTRICT="bindist mirror" + +BDEPEND="${PYTHON_DEPS}" + +S="${WORKDIR}" + +src_unpack() { + mkdir "${S}/${X86_NV_PACKAGE}" || die + cd "${S}/${X86_NV_PACKAGE}" || die + unpack_makeself "${X86_NV_PACKAGE}.run" +} + +src_compile() { + "${EPYTHON}" "${DISTDIR}/nvidia_extract_firmware-${FIRMWARE_REV}.py" \ + || die "Extracting firmwares failed" +} + +src_install() { + insinto /lib/firmware/nouveau + doins nv* vuc-* +} diff --git a/sys-firmware/raspberrypi-wifi-ucode/Manifest b/sys-firmware/raspberrypi-wifi-ucode/Manifest new file mode 100644 index 000000000000..e002548961e8 --- /dev/null +++ b/sys-firmware/raspberrypi-wifi-ucode/Manifest @@ -0,0 +1,2 @@ +DIST firmware-nonfree_20190114-1+rpt11.debian.tar.xz 2038892 BLAKE2B a2d66e637cd26928c23855f5369c13b83e25b6b4353c82e9a62cb14b010a8c1fda566f6d200e0e7a706c7fb140238082238b7af80fe1f75fe3f07c815fc0eb6a SHA512 5ba6783dc3f3903f20321571a1fb2e11d7781de6d49689c68e6e1f194dad9cdddec90abc94a32a130323b2c8f9839af387c46aee895caf30ffb2f6dfe6d95b7d +DIST firmware-nonfree_20221012-1~bpo11+1+rpt1.debian.tar.xz 1819844 BLAKE2B 3b8bea16b73b67f8467844c282f337ac4784a937a54e05b255d2bb7956a2ee10f6a4cdb619384e7d408df4d637d5a3e9b1a50bb260ac3afd22e23dee8177ed21 SHA512 ba25ea62096bcac853865ff28d0982c05c37a364e10e846984d14c30ae7441cfd0b35a7c6bf4bfeca5aa5b2321e582b8e7553cdf28dd919371227fb8550c541b diff --git a/sys-firmware/raspberrypi-wifi-ucode/metadata.xml b/sys-firmware/raspberrypi-wifi-ucode/metadata.xml new file mode 100644 index 000000000000..8c18bac0b4f6 --- /dev/null +++ b/sys-firmware/raspberrypi-wifi-ucode/metadata.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person" proxied="yes"> + <email>crabbedhaloablution@pm.me</email> + <name>Peter Alfredsen</name> + </maintainer> + <maintainer type="project" proxied="proxy"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <upstream> + <remote-id type="github">RPi-Distro/firmware-nonfree</remote-id> + </upstream> +</pkgmetadata> diff --git a/sys-firmware/raspberrypi-wifi-ucode/raspberrypi-wifi-ucode-20190114.1_p11.ebuild b/sys-firmware/raspberrypi-wifi-ucode/raspberrypi-wifi-ucode-20190114.1_p11.ebuild new file mode 100644 index 000000000000..ec573949e197 --- /dev/null +++ b/sys-firmware/raspberrypi-wifi-ucode/raspberrypi-wifi-ucode-20190114.1_p11.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="Most up-to-date uCode for the Broadcom wifi chips on Raspberry Pi SBCs" +HOMEPAGE="https://github.com/RPi-Distro/firmware-nonfree + https://archive.raspberrypi.org/debian/pool/main/f/firmware-nonfree" +MY_PN=firmware-nonfree +SRC_URI="https://archive.raspberrypi.org/debian/pool/main/f/${MY_PN}/${MY_PN}_$(ver_cut 1)-$(ver_cut 2)+rpt$(ver_cut 4).debian.tar.xz" +S="${WORKDIR}" + +LICENSE="Broadcom" +SLOT="0" +KEYWORDS="arm arm64" + +RDEPEND="!sys-kernel/linux-firmware[-savedconfig]" + +pkg_pretend() { + local -a BADFILES=() + local txt file + # /lib/firmware/brcm/brcmfmac434{30,36,55,56}-sdio.*.txt + # The above pattern works because the files we want to hit + # have names of the form: + # * /lib/firmware/brcm/brcmfmac43430-sdio.AP6212.txt + # * /lib/firmware/brcm/brcmfmac43430-sdio.Hampoo-D2D3_Vi8A1.txt + # * /lib/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt + # * /lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.txt + # * /lib/firmware/brcm/brcmfmac43455-sdio.MINIX-NEO Z83-4.txt + # * /lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,3-model-a-plus.txt + # * /lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt + # * /lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt + # While the files installed by raspberrypi-wifi-ucode have names + # of the form: + # * /lib/firmware/brcm/brcmfmac43430-sdio.txt + # * /lib/firmware/brcm/brcmfmac43436-sdio.txt + # * /lib/firmware/brcm/brcmfmac43455-sdio.txt + # * /lib/firmware/brcm/brcmfmac43456-sdio.txt + # So no overlap is assured. + for txt in "${EPREFIX}"/lib/firmware/brcm/brcmfmac434{30,36,55,56}-sdio.*.txt; do + [[ -e "${txt}" ]] && BADFILES+=( "${txt}" ) + done + + if [[ "${#BADFILES[@]}" -gt 1 ]]; then + eerror "The following files should be excluded from the savedconfig of" + eerror "linux-firmware and linux-firmware should be re-emerged. Even" + eerror "though they do not collide with files from ${PN}," + eerror "they may be loaded preferentially to the files included in" + eerror "${PN}, leading to undefined behaviour." + eerror "List of files:" + for file in "${BADFILES[@]}"; do + eerror "${file}" + done + fi +} + +src_prepare() { + default + eapply -p1 debian/patches/sdio-txt-files.patch +} + +src_install() { + insinto /lib/firmware/brcm + doins brcm/* + dodoc debian/changelog +} diff --git a/sys-firmware/raspberrypi-wifi-ucode/raspberrypi-wifi-ucode-20221012.1_p1.ebuild b/sys-firmware/raspberrypi-wifi-ucode/raspberrypi-wifi-ucode-20221012.1_p1.ebuild new file mode 100644 index 000000000000..c6d302db7925 --- /dev/null +++ b/sys-firmware/raspberrypi-wifi-ucode/raspberrypi-wifi-ucode-20221012.1_p1.ebuild @@ -0,0 +1,88 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Most up-to-date uCode for the Broadcom wifi chips on Raspberry Pi SBCs" +HOMEPAGE=" + https://github.com/RPi-Distro/firmware-nonfree + https://archive.raspberrypi.org/debian/pool/main/f/firmware-nonfree" +MY_PN=firmware-nonfree +SRC_URI="https://archive.raspberrypi.org/debian/pool/main/f/${MY_PN}/${MY_PN}_$(ver_cut 1)-$(ver_cut 2)~bpo11+1+rpt$(ver_cut 4).debian.tar.xz" +S="${WORKDIR}" + +LICENSE="Broadcom" +SLOT="0" +KEYWORDS="arm arm64" + +RDEPEND=" + net-wireless/wireless-regdb + !sys-kernel/linux-firmware[-savedconfig] +" + +pkg_pretend() { + local -a BADFILES=() + local txt file + # /lib/firmware/brcm/brcmfmac434{30,36,55,56}-sdio.*.txt + # The above pattern works because the files we want to hit + # have names of the form: + # * /lib/firmware/brcm/brcmfmac43430-sdio.AP6212.txt + # * /lib/firmware/brcm/brcmfmac43430-sdio.Hampoo-D2D3_Vi8A1.txt + # * /lib/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt + # * /lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.txt + # * /lib/firmware/brcm/brcmfmac43455-sdio.MINIX-NEO Z83-4.txt + # * /lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,3-model-a-plus.txt + # * /lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt + # * /lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt + # While the files installed by raspberrypi-wifi-ucode have names + # of the form: + # * /lib/firmware/brcm/brcmfmac43430-sdio.txt + # * /lib/firmware/brcm/brcmfmac43436-sdio.txt + # * /lib/firmware/brcm/brcmfmac43455-sdio.txt + # * /lib/firmware/brcm/brcmfmac43456-sdio.txt + # So no overlap is assured. + for txt in "${EPREFIX}"/lib/firmware/brcm/brcmfmac434{30,36,55,56}-sdio.*.txt; do + [[ -e "${txt}" ]] && BADFILES+=( "${txt}" ) + done + + if [[ "${#BADFILES[@]}" -gt 1 ]]; then + eerror "The following files should be excluded from the savedconfig of" + eerror "linux-firmware and linux-firmware should be re-emerged. Even" + eerror "though they do not collide with files from ${PN}," + eerror "they may be loaded preferentially to the files included in" + eerror "${PN}, leading to undefined behaviour." + eerror "List of files:" + for file in "${BADFILES[@]}"; do + eerror "${file}" + done + fi +} + +src_configure() { + unlink "${S}"/debian/config/brcm80211/brcm/brcmfmac43455-sdio.bin || die + ln -rs \ + "${S}"/debian/config/brcm80211/cypress/cyfmac43455-sdio-standard.bin \ + "${S}"/debian/config/brcm80211/brcm/brcmfmac43455-sdio.bin || die + + ln -frs \ + "${S}"/debian/config/brcm80211/cypress/cyfmac43455-sdio-standard.bin \ + "${S}"/debian/config/brcm80211/brcm/brcmfmac43455-sdio.raspberrypi,3-model-a-plus.bin + + ln -frs \ + "${S}"/debian/config/brcm80211/cypress/cyfmac43455-sdio-standard.bin \ + "${S}"/debian/config/brcm80211/brcm/brcmfmac43455-sdio.raspberrypi,3-model-b-plus.bin + + ln -frs \ + "${S}"/debian/config/brcm80211/cypress/cyfmac43455-sdio-standard.bin \ + "${S}"/debian/config/brcm80211/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.bin +} + +src_install() { + insinto /lib/firmware/brcm + doins debian/config/brcm80211/brcm/* + + insinto /lib/firmware/cypress + doins debian/config/brcm80211/cypress/* + + dodoc debian/changelog +} diff --git a/sys-firmware/seabios-bin/Manifest b/sys-firmware/seabios-bin/Manifest new file mode 100644 index 000000000000..7f0af17450b6 --- /dev/null +++ b/sys-firmware/seabios-bin/Manifest @@ -0,0 +1,2 @@ +DIST seabios-1.16.0-1.xpak 141506 BLAKE2B b2d0cc367ea7ba958604f95dc2a7ab92fd76768e6133552b76d651755cab225eed3e1a6bd350b7f3b5058212390c073e9ca37896412797ac224fb1ce4b5f641a SHA512 4007a6cd40b7c82d1f53450a4151a19d5020ca4c3258b4502f9bfb1c3eacfef1a934794b58d38439e41884cd7a962aa436e22b9194b5731585383fd1476dd688 +DIST seabios-1.16.3-1.xpak 143051 BLAKE2B 0cc2d6e3506475d60134be83a886eee87c4ab7c7b4dc3d285850f8e51c44d00658712d1fbecf7b3776ed7549cb6feace901a32349206962ef94001a211533e29 SHA512 596f060371903d4365b02accd128257d0223bf37368f58565b94c32d5f1da3469b3b33ac0193397071d27d2889a8c3a36668d03fcdd56bea23dd249956cc288e 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..7afd1bd8f555 --- /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 ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 ~sparc x86" + +RDEPEND="!sys-firmware/seabios" + +src_unpack() { + tar -xf - < <(xz -c -d --single-stream "${DISTDIR}/${BINPKG}.xpak") || die "unpacking binpkg failed" +} + +src_install() { + mv usr "${ED}" || die +} diff --git a/sys-firmware/seabios-bin/seabios-bin-1.16.3.ebuild b/sys-firmware/seabios-bin/seabios-bin-1.16.3.ebuild new file mode 100644 index 000000000000..8c2d6ce929f3 --- /dev/null +++ b/sys-firmware/seabios-bin/seabios-bin-1.16.3.ebuild @@ -0,0 +1,25 @@ +# Copyright 1999-2025 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/~chewi/distfiles/${BINPKG}.xpak" +S="${WORKDIR}" + +LICENSE="LGPL-3 GPL-3" +SLOT="0" +KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 ~sparc x86" + +RDEPEND="!sys-firmware/seabios" + +src_unpack() { + tar -xf - < <(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 new file mode 100644 index 000000000000..d73567031f2f --- /dev/null +++ b/sys-firmware/seabios/Manifest @@ -0,0 +1 @@ +DIST seabios-1.16.3.tar.gz 637076 BLAKE2B 8b7c574bf8b0d3b02ea3127dabacda5ddc39c159f17a3a474b76ca79f3ec637ed5571f0d485712b5f9dc68d46db5b2b2c1e018ff63ae0206ca6354bccb714c6c SHA512 103aac0a7a890a681edb8950fee72d419899e20e8b06e2dd382987f98d3faf362789fca5aa4efabe27c4720e53ee19e0ae246d7aca2482b6661fa119efac648c diff --git a/sys-firmware/seabios/files/seabios/config.seabios-128k b/sys-firmware/seabios/files/seabios/config.seabios-128k new file mode 100644 index 000000000000..50dd75d5f303 --- /dev/null +++ b/sys-firmware/seabios/files/seabios/config.seabios-128k @@ -0,0 +1,16 @@ +# for qemu machine types 1.7 + older +# need to turn off features (xhci,uas,achi,nvme,acpi_parse) to make it fit into 128k +CONFIG_QEMU=y +CONFIG_ROM_SIZE=128 +CONFIG_BOOTSPLASH=n +CONFIG_XEN=n +CONFIG_USB_OHCI=n +CONFIG_USB_XHCI=n +CONFIG_USB_UAS=n +CONFIG_SDCARD=n +CONFIG_TCGBIOS=n +CONFIG_MPT_SCSI=n +CONFIG_ACPI_PARSE=n +CONFIG_NVME=n +CONFIG_AHCI=n +CONFIG_THREADS=n diff --git a/sys-firmware/seabios/files/seabios/config.seabios-256k b/sys-firmware/seabios/files/seabios/config.seabios-256k new file mode 100644 index 000000000000..65e5015c2f14 --- /dev/null +++ b/sys-firmware/seabios/files/seabios/config.seabios-256k @@ -0,0 +1,3 @@ +# for qemu machine types 2.0 + newer +CONFIG_QEMU=y +CONFIG_ROM_SIZE=256 diff --git a/sys-firmware/seabios/files/seavgabios/config.vga-cirrus b/sys-firmware/seabios/files/seavgabios/config.vga-cirrus new file mode 100644 index 000000000000..c8fe58239f84 --- /dev/null +++ b/sys-firmware/seabios/files/seavgabios/config.vga-cirrus @@ -0,0 +1,3 @@ +CONFIG_BUILD_VGABIOS=y +CONFIG_VGA_CIRRUS=y +CONFIG_VGA_PCI=y diff --git a/sys-firmware/seabios/files/seavgabios/config.vga-isavga b/sys-firmware/seabios/files/seavgabios/config.vga-isavga new file mode 100644 index 000000000000..e55e294a0c0a --- /dev/null +++ b/sys-firmware/seabios/files/seavgabios/config.vga-isavga @@ -0,0 +1,3 @@ +CONFIG_BUILD_VGABIOS=y +CONFIG_VGA_BOCHS=y +CONFIG_VGA_PCI=n diff --git a/sys-firmware/seabios/files/seavgabios/config.vga-qxl b/sys-firmware/seabios/files/seavgabios/config.vga-qxl new file mode 100644 index 000000000000..d393f0c34fd2 --- /dev/null +++ b/sys-firmware/seabios/files/seavgabios/config.vga-qxl @@ -0,0 +1,6 @@ +CONFIG_BUILD_VGABIOS=y +CONFIG_VGA_BOCHS=y +CONFIG_VGA_PCI=y +CONFIG_OVERRIDE_PCI_ID=y +CONFIG_VGA_VID=0x1b36 +CONFIG_VGA_DID=0x0100 diff --git a/sys-firmware/seabios/files/seavgabios/config.vga-stdvga b/sys-firmware/seabios/files/seavgabios/config.vga-stdvga new file mode 100644 index 000000000000..7d063b787cd9 --- /dev/null +++ b/sys-firmware/seabios/files/seavgabios/config.vga-stdvga @@ -0,0 +1,3 @@ +CONFIG_BUILD_VGABIOS=y +CONFIG_VGA_BOCHS=y +CONFIG_VGA_PCI=y diff --git a/sys-firmware/seabios/files/seavgabios/config.vga-virtio b/sys-firmware/seabios/files/seavgabios/config.vga-virtio new file mode 100644 index 000000000000..aa7a15ba1172 --- /dev/null +++ b/sys-firmware/seabios/files/seavgabios/config.vga-virtio @@ -0,0 +1,6 @@ +CONFIG_BUILD_VGABIOS=y +CONFIG_VGA_BOCHS=y +CONFIG_VGA_PCI=y +CONFIG_OVERRIDE_PCI_ID=y +CONFIG_VGA_VID=0x1af4 +CONFIG_VGA_DID=0x1050 diff --git a/sys-firmware/seabios/files/seavgabios/config.vga-vmware b/sys-firmware/seabios/files/seavgabios/config.vga-vmware new file mode 100644 index 000000000000..eb10427afdd3 --- /dev/null +++ b/sys-firmware/seabios/files/seavgabios/config.vga-vmware @@ -0,0 +1,6 @@ +CONFIG_BUILD_VGABIOS=y +CONFIG_VGA_BOCHS=y +CONFIG_VGA_PCI=y +CONFIG_OVERRIDE_PCI_ID=y +CONFIG_VGA_VID=0x15ad +CONFIG_VGA_DID=0x0405 diff --git a/sys-firmware/seabios/metadata.xml b/sys-firmware/seabios/metadata.xml new file mode 100644 index 000000000000..9f147518b5de --- /dev/null +++ b/sys-firmware/seabios/metadata.xml @@ -0,0 +1,11 @@ +<?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> + <use> + <flag name="seavgabios">Include SeaVGABIOS binaries (replacement for vgabios)</flag> + </use> +</pkgmetadata> diff --git a/sys-firmware/seabios/seabios-1.16.3.ebuild b/sys-firmware/seabios/seabios-1.16.3.ebuild new file mode 100644 index 000000000000..d9c9489835c2 --- /dev/null +++ b/sys-firmware/seabios/seabios-1.16.3.ebuild @@ -0,0 +1,148 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{13..14} ) + +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-devel/gcc:* + >=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 may cause subtle" + ewarn "failures at runtime. Please try sys-firmware/seabios-bin before" + ewarn "requesting support from Gentoo or upstream." + + 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 + + # Force gcc because build failed with clang, #887115 + if ! tc-is-gcc ; then + ewarn "seabios can be built with gcc only." + ewarn "Ignoring CC=$(tc-getCC) and forcing ${CHOST}-gcc" + export CC=${CHOST}-gcc + export CXX=${CHOST}-g++ + tc-is-gcc || die "tc-is-gcc failed in spite of CC=${CC}" + fi +} + +src_configure() { + tc-ld-force-bfd #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 +} diff --git a/sys-firmware/sgabios/Manifest b/sys-firmware/sgabios/Manifest new file mode 100644 index 000000000000..ff7364727fc6 --- /dev/null +++ b/sys-firmware/sgabios/Manifest @@ -0,0 +1,2 @@ +DIST sgabios-0.1_pre10-bin.tar.xz 2652 BLAKE2B 6dff0152f8553c245796badfd291e0e79f2a6a935a9908d9825dbac760746c05265b7f12a29a2d1fa1b95d16291ca5723fbf2f53b5bb04ff416e64b9c66b0c7d SHA512 6dd43858e91bee57bc0bc6d721eb26abb30bbe8b9c30733b39f3612cdf0dddd9ad8876518a4457a68a48d8a4b911225635c0e8eef1a7e78cfe65c8fcf0af2bab +DIST sgabios-0.1_pre10.tar.gz 31086 BLAKE2B f9577d0009d90c46aa5963e6dea50be4b7ec4b5c597194b33256748adbc4d60b3ac50646ce80befbd6d810ba80e93048fd6234b4d320d15f3506087435ec346c SHA512 cf12a8b8579658c99a3ad8c325637dba1569d364fc5440caf33c85a4f0403d83cf755df61d068151191c75588d568da629329a93d731f49b0b9131c983141fe6 diff --git a/sys-firmware/sgabios/metadata.xml b/sys-firmware/sgabios/metadata.xml new file mode 100644 index 000000000000..77afbab930d5 --- /dev/null +++ b/sys-firmware/sgabios/metadata.xml @@ -0,0 +1,11 @@ +<?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> + <use> + <flag name="binary">Use pre-built binaries</flag> + </use> +</pkgmetadata> diff --git a/sys-firmware/sgabios/sgabios-0.1_pre10.ebuild b/sys-firmware/sgabios/sgabios-0.1_pre10.ebuild new file mode 100644 index 000000000000..d46f8af2bb7b --- /dev/null +++ b/sys-firmware/sgabios/sgabios-0.1_pre10.ebuild @@ -0,0 +1,42 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit toolchain-funcs + +DESCRIPTION="serial graphics adapter bios option rom for x86" +HOMEPAGE="https://code.google.com/p/sgabios/" +# downloaded from +# https://git.qemu.org/?p=sgabios.git;a=tree;h=a85446adb0e07ccd5211619a6f215bcfc3c5ab29;hb=23d474943dcd55d0550a3d20b3d30e9040a4f15b +SRC_URI="mirror://gentoo/${P}.tar.gz + !binary? ( https://dev.gentoo.org/~tamiko/distfiles/${P}.tar.gz ) + binary? ( https://dev.gentoo.org/~tamiko/distfiles/${P}-bin.tar.xz )" +S="${WORKDIR}/sgabios-a85446a" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 ~sparc x86" +IUSE="+binary" +REQUIRED_USE="!amd64? ( !x86? ( binary ) )" + +src_compile() { + use binary && return + + tc-ld-disable-gold + tc-export_build_env BUILD_CC + emake -j1 \ + BUILD_CC="${BUILD_CC}" \ + BUILD_CFLAGS="${BUILD_CFLAGS}" \ + BUILD_LDFLAGS="${BUILD_LDFLAGS}" \ + BUILD_CPPFLAGS="${BUILD_CPPFLAGS}" \ + CC="$(tc-getCC)" \ + LD="$(tc-getLD)" \ + AR="$(tc-getAR)" \ + OBJCOPY="$(tc-getOBJCOPY)" +} + +src_install() { + insinto /usr/share/sgabios + doins sgabios.bin +} diff --git a/sys-firmware/sigrok-firmware-fx2lafw/Manifest b/sys-firmware/sigrok-firmware-fx2lafw/Manifest new file mode 100644 index 000000000000..6bfe7ff8ed7f --- /dev/null +++ b/sys-firmware/sigrok-firmware-fx2lafw/Manifest @@ -0,0 +1,3 @@ +DIST sigrok-firmware-fx2lafw-0.1.7-update-syntax.patch.xz 3668 BLAKE2B 969607c030b5a9076fb2b9598886714a2243ec642f34c63e92ddd1f4f5b8d315755ed093f30158d363aae857f096f060ea8ad7cde5e61d99c2db99de373877de SHA512 5bb124c4f60dc1b574b987605c8f5c4a10826127569d315df378510ba6977d11466761991894834ec05212799c8cae30f34d37419f5fac89d1570451b690a548 +DIST sigrok-firmware-fx2lafw-0.1.7.tar.gz 145443 BLAKE2B 6e19fde87caf942ca8f95a67f5ba5553e2044e9ba43ca81f6b7be69f4a75ca25e946edf80d0f4ddf7d361f98aff68e9a0d950070fbca24423c908fbc70155ae9 SHA512 e9973980b07cef395637476c6294473e349770be24afe6b03d284bf3057f6b32fe686e25f3baa180b96455397db43e16f191a9feb07bf46e097170fb4d326f8e +DIST sigrok-firmware-fx2lafw-bin-0.1.7.tar.gz 54529 BLAKE2B b8659ba77f6976a927bd60c903abbc7bf7128d4dfff8a58dfe1f6522c6f7d5e5c0f8c8bc170fef7499461426ab1059093c4cc1553a39f4a059786cfc144f787f SHA512 60faac29198532bd5e03e44ed7f89c1502c83c6cf60ec5cc0f3ae9891c45b5de55eba5304c47d3231c8222ff61f1425aed88a44e7ff89d30b75d6e5faf7a623c diff --git a/sys-firmware/sigrok-firmware-fx2lafw/metadata.xml b/sys-firmware/sigrok-firmware-fx2lafw/metadata.xml new file mode 100644 index 000000000000..40d1c81e2ee8 --- /dev/null +++ b/sys-firmware/sigrok-firmware-fx2lafw/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="project"> + <email>embedded@gentoo.org</email> + <name>Embedded Gentoo</name> +</maintainer> +<use> + <flag name="binary">Use official upstream pre-built binaries</flag> +</use> +</pkgmetadata> diff --git a/sys-firmware/sigrok-firmware-fx2lafw/sigrok-firmware-fx2lafw-0.1.7-r2.ebuild b/sys-firmware/sigrok-firmware-fx2lafw/sigrok-firmware-fx2lafw-0.1.7-r2.ebuild new file mode 100644 index 000000000000..01cca2052b76 --- /dev/null +++ b/sys-firmware/sigrok-firmware-fx2lafw/sigrok-firmware-fx2lafw-0.1.7-r2.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="8" + +SDCC_DEPEND=">=dev-embedded/sdcc-3.4.0[device-lib(+),mcs51(+),sdcpp(+)]" + +if [[ ${PV} == "9999" ]]; then + EGIT_REPO_URI="https://github.com/sigrokproject/${PN}.git" + inherit git-r3 autotools +else + SRC_URI=" + binary? ( https://sigrok.org/download/binary/${PN}/${PN}-bin-${PV}.tar.gz ) + !binary? ( + https://sigrok.org/download/source/${PN}/${P}.tar.gz + https://distfiles.gentoo.org/pub/dev/ceamac@gentoo.org/${CATEGORY}/${PN}/${P}-update-syntax.patch.xz + ) + " + KEYWORDS="~amd64 ~x86" + IUSE="binary" + SDCC_DEPEND="!binary? ( ${SDCC_DEPEND} )" +fi + +DESCRIPTION="Firmware for Cypress FX2 chips for use as simple logic analyzer hardware" +HOMEPAGE="https://sigrok.org/wiki/Fx2lafw" + +LICENSE="GPL-2+" +SLOT="0" + +DEPEND="${SDCC_DEPEND}" + +PATCHES=() + +src_unpack() { + if [[ ${PV} == "9999" ]]; then + git-r3_src_unpack + else + default + if use binary; then + # The binary & source dirs are slightly diff. + S="${WORKDIR}/${PN}-bin-${PV}" + else + PATCHES+=( + "${WORKDIR}"/${P}-update-syntax.patch + ) + fi + fi +} + +src_prepare() { + [[ ${PV} == "9999" ]] && eautoreconf + default +} + +src_install() { + if [[ ${PV} != "9999" ]] && use binary ; then + insinto /usr/share/sigrok-firmware + doins *.fw + dodoc ChangeLog NEWS README + else + default + fi +} diff --git a/sys-firmware/sigrok-firmware-fx2lafw/sigrok-firmware-fx2lafw-9999.ebuild b/sys-firmware/sigrok-firmware-fx2lafw/sigrok-firmware-fx2lafw-9999.ebuild new file mode 100644 index 000000000000..4f9e5da84cf4 --- /dev/null +++ b/sys-firmware/sigrok-firmware-fx2lafw/sigrok-firmware-fx2lafw-9999.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="8" + +SDCC_DEPEND=">=dev-embedded/sdcc-3.4.0[device-lib(+),mcs51(+),sdcpp(+)]" + +if [[ ${PV} == "9999" ]]; then + EGIT_REPO_URI="https://github.com/sigrokproject/${PN}.git" + inherit git-r3 autotools +else + SRC_URI=" + binary? ( https://sigrok.org/download/binary/${PN}/${PN}-bin-${PV}.tar.gz ) + !binary? ( + https://sigrok.org/download/source/${PN}/${P}.tar.gz + https://dev.gentoo.org/~ceamac/${CATEGORY}/${PN}/${P}-update-syntax.patch.xz + ) + " + KEYWORDS="~amd64 ~x86" + IUSE="binary" + SDCC_DEPEND="!binary? ( ${SDCC_DEPEND} )" +fi + +DESCRIPTION="Firmware for Cypress FX2 chips for use as simple logic analyzer hardware" +HOMEPAGE="https://sigrok.org/wiki/Fx2lafw" + +LICENSE="GPL-2+" +SLOT="0" + +DEPEND="${SDCC_DEPEND}" + +PATCHES=() + +src_unpack() { + if [[ ${PV} == "9999" ]]; then + git-r3_src_unpack + else + default + if use binary; then + # The binary & source dirs are slightly diff. + S="${WORKDIR}/${PN}-bin-${PV}" + else + PATCHES+=( + "${WORKDIR}"/${P}-update-syntax.patch + ) + fi + fi +} + +src_prepare() { + [[ ${PV} == "9999" ]] && eautoreconf + default +} + +src_install() { + if [[ ${PV} != "9999" ]] && use binary ; then + insinto /usr/share/sigrok-firmware + doins *.fw + dodoc ChangeLog NEWS README + else + default + fi +} diff --git a/sys-firmware/sof-firmware/Manifest b/sys-firmware/sof-firmware/Manifest new file mode 100644 index 000000000000..8e5ec0feb853 --- /dev/null +++ b/sys-firmware/sof-firmware/Manifest @@ -0,0 +1,3 @@ +DIST sof-firmware-2025.12.1.tar.gz 13486538 BLAKE2B f791dccb488ae3a1db26e39d149d0a51b68c200943ef35d2f40a59c0e17a4bc7bcaea5f54195ccc6cd9574371aceb07a394a1869efe1bdfd418d938283f8e7b8 SHA512 78885d29720dbf2b54999e3ac4dc4124ac0f6fc466cd51bdfff3ae93dcd796a99e96fe3ea7d997f32e9b85936780c1ad04565002244024d92731a68c889c2087 +DIST sof-firmware-2025.12.2.tar.gz 13486442 BLAKE2B 284584e043404a65bbc2f04fcd78e9db4b1e844343a5fe1fd463e1021e92e7dcddbf8e5a8b620ca1e25d77a2469dec1804a0bafea02d3bcbfe175f64a92816a1 SHA512 5eb64665c2cb87967ff2aa81f7d39397dc6e813abea531e89c12bb5c0a15821e7cbfd8c485af196e37984c1cdf9ac72c93f9feea1205d9d71736d163f5af0084 +DIST sof-firmware-2025.12.tar.gz 13398826 BLAKE2B 935f909e4b5ab9fed3424767b660e7ac3b96e121f23d2b52d0b0f24e82877e1acbd54fce530861f43bf01b1b0343874959a0e75c712440c15bc761b3d9d643f2 SHA512 f77c47a401e68e3edb29b281efbfe97505b9ae4c188ea09ccd2855aaced4976631160885df8ce50cf83550bdfdc2bc7489cfee3ed6d9cd63563bbf3d0be8f661 diff --git a/sys-firmware/sof-firmware/metadata.xml b/sys-firmware/sof-firmware/metadata.xml new file mode 100644 index 000000000000..d217e2814282 --- /dev/null +++ b/sys-firmware/sof-firmware/metadata.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>pacho@gentoo.org</email> + </maintainer> + <use> + <flag name="tools">Tools to interact with sof firmwares (upstream expects them to be present, but allow to skip them for systems not able to install needed dependencies)</flag> + </use> + <upstream> + <remote-id type="github">thesofproject/sof</remote-id> + </upstream> +</pkgmetadata> diff --git a/sys-firmware/sof-firmware/sof-firmware-2025.12.1.ebuild b/sys-firmware/sof-firmware/sof-firmware-2025.12.1.ebuild new file mode 100644 index 000000000000..5bd47e5655f4 --- /dev/null +++ b/sys-firmware/sof-firmware/sof-firmware-2025.12.1.ebuild @@ -0,0 +1,45 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Sound Open Firmware (SOF) binary files" +HOMEPAGE="https://www.sofproject.org https://github.com/thesofproject/sof https://github.com/thesofproject/sof-bin" +SRC_URI="https://github.com/thesofproject/sof-bin/releases/download/v${PV}/sof-bin-${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}"/sof-bin-${PV} + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64" +IUSE="tools" + +RDEPEND=" + tools? ( + media-libs/alsa-lib + sys-libs/glibc + ) +" + +QA_PREBUILT="usr/bin/sof-ctl + usr/bin/sof-logger + usr/bin/sof-probes" + +src_install() { + dodir /lib/firmware/intel + dodir /usr/bin + FW_DEST="${D}/lib/firmware/intel" TOOLS_DEST="${D}/usr/bin" "${S}/install.sh" || die + + # Drop tools if requested (i.e. useful for musl systems, where glibc + # is not available) + if ! use tools ; then + rm -rv "${D}"/usr/bin || die + fi +} + +pkg_preinst() { + # Fix sof-ace-tplg directory symlink collisions + local sofpath="${EROOT}/lib/firmware/intel/sof-ace-tplg" + if [[ ! -L "${sofpath}" && -d "${sofpath}" ]] ; then + rm -r "${sofpath}" || die + fi +} diff --git a/sys-firmware/sof-firmware/sof-firmware-2025.12.2.ebuild b/sys-firmware/sof-firmware/sof-firmware-2025.12.2.ebuild new file mode 100644 index 000000000000..11ee0ca3e520 --- /dev/null +++ b/sys-firmware/sof-firmware/sof-firmware-2025.12.2.ebuild @@ -0,0 +1,45 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Sound Open Firmware (SOF) binary files" +HOMEPAGE="https://www.sofproject.org https://github.com/thesofproject/sof https://github.com/thesofproject/sof-bin" +SRC_URI="https://github.com/thesofproject/sof-bin/releases/download/v${PV}/sof-bin-${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}"/sof-bin-${PV} + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="tools" + +RDEPEND=" + tools? ( + media-libs/alsa-lib + sys-libs/glibc + ) +" + +QA_PREBUILT="usr/bin/sof-ctl + usr/bin/sof-logger + usr/bin/sof-probes" + +src_install() { + dodir /lib/firmware/intel + dodir /usr/bin + FW_DEST="${D}/lib/firmware/intel" TOOLS_DEST="${D}/usr/bin" "${S}/install.sh" || die + + # Drop tools if requested (i.e. useful for musl systems, where glibc + # is not available) + if ! use tools ; then + rm -rv "${D}"/usr/bin || die + fi +} + +pkg_preinst() { + # Fix sof-ace-tplg directory symlink collisions + local sofpath="${EROOT}/lib/firmware/intel/sof-ace-tplg" + if [[ ! -L "${sofpath}" && -d "${sofpath}" ]] ; then + rm -r "${sofpath}" || die + fi +} diff --git a/sys-firmware/sof-firmware/sof-firmware-2025.12.ebuild b/sys-firmware/sof-firmware/sof-firmware-2025.12.ebuild new file mode 100644 index 000000000000..40a085cc2e66 --- /dev/null +++ b/sys-firmware/sof-firmware/sof-firmware-2025.12.ebuild @@ -0,0 +1,45 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Sound Open Firmware (SOF) binary files" +HOMEPAGE="https://www.sofproject.org https://github.com/thesofproject/sof https://github.com/thesofproject/sof-bin" +SRC_URI="https://github.com/thesofproject/sof-bin/releases/download/v${PV}/sof-bin-${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}"/sof-bin-${PV} + +LICENSE="BSD" +SLOT="0" +KEYWORDS="amd64" +IUSE="tools" + +RDEPEND=" + tools? ( + media-libs/alsa-lib + sys-libs/glibc + ) +" + +QA_PREBUILT="usr/bin/sof-ctl + usr/bin/sof-logger + usr/bin/sof-probes" + +src_install() { + dodir /lib/firmware/intel + dodir /usr/bin + FW_DEST="${D}/lib/firmware/intel" TOOLS_DEST="${D}/usr/bin" "${S}/install.sh" || die + + # Drop tools if requested (i.e. useful for musl systems, where glibc + # is not available) + if ! use tools ; then + rm -rv "${D}"/usr/bin || die + fi +} + +pkg_preinst() { + # Fix sof-ace-tplg directory symlink collisions + local sofpath="${EROOT}/lib/firmware/intel/sof-ace-tplg" + if [[ ! -L "${sofpath}" && -d "${sofpath}" ]] ; then + rm -r "${sofpath}" || die + fi +} diff --git a/sys-firmware/tt-s2-6400-firmware/Manifest b/sys-firmware/tt-s2-6400-firmware/Manifest new file mode 100644 index 000000000000..5ebe5d6c0506 --- /dev/null +++ b/sys-firmware/tt-s2-6400-firmware/Manifest @@ -0,0 +1,3 @@ +DIST dvb-ttpremium-fpga-01_v1_10.zip 90791 BLAKE2B 2b7815138ab795eea9c29fc9d80a34d7a7ffecec8dc7788a584bfbcc439ba9efabb33b7dcfe3228ba9dc04233c26a1bdcb82bdf70bed1fc74046fcf3b2bcc839 SHA512 7083a14a25945c7b310830cb3508e9c1e3922944fa3e778588ecf6dc6faa02aca2c8e6bf4c40db632a268324a936dce20ae26563fd195a5c8e1b29446f21c97c +DIST dvb-ttpremium-loader-01_v1_03.zip 9841 BLAKE2B 2b1f1b52953f02668b15bcd6d330edbf955d96c9296af4af7a49d862c813dc703efd4d2534a2f96435cdc02c87ae6ed2b31d8258cb79bdde3f86915f0f59f979 SHA512 d0fddfeadbf1f5bc06538033ea4b69ecc6a34e1b3a8239df93c347f7882ac6b7ee8b44eaef3eaff15c81bb084e3f985f8504d68edb83479e149d904fb97e2ce3 +DIST dvb-ttpremium-st7109-01_v0_5_1.zip 2075442 BLAKE2B e5695e1550b94ee89023a72b1fbb43c7a0c01e0705fa86129886e4bf8cd658f2094b5c5b890d25cae46c8a71ba9c93b0c5dd83352dae555317b8fd5e003d1d94 SHA512 8d209793201065914f4314dd4f3978ab100d93ce6abe589411b6e9bd3dc064702d3835696834e192c2aa432213d4d4be6ccbde9140faa10d7e8a16ca4909feb9 diff --git a/sys-firmware/tt-s2-6400-firmware/metadata.xml b/sys-firmware/tt-s2-6400-firmware/metadata.xml new file mode 100644 index 000000000000..2b167a7461de --- /dev/null +++ b/sys-firmware/tt-s2-6400-firmware/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>vdr@gentoo.org</email> + <name>Gentoo VDR Project</name> + </maintainer> +</pkgmetadata> diff --git a/sys-firmware/tt-s2-6400-firmware/tt-s2-6400-firmware-0.5.1.ebuild b/sys-firmware/tt-s2-6400-firmware/tt-s2-6400-firmware-0.5.1.ebuild new file mode 100644 index 000000000000..4bc0c801db6d --- /dev/null +++ b/sys-firmware/tt-s2-6400-firmware/tt-s2-6400-firmware-0.5.1.ebuild @@ -0,0 +1,23 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Firmware for the Technotrend S2-6400 DVB Card" +HOMEPAGE="http://www.aregel.de/" +SRC_URI="http://www.aregel.de/file_download/28/dvb-ttpremium-st7109-01_v0_5_1.zip + http://www.aregel.de/file_download/26/dvb-ttpremium-fpga-01_v1_10.zip + http://www.aregel.de/file_download/7/dvb-ttpremium-loader-01_v1_03.zip" +S="${WORKDIR}" + +LICENSE="all-rights-reserved" +SLOT="0" +KEYWORDS="amd64 x86" +RESTRICT="mirror bindist" + +BDEPEND="app-arch/unzip" + +src_install() { + insinto /lib/firmware + doins dvb-ttpremium-fpga-01.fw dvb-ttpremium-loader-01.fw dvb-ttpremium-st7109-01.fw +} diff --git a/sys-firmware/vgabios/Manifest b/sys-firmware/vgabios/Manifest new file mode 100644 index 000000000000..81497e77a254 --- /dev/null +++ b/sys-firmware/vgabios/Manifest @@ -0,0 +1,3 @@ +DIST vgabios-0.7a-fixes-1.tar.bz2 2602 BLAKE2B 68fbd29e6c660dc69ea110e00ff75fc9d14f10bd11b9be89bd373281852a3133c73ee0f2a7ecdf026b29979e4c20bcdbad0baf9f80d013ffeb24dda892725778 SHA512 30992efac011d4b99301960df08cdc69d9503aa6b61feed01fca2c5a910460269d9500650cb394a0737318e977a282c5e0ab613a8b2bc28b9f0c6528a9a77d73 +DIST vgabios-0.7a.tgz 1506655 BLAKE2B fb9b99ab385423b4ef103a56de140591556d2f49fffebfdd508a462551b1a9def9d8dc50c947a88ef6d47c43ff62dbe3d97fef969d985c49b9e78671eaefd34e SHA512 35d789b1b39f8f05b757b6c3379a1b2c33dc27b244720471530325f3e215b5f4fa97cfbfc131f813013f4640fe85be912e7b4cb924fa87ed35e68b6966424874 +DIST vgabios-0.8a.tgz 174452 BLAKE2B b8c63d0375a2d08b5e0d55e25844ed8c09066ee3a3582d6be8de84fdac98b59b86e2db764f5b01e29703bf188cee631b84d3807678b2f8452f87b590d06bbf3a SHA512 bc0028ec9ed39659a65b1135d3803a1d1b48a4e2e6622d87a9c85f0c5099bb69602ad51c38f9915420554bce41599d41ac8a333e0502bd17acaa9ee2db70b662 diff --git a/sys-firmware/vgabios/metadata.xml b/sys-firmware/vgabios/metadata.xml new file mode 100644 index 000000000000..521ac7ba70d2 --- /dev/null +++ b/sys-firmware/vgabios/metadata.xml @@ -0,0 +1,11 @@ +<?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> + <use> + <flag name="binary">Use official upstream pre-built binaries (only default and cirrus images)</flag> + </use> +</pkgmetadata> diff --git a/sys-firmware/vgabios/vgabios-0.8a-r1.ebuild b/sys-firmware/vgabios/vgabios-0.8a-r1.ebuild new file mode 100644 index 000000000000..e76020edbe79 --- /dev/null +++ b/sys-firmware/vgabios/vgabios-0.8a-r1.ebuild @@ -0,0 +1,41 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +DESCRIPTION="VGA BIOS implementation" +HOMEPAGE="https://www.nongnu.org/vgabios/" +SRC_URI="https://savannah.gnu.org/download/${PN}/${P}.tgz" + +LICENSE="LGPL-2.1+" +SLOT="0" +KEYWORDS="amd64 ~arm ~arm64 ~ppc ~ppc64 x86" +IUSE="binary debug" +BDEPEND="!binary? ( sys-devel/dev86 )" + +src_compile() { + if ! use binary ; then + emake clean # Necessary to clean up the pre-built pieces + emake biossums CC="$(tc-getCC)" + emake GCC="$(tc-getCC)" CC="$(tc-getCC)" + fi +} + +src_install() { + insinto /usr/share/vgabios + + # Stock VGABIOS + newins VGABIOS-lgpl-latest.bin vgabios.bin + use debug && newins VGABIOS-lgpl-latest.debug.bin vgabios.debug.bin + + # Cirrus + newins VGABIOS-lgpl-latest.cirrus.bin vgabios-cirrus.bin + use debug && newins VGABIOS-lgpl-latest.cirrus.debug.bin \ + vgabios-cirrus.debug.bin + + # Banshee + newins VGABIOS-lgpl-latest.banshee.bin vgabios-banshee.bin + +} diff --git a/sys-firmware/vgabios/vgabios-0.8a.ebuild b/sys-firmware/vgabios/vgabios-0.8a.ebuild new file mode 100644 index 000000000000..f29f45d6c17d --- /dev/null +++ b/sys-firmware/vgabios/vgabios-0.8a.ebuild @@ -0,0 +1,39 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="VGA BIOS implementation" +HOMEPAGE="http://www.nongnu.org/vgabios/" +SRC_URI="https://savannah.gnu.org/download/${PN}/${P}.tgz" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="amd64 ~arm ~arm64 ~ppc ~ppc64 x86" +IUSE="binary debug" +BDEPEND="!binary? ( sys-devel/dev86 )" + +src_compile() { + if ! use binary ; then + emake clean # Necessary to clean up the pre-built pieces + emake biossums + emake + fi +} + +src_install() { + insinto /usr/share/vgabios + + # Stock VGABIOS + newins VGABIOS-lgpl-latest.bin vgabios.bin + use debug && newins VGABIOS-lgpl-latest.debug.bin vgabios.debug.bin + + # Cirrus + newins VGABIOS-lgpl-latest.cirrus.bin vgabios-cirrus.bin + use debug && newins VGABIOS-lgpl-latest.cirrus.debug.bin \ + vgabios-cirrus.debug.bin + + # Banshee + newins VGABIOS-lgpl-latest.banshee.bin vgabios-banshee.bin + +} diff --git a/sys-firmware/zd1201-firmware/Manifest b/sys-firmware/zd1201-firmware/Manifest new file mode 100644 index 000000000000..5b90e96c0a20 --- /dev/null +++ b/sys-firmware/zd1201-firmware/Manifest @@ -0,0 +1 @@ +DIST zd1201-0.14-fw.tar.gz 86538 BLAKE2B e7ea06cd2da0cf010b86546f3bc24011f4c7731ef439bf490478a59ddf849dff1d53e753e735040cf41bd9f4cacb3def1bae59d78326b14821fe8b2b6c9fea51 SHA512 4143966d386029d50b0cf54bb40f0636daac8f4696782f2cd7ec8924b80ed5d889b373817c662000fbbc8010d4bc81864d2381dd7e2242bf9cee0e0fb9d56fe9 diff --git a/sys-firmware/zd1201-firmware/metadata.xml b/sys-firmware/zd1201-firmware/metadata.xml new file mode 100644 index 000000000000..6d3e075b0288 --- /dev/null +++ b/sys-firmware/zd1201-firmware/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-needed --> + <upstream> + <remote-id type="sourceforge">linux-lc100020</remote-id> + </upstream> +</pkgmetadata> diff --git a/sys-firmware/zd1201-firmware/zd1201-firmware-0.14-r1.ebuild b/sys-firmware/zd1201-firmware/zd1201-firmware-0.14-r1.ebuild new file mode 100644 index 000000000000..f9d4c96d8182 --- /dev/null +++ b/sys-firmware/zd1201-firmware/zd1201-firmware-0.14-r1.ebuild @@ -0,0 +1,26 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_P="zd1201-${PV}-fw" + +DESCRIPTION="Firmware for ZyDAS 1201 based USB 802.11b Network WiFi devices" +HOMEPAGE="http://linux-lc100020.sourceforge.net/" +SRC_URI="https://downloads.sourceforge.net/linux-lc100020/${MY_P}.tar.gz" + +LICENSE="|| ( GPL-3 MPL-1.1 )" +SLOT="0" +KEYWORDS="amd64 ppc64 x86" + +S="${WORKDIR}"/${MY_P} + +src_compile() { + : +} + +src_install() { + insinto /lib/firmware + doins zd1201{,-ap}.fw + dodoc README +} diff --git a/sys-firmware/zd1211-firmware/Manifest b/sys-firmware/zd1211-firmware/Manifest new file mode 100644 index 000000000000..a3e190662cf3 --- /dev/null +++ b/sys-firmware/zd1211-firmware/Manifest @@ -0,0 +1 @@ +DIST zd1211-firmware-1.5.tar.bz2 38291 BLAKE2B 46bba5cc569263d6998b7fa40c4f1ab10138ee4acd871c34fb81a63e38649fd595de9b411c9d29bfd50cef3757cea30fc2faeae9099e43ea9ee485ec0b6c9d3d SHA512 6a8d39318a8c136b2a780ebeb485a94bbb05fa12ad7104b707314e0108e49939b4dcd0035b19f07dac0ec7bdd12668ea281b48724e512b45ac5df9dedf035897 diff --git a/sys-firmware/zd1211-firmware/metadata.xml b/sys-firmware/zd1211-firmware/metadata.xml new file mode 100644 index 000000000000..20d25fa98966 --- /dev/null +++ b/sys-firmware/zd1211-firmware/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-needed --> + <upstream> + <remote-id type="sourceforge">zd1211</remote-id> + </upstream> +</pkgmetadata> diff --git a/sys-firmware/zd1211-firmware/zd1211-firmware-1.5-r1.ebuild b/sys-firmware/zd1211-firmware/zd1211-firmware-1.5-r1.ebuild new file mode 100644 index 000000000000..cf960d951d71 --- /dev/null +++ b/sys-firmware/zd1211-firmware/zd1211-firmware-1.5-r1.ebuild @@ -0,0 +1,20 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Firmware for ZyDAS ZD1211 USB-WLAN devices supported by the zd1211rw driver" +HOMEPAGE="https://sourceforge.net/projects/zd1211/" +SRC_URI="https://downloads.sourceforge.net/project/zd1211/${PN}/${PV}/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ppc ppc64 ~sparc x86" + +S="${WORKDIR}"/${PN} + +src_install() { + insinto /lib/firmware/zd1211 + doins zd1211_u{b,r,phr} zd1211b_u{b,r,phr} + dodoc README +} |
