| 2 | 2 | # Distributed under the terms of the GNU General Public License v2 | 
  | 3 | 3 |  | 
  | 4 | 4 | EAPI=8 | 
  | 5 |  | PYTHON_COMPAT=( python3_{10..13} ) | 
  | 6 |  | inherit dist-kernel-utils eapi9-ver linux-info mount-boot python-any-r1 savedconfig | 
  |  | 5 | inherit dist-kernel-utils eapi9-ver linux-info mount-boot savedconfig | 
  | 7 | 6 |  | 
  | 8 | 7 | # In case this is a real snapshot, fill in commit below. | 
  | 9 | 8 | # For normal, tagged releases, leave blank | 
| ... | ... |  | 
  | 14 | 13 | 	EGIT_REPO_URI="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/${PN}.git" | 
  | 15 | 14 | else | 
  | 16 | 15 | 	if [[ -n "${MY_COMMIT}" ]]; then | 
  | 17 |  | 		SRC_URI="https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/snapshot/${MY_COMMIT}.tar.gz -> ${P}.tar.gz" | 
  | 18 |  | 		S="${WORKDIR}/${MY_COMMIT}" | 
  |  | 16 | 		SRC_URI="https://gitlab.com/kernel-firmware/linux-firmware/-/archive/${MY_COMMIT}/linux-firmware-${MY_COMMIT}.tar.bz2 -> ${P}.tar.bz2" | 
  |  | 17 | 		S="${WORKDIR}/${PN}-${MY_COMMIT}" | 
  | 19 | 18 | 	else | 
  | 20 | 19 | 		SRC_URI="https://mirrors.edge.kernel.org/pub/linux/kernel/firmware/${P}.tar.xz" | 
  | 21 | 20 | 	fi | 
  | 22 | 21 |  | 
  | 23 |  | 	KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" | 
  |  | 22 | 	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" | 
  | 24 | 23 | fi | 
  | 25 | 24 |  | 
  | 26 | 25 | DESCRIPTION="Linux firmware files" | 
| ... | ... |  | 
  | 30 | 29 | 	redistributable? ( linux-fw-redistributable BSD-2 BSD BSD-4 ISC MIT ) | 
  | 31 | 30 | 	unknown-license? ( all-rights-reserved )" | 
  | 32 | 31 | SLOT="0" | 
  | 33 |  | IUSE="bindist compress-xz compress-zstd deduplicate dist-kernel +initramfs +redistributable savedconfig unknown-license" | 
  |  | 32 | IUSE="bindist compress-xz compress-zstd deduplicate dist-kernel +initramfs +redistributable unknown-license" | 
  | 34 | 33 | REQUIRED_USE="initramfs? ( redistributable ) | 
  | 35 | 34 | 	?? ( compress-xz compress-zstd ) | 
  | 36 | 35 | 	savedconfig? ( !deduplicate )" | 
| ... | ... |  | 
  | 74 | 73 |  | 
  | 75 | 74 | QA_PREBUILT="*" | 
  | 76 | 75 | PATCHES=( | 
  | 77 |  | 	"${FILESDIR}"/${PN}-copy-firmware-r8.patch | 
  |  | 76 | 	"${FILESDIR}"/${PN}-copy-firmware-r9.patch | 
  | 78 | 77 | ) | 
  | 79 | 78 |  | 
  | 80 | 79 | pkg_pretend() { | 
| ... | ... |  | 
  | 121 | 120 | src_prepare() { | 
  | 122 | 121 | 	default | 
  | 123 | 122 |  | 
  |  | 123 | 	# Stub out this script to avoid errors in the live ebuild | 
  |  | 124 | 	cat >check_whence.py<<-EOF | 
  |  | 125 | 	#!/bin/sh | 
  |  | 126 | 	exit 0 | 
  |  | 127 | 	EOF | 
  |  | 128 |  | 
  | 124 | 129 | 	cp "${FILESDIR}/${PN}-make-amd-ucode-img.bash" "${T}/make-amd-ucode-img" || die | 
  | 125 | 130 | 	chmod +x "${T}/make-amd-ucode-img" || die | 
  | 126 | 131 |  | 
| ... | ... |  | 
  | 366 | 371 | 		rm -rf "${EROOT}"/lib/firmware/qcom/LENOVO/21BX | 
  | 367 | 372 | 	fi | 
  | 368 | 373 |  | 
  |  | 374 | 	# Fix 'symlink is blocked by a directory' https://bugs.gentoo.org/958268#c3 | 
  |  | 375 | 	if has_version "<${CATEGORY}/${PN}-20250613" ; then | 
  |  | 376 | 		rm -rf "${EROOT}"/lib/firmware/nvidia/{ad103,ad104,ad106,ad107} | 
  |  | 377 | 	fi | 
  |  | 378 |  | 
  | 369 | 379 | 	# Make sure /boot is available if needed. | 
  | 370 | 380 | 	use initramfs && ! use dist-kernel && mount-boot_pkg_preinst | 
  | 371 | 381 | } |