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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A6E87138334 for ; Fri, 2 Aug 2019 23:59:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9531AE081E; Fri, 2 Aug 2019 23:59:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 63081E0815 for ; Fri, 2 Aug 2019 23:59:16 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BF8853492DF for ; Fri, 2 Aug 2019 23:59:14 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C5793A8 for ; Fri, 2 Aug 2019 23:59:12 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1564790345.3547ee0e2205ce4b8db5acd193d9215d61769511.whissi@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-99999999.ebuild sys-kernel/linux-firmware/metadata.xml X-VCS-Directories: sys-kernel/linux-firmware/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 3547ee0e2205ce4b8db5acd193d9215d61769511 X-VCS-Branch: master Date: Fri, 2 Aug 2019 23:59:12 +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: ffa40c81-dda3-498d-91bd-f1eee0ee2d0b X-Archives-Hash: 7fdd9045d34bdd21cc9bc33a5160924d commit: 3547ee0e2205ce4b8db5acd193d9215d61769511 Author: Thomas Deutschmann gentoo org> AuthorDate: Fri Aug 2 23:46:36 2019 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Fri Aug 2 23:59:05 2019 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3547ee0e sys-kernel/linux-firmware: add USE=initramfs USE=initramfs will create /boot/amd-uc.img. Package-Manager: Portage-2.3.69, Repoman-2.3.16 Signed-off-by: Thomas Deutschmann gentoo.org> .../linux-firmware/linux-firmware-99999999.ebuild | 40 ++++++++++++++++++++-- sys-kernel/linux-firmware/metadata.xml | 7 ++-- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild index f439b40eab4..c2afff9ee0c 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=7 -inherit savedconfig +inherit mount-boot savedconfig if [[ ${PV} == 99999999* ]]; then inherit git-r3 @@ -21,10 +21,12 @@ 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="+redistributable savedconfig unknown-license" +IUSE="initramfs +redistributable savedconfig unknown-license" RESTRICT="binchecks strip unknown-license? ( bindist )" +BDEPEND="initramfs? ( app-arch/cpio )" + RDEPEND="!savedconfig? ( redistributable? ( !sys-firmware/alsa-firmware[alsa_cards_ca0132] @@ -244,8 +246,35 @@ src_prepare() { IFS=$' \t\n' fi + if use initramfs; then + if [[ -d "${S}/amd-ucode" ]]; then + local UCODETMP="${T}/ucode_tmp" + local UCODEDIR="${UCODETMP}/kernel/x86/microcode" + mkdir -p "${UCODEDIR}" || die + echo 1 > "${UCODETMP}/early_cpio" + + local amd_ucode_file="${UCODEDIR}/AuthenticAMD.bin" + cat "${S}"/amd-ucode/*.bin > "${amd_ucode_file}" || die "Failed to concat amd cpu ucode" + + if [[ ! -s "${amd_ucode_file}" ]]; then + die "Sanity check failed: '${amd_ucode_file}' is empty!" + fi + + pushd "${UCODETMP}" &>/dev/null || die + find . -print0 | cpio --quiet --null -o -H newc -R 0:0 > "${S}"/amd-uc.img + popd &>/dev/null || die + if [[ ! -s "${S}/amd-uc.img" ]]; then + die "Failed to create '${S}/amd-uc.img'!" + fi + else + # If this will ever happen something has changed which + # must be reviewed + die "'${S}/amd-ucode' not found!" + fi + fi + echo "# Remove files that shall not be installed from this list." > ${PN}.conf - find * ! -type d ! -name ${PN}.conf >> ${PN}.conf + find * ! -type d \( ! -name ${PN}.conf -o -name amd-uc.img \) >> ${PN}.conf if use savedconfig; then restore_config ${PN}.conf @@ -268,6 +297,11 @@ src_install() { fi rm ${PN}.conf || die + if use initramfs ; then + mkdir "${ED}/boot" || die + mv "${S}"/amd-uc.img "${ED}/boot" || die + fi + if ! ( shopt -s failglob; : * ) 2>/dev/null; then eerror "No files to install. Check your USE flag settings" eerror "and the list of files in your saved configuration." diff --git a/sys-kernel/linux-firmware/metadata.xml b/sys-kernel/linux-firmware/metadata.xml index 7370ea010cc..b1cdaa4debb 100644 --- a/sys-kernel/linux-firmware/metadata.xml +++ b/sys-kernel/linux-firmware/metadata.xml @@ -14,10 +14,9 @@ Gentoo Kernel Project - Install also non-free (but redistributable) - firmware files + 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 - Install firmware files whose license is - unknown + Install firmware files whose license is unknown