Skip to content

Commit 9877410

Browse files
authored
Merge pull request #192 from macaroni-os/merge/mark-31/bump-sys-kernel_linux-firmware-20250509
mark-devkit: [mark-31] Bump sys-kernel/linux-firmware-20250509
2 parents 49e4b2e + 216af3a commit 9877410

2 files changed

Lines changed: 94 additions & 0 deletions

File tree

sys-kernel/linux-firmware/Manifest

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
DIST linux-firmware-20250410.tar.gz 713941971 BLAKE2B f89d6dea6f677d48e2cd68ef05017abb1cce30f53aa28ae422b3f74bd2498d3f1bf385e5c5c77f77c4981248a044d0e42e915fe0a8cbb038ab884e0c68a24ae0 SHA512 e34fa5942c60eb4feda952a30b883af33e99fc1c85ad327b51ef07db418df8499adaf70eebe3cd7d28d06b55ac47c4bab3d15b0f49826eb866256d3be56b264b
2+
DIST linux-firmware-20250509.tar.gz 719860938 BLAKE2B 9ee56ef8387ed7bf483f28bb525e4237fb7eac1cfee1d4f394e692f83e3fb426ee1e44eb9522e1f534df25b775b44e985e082995995261645c841fad86286aa9 SHA512 b039e652e6c3bd28f8818975e70a52715308d591c03f7979f3f717a0a81f7b0eb9b7ff3af8f0185e6b9daf2e261f9b187caccea56a83b2aebb00dc1bd825f9d3
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Distributed under the terms of the GNU General Public License v2
2+
3+
EAPI=7
4+
inherit ego
5+
6+
DESCRIPTION="Linux firmware files"
7+
HOMEPAGE="https://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git"
8+
SRC_URI="https://mirrors.edge.kernel.org/pub/linux/kernel/firmware/linux-firmware-20250509.tar.gz -> linux-firmware-20250509.tar.gz
9+
"
10+
11+
LICENSE="GPL-2 GPL-2+ GPL-3 BSD MIT MPL-1.1 linux-fw-redistributable BSD-2 BSD-4 ISC no-source-code"
12+
SLOT="0"
13+
IUSE="initramfs"
14+
KEYWORDS="*"
15+
RESTRICT="strip test"
16+
QA_PREBUILT="*"
17+
18+
BDEPEND="initramfs? ( app-arch/cpio ) app-misc/rdfind"
19+
RDEPEND="initramfs? ( !<=app-admin/ego-2.8.5 )"
20+
21+
PATCHES=(
22+
"${FILESDIR}"/${PN}-copy-firmware.patch
23+
)
24+
25+
src_prepare() {
26+
default
27+
28+
if use initramfs; then
29+
if [[ -d "${S}/amd-ucode" ]]; then
30+
local UCODETMP="${T}/ucode_tmp"
31+
local UCODEDIR="${UCODETMP}/kernel/x86/microcode"
32+
mkdir -p "${UCODEDIR}" || die
33+
echo 1 > "${UCODETMP}/early_cpio"
34+
35+
local amd_ucode_file="${UCODEDIR}/AuthenticAMD.bin"
36+
cat "${S}"/amd-ucode/*.bin > "${amd_ucode_file}" || die "Failed to concat amd cpu ucode"
37+
38+
if [[ ! -s "${amd_ucode_file}" ]]; then
39+
die "Sanity check failed: '${amd_ucode_file}' is empty!"
40+
fi
41+
42+
pushd "${UCODETMP}" &>/dev/null || die
43+
find . -print0 | cpio --quiet --null -o -H newc -R 0:0 > "${S}"/amd-uc.img
44+
popd &>/dev/null || die
45+
if [[ ! -s "${S}/amd-uc.img" ]]; then
46+
die "Failed to create '${S}/amd-uc.img'!"
47+
fi
48+
else
49+
# If this will ever happen something has changed which
50+
# must be reviewed
51+
die "'${S}/amd-ucode' not found!"
52+
fi
53+
fi
54+
55+
echo "# Remove files that shall not be installed from this list." > ${PN}.conf
56+
find * ! -type d ! \( -name ${PN}.conf -o -name amd-uc.img \) >> ${PN}.conf
57+
}
58+
59+
src_install() {
60+
./copy-firmware.sh -v "${ED}/lib/firmware" || die
61+
62+
if use initramfs ; then
63+
insinto /lib/firmware/amd-ucode
64+
doins "${S}"/amd-uc.img
65+
fi
66+
}
67+
68+
pkg_preinst() {
69+
# Make sure /boot is available if needed.
70+
use initramfs && ego_pkg_preinst
71+
72+
# Fix 'symlink is blocked by a directory' Bug #871315 on Gentoo and FL-10491 on Funtoo
73+
if has_version "<${CATEGORY}/${PN}-20220913-r1" ; then
74+
rm -rf "${EROOT}"/lib/firmware/qcom/LENOVO/21BX*
75+
fi
76+
77+
78+
}
79+
80+
pkg_postinst() {
81+
# Don't forget to umount /boot if it was previously mounted by us.
82+
use initramfs && ego_pkg_postinst
83+
}
84+
85+
pkg_prerm() {
86+
# Make sure /boot is mounted so that we can remove /boot/amd-uc.img!
87+
use initramfs && ego_pkg_prerm
88+
}
89+
90+
pkg_postrm() {
91+
# Don't forget to umount /boot if it was previously mounted by us.
92+
use initramfs && ego_pkg_postrm
93+
}

0 commit comments

Comments
 (0)