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 DD39B158020 for ; Fri, 28 Oct 2022 17:02:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 774C6E0825; Fri, 28 Oct 2022 17:02:11 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 59235E0825 for ; Fri, 28 Oct 2022 17:02:11 +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) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2029B341187 for ; Fri, 28 Oct 2022 17:02:10 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 62B9A644 for ; Fri, 28 Oct 2022 17:02:08 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1666976511.12113f5d57730f8c36d3df433ec7f1606519e360.sam@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-20221012-r1.ebuild sys-kernel/linux-firmware/linux-firmware-99999999.ebuild sys-kernel/linux-firmware/metadata.xml X-VCS-Directories: sys-kernel/linux-firmware/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 12113f5d57730f8c36d3df433ec7f1606519e360 X-VCS-Branch: master Date: Fri, 28 Oct 2022 17:02:08 +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: 3c783887-51e3-4724-92f0-9863a9bef1d1 X-Archives-Hash: 5e34c73ae1ef2e61290ebcd30654e52b commit: 12113f5d57730f8c36d3df433ec7f1606519e360 Author: Sam James gentoo org> AuthorDate: Fri Oct 28 16:56:33 2022 +0000 Commit: Sam James gentoo org> CommitDate: Fri Oct 28 17:01:51 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=12113f5d sys-kernel/linux-firmware: add USE=compress This compresses installed firmware with xz. Note that FW_LOADER_COMPRESS must be enabled in the kernel. Closes: https://bugs.gentoo.org/695666 Thanks-to: Alexander Tsoy tsoy.me> Signed-off-by: Sam James gentoo.org> ...99.ebuild => linux-firmware-20221012-r1.ebuild} | 34 +++++++++++++++++++--- .../linux-firmware/linux-firmware-99999999.ebuild | 34 +++++++++++++++++++--- sys-kernel/linux-firmware/metadata.xml | 1 + 3 files changed, 61 insertions(+), 8 deletions(-) diff --git a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild b/sys-kernel/linux-firmware/linux-firmware-20221012-r1.ebuild similarity index 91% copy from sys-kernel/linux-firmware/linux-firmware-99999999.ebuild copy to sys-kernel/linux-firmware/linux-firmware-20221012-r1.ebuild index 838ce9db7b42..83806f04167f 100644 --- a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild +++ b/sys-kernel/linux-firmware/linux-firmware-20221012-r1.ebuild @@ -2,11 +2,11 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=7 -inherit mount-boot savedconfig +inherit linux-info mount-boot savedconfig multiprocessing # In case this is a real snapshot, fill in commit below. # For normal, tagged releases, leave blank -MY_COMMIT= +MY_COMMIT="" if [[ ${PV} == 99999999* ]]; then inherit git-r3 @@ -14,11 +14,12 @@ if [[ ${PV} == 99999999* ]]; then else if [[ -n "${MY_COMMIT}" ]]; then SRC_URI="https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/snapshot/${MY_COMMIT}.tar.gz -> ${P}.tar.gz" + S="${WORKDIR}/${MY_COMMIT}" else SRC_URI="https://mirrors.edge.kernel.org/pub/linux/kernel/firmware/${P}.tar.xz" fi - KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" fi DESCRIPTION="Linux firmware files" @@ -29,7 +30,7 @@ LICENSE="GPL-2 GPL-2+ GPL-3 BSD MIT || ( MPL-1.1 GPL-2 ) linux-fw-redistributable ( BSD-2 BSD BSD-4 ISC MIT no-source-code ) ) unknown-license? ( all-rights-reserved )" SLOT="0" -IUSE="initramfs +redistributable savedconfig unknown-license" +IUSE="compress initramfs +redistributable savedconfig unknown-license" REQUIRED_USE="initramfs? ( redistributable )" RESTRICT="binchecks strip test @@ -60,6 +61,15 @@ RDEPEND="!savedconfig? ( QA_PREBUILT="*" +pkg_setup() { + if ! use compress ; then + return + fi + + local CONFIG_CHECK="~FW_LOADER_COMPRESS" + linux-info_pkg_setup +} + pkg_pretend() { use initramfs && mount-boot_pkg_pretend } @@ -301,6 +311,17 @@ src_install() { find * ! -type d >> "${S}"/${PN}.conf || die save_config "${S}"/${PN}.conf + if use compress ; then + while IFS= read -r -d '' f; do + target=$(readlink "${f}") + ln -sf "${target}".xz "${f}" || die + mv "${f}" "${f}".xz || die + done < <(find . -type l -print0) || die + + find . -type f ! -path "./amd-ucode/*" -print0 | \ + xargs -0 -P $(makeopts_jobs) -I'{}' xz -T1 -C crc32 '{}' || die + fi + popd &>/dev/null || die if use initramfs ; then @@ -314,6 +335,11 @@ pkg_preinst() { ewarn "USE=savedconfig is active. You must handle file collisions manually." fi + # Fix 'symlink is blocked by a directory' Bug #871315 + if has_version "<${CATEGORY}/${PN}-20220913-r2" ; then + rm -rf "${EROOT}"/lib/firmware/qcom/LENOVO/21BX + fi + # Make sure /boot is available if needed. use initramfs && mount-boot_pkg_preinst } diff --git a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild index 838ce9db7b42..83806f04167f 100644 --- a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild +++ b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild @@ -2,11 +2,11 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=7 -inherit mount-boot savedconfig +inherit linux-info mount-boot savedconfig multiprocessing # In case this is a real snapshot, fill in commit below. # For normal, tagged releases, leave blank -MY_COMMIT= +MY_COMMIT="" if [[ ${PV} == 99999999* ]]; then inherit git-r3 @@ -14,11 +14,12 @@ if [[ ${PV} == 99999999* ]]; then else if [[ -n "${MY_COMMIT}" ]]; then SRC_URI="https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/snapshot/${MY_COMMIT}.tar.gz -> ${P}.tar.gz" + S="${WORKDIR}/${MY_COMMIT}" else SRC_URI="https://mirrors.edge.kernel.org/pub/linux/kernel/firmware/${P}.tar.xz" fi - KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" fi DESCRIPTION="Linux firmware files" @@ -29,7 +30,7 @@ LICENSE="GPL-2 GPL-2+ GPL-3 BSD MIT || ( MPL-1.1 GPL-2 ) linux-fw-redistributable ( BSD-2 BSD BSD-4 ISC MIT no-source-code ) ) unknown-license? ( all-rights-reserved )" SLOT="0" -IUSE="initramfs +redistributable savedconfig unknown-license" +IUSE="compress initramfs +redistributable savedconfig unknown-license" REQUIRED_USE="initramfs? ( redistributable )" RESTRICT="binchecks strip test @@ -60,6 +61,15 @@ RDEPEND="!savedconfig? ( QA_PREBUILT="*" +pkg_setup() { + if ! use compress ; then + return + fi + + local CONFIG_CHECK="~FW_LOADER_COMPRESS" + linux-info_pkg_setup +} + pkg_pretend() { use initramfs && mount-boot_pkg_pretend } @@ -301,6 +311,17 @@ src_install() { find * ! -type d >> "${S}"/${PN}.conf || die save_config "${S}"/${PN}.conf + if use compress ; then + while IFS= read -r -d '' f; do + target=$(readlink "${f}") + ln -sf "${target}".xz "${f}" || die + mv "${f}" "${f}".xz || die + done < <(find . -type l -print0) || die + + find . -type f ! -path "./amd-ucode/*" -print0 | \ + xargs -0 -P $(makeopts_jobs) -I'{}' xz -T1 -C crc32 '{}' || die + fi + popd &>/dev/null || die if use initramfs ; then @@ -314,6 +335,11 @@ pkg_preinst() { ewarn "USE=savedconfig is active. You must handle file collisions manually." fi + # Fix 'symlink is blocked by a directory' Bug #871315 + if has_version "<${CATEGORY}/${PN}-20220913-r2" ; then + rm -rf "${EROOT}"/lib/firmware/qcom/LENOVO/21BX + fi + # Make sure /boot is available if needed. use initramfs && mount-boot_pkg_preinst } diff --git a/sys-kernel/linux-firmware/metadata.xml b/sys-kernel/linux-firmware/metadata.xml index d62bc079c3ee..dcaea9b2c06e 100644 --- a/sys-kernel/linux-firmware/metadata.xml +++ b/sys-kernel/linux-firmware/metadata.xml @@ -18,6 +18,7 @@ Gentoo Kernel Project + Compress firmware using xz (app-arch/xz-utils) before installation Create and install initramfs for early microcode loading in /boot (only AMD for now) Install also non-free (but redistributable) firmware files Allows individual selection of firmware files