From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2B2311581D3 for ; Fri, 17 May 2024 12:07:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 58AF1E2AE2; Fri, 17 May 2024 12:07:33 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3D01DE2AE2 for ; Fri, 17 May 2024 12:07:33 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 70D1633C4EE for ; Fri, 17 May 2024 12:07:32 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 10DD91AD4 for ; Fri, 17 May 2024 12:07:31 +0000 (UTC) From: "Andrew Ammerlaan" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andrew Ammerlaan" Message-ID: <1715947605.a8fc8ca1a52c52bb035a62a1c844ce986ebf5e6b.andrewammerlaan@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-kernel/linux-firmware/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-kernel/linux-firmware/linux-firmware-20240312.ebuild sys-kernel/linux-firmware/linux-firmware-20240410.ebuild sys-kernel/linux-firmware/linux-firmware-20240513.ebuild sys-kernel/linux-firmware/linux-firmware-99999999.ebuild X-VCS-Directories: sys-kernel/linux-firmware/ X-VCS-Committer: andrewammerlaan X-VCS-Committer-Name: Andrew Ammerlaan X-VCS-Revision: a8fc8ca1a52c52bb035a62a1c844ce986ebf5e6b X-VCS-Branch: master Date: Fri, 17 May 2024 12:07:31 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 276c66b9-a61f-4d3d-9816-52622e71abfa X-Archives-Hash: 928ee683780029fcc4c51bba048cd62a commit: a8fc8ca1a52c52bb035a62a1c844ce986ebf5e6b Author: Andrew Ammerlaan gentoo org> AuthorDate: Wed May 8 06:58:19 2024 +0000 Commit: Andrew Ammerlaan gentoo org> CommitDate: Fri May 17 12:06:45 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a8fc8ca1 sys-kernel/linux-firmware: add USE=dist-kernel The /boot/amd-ucode is useless when we use a dist-kernel since dracut is responsible for generating the initramfs, and it (by default) includes the microcode. Instead add USE=dist-kernel and enable USE=initramfs by default. The initramfs flag toggles the early_microcode setting of dracut, and if both flags are enabled we trigger initramfs re-installation. This ensures that when we update this package, we also get the latest microcode in our dist-kernel initramfs or UKI. Signed-off-by: Andrew Ammerlaan gentoo.org> .../linux-firmware/linux-firmware-20240312.ebuild | 32 +++++++++++++++++----- .../linux-firmware/linux-firmware-20240410.ebuild | 32 +++++++++++++++++----- .../linux-firmware/linux-firmware-20240513.ebuild | 32 +++++++++++++++++----- .../linux-firmware/linux-firmware-99999999.ebuild | 32 +++++++++++++++++----- 4 files changed, 100 insertions(+), 28 deletions(-) diff --git a/sys-kernel/linux-firmware/linux-firmware-20240312.ebuild b/sys-kernel/linux-firmware/linux-firmware-20240312.ebuild index 02d01fa9f5f5..1bb6954d00c8 100644 --- a/sys-kernel/linux-firmware/linux-firmware-20240312.ebuild +++ b/sys-kernel/linux-firmware/linux-firmware-20240312.ebuild @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=8 -inherit linux-info mount-boot savedconfig multiprocessing +inherit dist-kernel-utils linux-info mount-boot savedconfig multiprocessing # In case this is a real snapshot, fill in commit below. # For normal, tagged releases, leave blank @@ -29,7 +29,7 @@ LICENSE="GPL-2 GPL-2+ GPL-3 BSD MIT || ( MPL-1.1 GPL-2 ) redistributable? ( linux-fw-redistributable BSD-2 BSD BSD-4 ISC MIT ) unknown-license? ( all-rights-reserved )" SLOT="0" -IUSE="bindist compress-xz compress-zstd deduplicate initramfs +redistributable savedconfig unknown-license" +IUSE="bindist compress-xz compress-zstd deduplicate dist-kernel +initramfs +redistributable savedconfig unknown-license" REQUIRED_USE="initramfs? ( redistributable ) ?? ( compress-xz compress-zstd ) savedconfig? ( !deduplicate )" @@ -56,7 +56,14 @@ RDEPEND="!savedconfig? ( !sys-firmware/alsa-firmware[alsa_cards_sb16] !sys-firmware/alsa-firmware[alsa_cards_ymfpci] ) - )" + ) + dist-kernel? ( virtual/dist-kernel ) +" +IDEPEND=" + dist-kernel? ( + initramfs? ( sys-kernel/installkernel ) + ) +" QA_PREBUILT="*" PATCHES=( "${FILESDIR}"/${PN}-copy-firmware-r4.patch ) @@ -78,8 +85,8 @@ pkg_setup() { eerror "Kernels <5.19 do not support ZSTD-compressed firmware files" fi fi - linux-info_pkg_setup fi + linux-info_pkg_setup } src_unpack() { @@ -104,7 +111,7 @@ src_prepare() { chmod +x copy-firmware.sh || die - if use initramfs; then + if use initramfs && ! use dist-kernel; then if [[ -d "${S}/amd-ucode" ]]; then local UCODETMP="${T}/ucode_tmp" local UCODEDIR="${UCODETMP}/kernel/x86/microcode" @@ -345,7 +352,13 @@ src_install() { popd &>/dev/null || die - if use initramfs ; then + # Instruct Dracut on whether or not we want the microcode in initramfs + ( + insinto /usr/lib/dracut/dracut.conf.d + newins - 10-${PN}.conf <<<"early_microcode=$(usex initramfs)" + ) + + if use initramfs && ! use dist-kernel; then insinto /boot doins "${S}"/amd-uc.img fi @@ -385,7 +398,12 @@ pkg_postinst() { done # Don't forget to umount /boot if it was previously mounted by us. - use initramfs && mount-boot_pkg_postinst + if use initramfs; then + if [[ -z ${ROOT} ]] && use dist-kernel; then + dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" + fi + mount-boot_pkg_postinst + fi } pkg_prerm() { diff --git a/sys-kernel/linux-firmware/linux-firmware-20240410.ebuild b/sys-kernel/linux-firmware/linux-firmware-20240410.ebuild index 02d01fa9f5f5..1bb6954d00c8 100644 --- a/sys-kernel/linux-firmware/linux-firmware-20240410.ebuild +++ b/sys-kernel/linux-firmware/linux-firmware-20240410.ebuild @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=8 -inherit linux-info mount-boot savedconfig multiprocessing +inherit dist-kernel-utils linux-info mount-boot savedconfig multiprocessing # In case this is a real snapshot, fill in commit below. # For normal, tagged releases, leave blank @@ -29,7 +29,7 @@ LICENSE="GPL-2 GPL-2+ GPL-3 BSD MIT || ( MPL-1.1 GPL-2 ) redistributable? ( linux-fw-redistributable BSD-2 BSD BSD-4 ISC MIT ) unknown-license? ( all-rights-reserved )" SLOT="0" -IUSE="bindist compress-xz compress-zstd deduplicate initramfs +redistributable savedconfig unknown-license" +IUSE="bindist compress-xz compress-zstd deduplicate dist-kernel +initramfs +redistributable savedconfig unknown-license" REQUIRED_USE="initramfs? ( redistributable ) ?? ( compress-xz compress-zstd ) savedconfig? ( !deduplicate )" @@ -56,7 +56,14 @@ RDEPEND="!savedconfig? ( !sys-firmware/alsa-firmware[alsa_cards_sb16] !sys-firmware/alsa-firmware[alsa_cards_ymfpci] ) - )" + ) + dist-kernel? ( virtual/dist-kernel ) +" +IDEPEND=" + dist-kernel? ( + initramfs? ( sys-kernel/installkernel ) + ) +" QA_PREBUILT="*" PATCHES=( "${FILESDIR}"/${PN}-copy-firmware-r4.patch ) @@ -78,8 +85,8 @@ pkg_setup() { eerror "Kernels <5.19 do not support ZSTD-compressed firmware files" fi fi - linux-info_pkg_setup fi + linux-info_pkg_setup } src_unpack() { @@ -104,7 +111,7 @@ src_prepare() { chmod +x copy-firmware.sh || die - if use initramfs; then + if use initramfs && ! use dist-kernel; then if [[ -d "${S}/amd-ucode" ]]; then local UCODETMP="${T}/ucode_tmp" local UCODEDIR="${UCODETMP}/kernel/x86/microcode" @@ -345,7 +352,13 @@ src_install() { popd &>/dev/null || die - if use initramfs ; then + # Instruct Dracut on whether or not we want the microcode in initramfs + ( + insinto /usr/lib/dracut/dracut.conf.d + newins - 10-${PN}.conf <<<"early_microcode=$(usex initramfs)" + ) + + if use initramfs && ! use dist-kernel; then insinto /boot doins "${S}"/amd-uc.img fi @@ -385,7 +398,12 @@ pkg_postinst() { done # Don't forget to umount /boot if it was previously mounted by us. - use initramfs && mount-boot_pkg_postinst + if use initramfs; then + if [[ -z ${ROOT} ]] && use dist-kernel; then + dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" + fi + mount-boot_pkg_postinst + fi } pkg_prerm() { diff --git a/sys-kernel/linux-firmware/linux-firmware-20240513.ebuild b/sys-kernel/linux-firmware/linux-firmware-20240513.ebuild index 02d01fa9f5f5..1bb6954d00c8 100644 --- a/sys-kernel/linux-firmware/linux-firmware-20240513.ebuild +++ b/sys-kernel/linux-firmware/linux-firmware-20240513.ebuild @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=8 -inherit linux-info mount-boot savedconfig multiprocessing +inherit dist-kernel-utils linux-info mount-boot savedconfig multiprocessing # In case this is a real snapshot, fill in commit below. # For normal, tagged releases, leave blank @@ -29,7 +29,7 @@ LICENSE="GPL-2 GPL-2+ GPL-3 BSD MIT || ( MPL-1.1 GPL-2 ) redistributable? ( linux-fw-redistributable BSD-2 BSD BSD-4 ISC MIT ) unknown-license? ( all-rights-reserved )" SLOT="0" -IUSE="bindist compress-xz compress-zstd deduplicate initramfs +redistributable savedconfig unknown-license" +IUSE="bindist compress-xz compress-zstd deduplicate dist-kernel +initramfs +redistributable savedconfig unknown-license" REQUIRED_USE="initramfs? ( redistributable ) ?? ( compress-xz compress-zstd ) savedconfig? ( !deduplicate )" @@ -56,7 +56,14 @@ RDEPEND="!savedconfig? ( !sys-firmware/alsa-firmware[alsa_cards_sb16] !sys-firmware/alsa-firmware[alsa_cards_ymfpci] ) - )" + ) + dist-kernel? ( virtual/dist-kernel ) +" +IDEPEND=" + dist-kernel? ( + initramfs? ( sys-kernel/installkernel ) + ) +" QA_PREBUILT="*" PATCHES=( "${FILESDIR}"/${PN}-copy-firmware-r4.patch ) @@ -78,8 +85,8 @@ pkg_setup() { eerror "Kernels <5.19 do not support ZSTD-compressed firmware files" fi fi - linux-info_pkg_setup fi + linux-info_pkg_setup } src_unpack() { @@ -104,7 +111,7 @@ src_prepare() { chmod +x copy-firmware.sh || die - if use initramfs; then + if use initramfs && ! use dist-kernel; then if [[ -d "${S}/amd-ucode" ]]; then local UCODETMP="${T}/ucode_tmp" local UCODEDIR="${UCODETMP}/kernel/x86/microcode" @@ -345,7 +352,13 @@ src_install() { popd &>/dev/null || die - if use initramfs ; then + # Instruct Dracut on whether or not we want the microcode in initramfs + ( + insinto /usr/lib/dracut/dracut.conf.d + newins - 10-${PN}.conf <<<"early_microcode=$(usex initramfs)" + ) + + if use initramfs && ! use dist-kernel; then insinto /boot doins "${S}"/amd-uc.img fi @@ -385,7 +398,12 @@ pkg_postinst() { done # Don't forget to umount /boot if it was previously mounted by us. - use initramfs && mount-boot_pkg_postinst + if use initramfs; then + if [[ -z ${ROOT} ]] && use dist-kernel; then + dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" + fi + mount-boot_pkg_postinst + fi } pkg_prerm() { diff --git a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild index d6504379817d..dc02d051d7ea 100644 --- a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild +++ b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=8 -inherit linux-info mount-boot savedconfig multiprocessing +inherit dist-kernel-utils linux-info mount-boot savedconfig multiprocessing # In case this is a real snapshot, fill in commit below. # For normal, tagged releases, leave blank @@ -29,7 +29,7 @@ LICENSE="GPL-2 GPL-2+ GPL-3 BSD MIT || ( MPL-1.1 GPL-2 ) redistributable? ( linux-fw-redistributable BSD-2 BSD BSD-4 ISC MIT ) unknown-license? ( all-rights-reserved )" SLOT="0" -IUSE="compress-xz compress-zstd deduplicate initramfs +redistributable savedconfig unknown-license" +IUSE="compress-xz compress-zstd deduplicate dist-kernel +initramfs +redistributable savedconfig unknown-license" REQUIRED_USE="initramfs? ( redistributable ) ?? ( compress-xz compress-zstd ) savedconfig? ( !deduplicate )" @@ -55,7 +55,14 @@ RDEPEND="!savedconfig? ( !sys-firmware/alsa-firmware[alsa_cards_sb16] !sys-firmware/alsa-firmware[alsa_cards_ymfpci] ) - )" + ) + dist-kernel? ( virtual/dist-kernel ) +" +IDEPEND=" + dist-kernel? ( + initramfs? ( sys-kernel/installkernel ) + ) +" QA_PREBUILT="*" @@ -72,8 +79,8 @@ pkg_setup() { eerror "Kernels <5.19 do not support ZSTD-compressed firmware files" fi fi - linux-info_pkg_setup fi + linux-info_pkg_setup } pkg_pretend() { @@ -101,7 +108,7 @@ src_prepare() { chmod +x copy-firmware.sh || die - if use initramfs; then + if use initramfs && ! use dist-kernel; then if [[ -d "${S}/amd-ucode" ]]; then local UCODETMP="${T}/ucode_tmp" local UCODEDIR="${UCODETMP}/kernel/x86/microcode" @@ -349,7 +356,13 @@ src_install() { popd &>/dev/null || die - if use initramfs ; then + # Instruct Dracut on whether or not we want the microcode in initramfs + ( + insinto /usr/lib/dracut/dracut.conf.d + newins - 10-${PN}.conf <<<"early_microcode=$(usex initramfs)" + ) + + if use initramfs && ! use dist-kernel; then insinto /boot doins "${S}"/amd-uc.img fi @@ -385,7 +398,12 @@ pkg_postinst() { done # Don't forget to umount /boot if it was previously mounted by us. - use initramfs && mount-boot_pkg_postinst + if use initramfs; then + if [[ -z ${ROOT} ]] && use dist-kernel; then + dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" + fi + mount-boot_pkg_postinst + fi } pkg_prerm() {