Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-kernel/linux-firmware/
Date: Mon, 30 Aug 2021 16:03:58
Message-Id: 1630338564.517e5506590f6575a5936b97d80200f32f92ce5b.whissi@gentoo
1 commit: 517e5506590f6575a5936b97d80200f32f92ce5b
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 30 15:49:24 2021 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 30 15:49:24 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=517e5506
7
8 sys-kernel/linux-firmware: bump to new snapshot, v20210818
9
10 Package-Manager: Portage-3.0.22, Repoman-3.0.3
11 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
12
13 sys-kernel/linux-firmware/Manifest | 1 +
14 .../linux-firmware/linux-firmware-20210818.ebuild | 354 +++++++++++++++++++++
15 2 files changed, 355 insertions(+)
16
17 diff --git a/sys-kernel/linux-firmware/Manifest b/sys-kernel/linux-firmware/Manifest
18 index fb31bb32429..3ed17a4d98b 100644
19 --- a/sys-kernel/linux-firmware/Manifest
20 +++ b/sys-kernel/linux-firmware/Manifest
21 @@ -4,3 +4,4 @@ DIST linux-firmware-20210315.tar.xz 151454796 BLAKE2B aef09bf2043117c821c5e1460d
22 DIST linux-firmware-20210518.tar.gz 328396097 BLAKE2B 7e7b2a41a8906e9bf6147a6ca4dc9cd57db66e98cf10fe4edf8ab56905bf6ad5eca88c479cad5e585b55cad765f051e6b96c0f827c2fa85ba78706b48ba9e047 SHA512 64c81d97aafa43fd438a29258ffcd812497bbd1b22c40b1e352ffea5a40c3c61b5f5a9788d76508c7010209a82ae3938ac6e28ff7f4dffc1582f6e5f8b8c00da
23 DIST linux-firmware-20210629.tar.gz 333073746 BLAKE2B 89a0448dc471ff0c3edfa37b2a34bbe9f52d7c7e1fe416bea1121bd0248614e28672ef26b78dc7570cd6b949b9b8628492e9ee023eefd4fa49c7206146cc8e8a SHA512 1bc206ea691e3a17994150e3827251d539f1e77f44afc452f45129455f1c9d0c3563add95ffa5306c5c49b6dcff031c293e755e08a0329a2b094de786d8330b8
24 DIST linux-firmware-20210716.tar.gz 333073746 BLAKE2B 89a0448dc471ff0c3edfa37b2a34bbe9f52d7c7e1fe416bea1121bd0248614e28672ef26b78dc7570cd6b949b9b8628492e9ee023eefd4fa49c7206146cc8e8a SHA512 1bc206ea691e3a17994150e3827251d539f1e77f44afc452f45129455f1c9d0c3563add95ffa5306c5c49b6dcff031c293e755e08a0329a2b094de786d8330b8
25 +DIST linux-firmware-20210818.tar.xz 172748332 BLAKE2B faf2ad6754bb72e3838aa21d5f2bc2ba49b98966a66fec04ecc5e0e2669fbbd4830820239290e12d2327f361df9084e350668befb8babfc517a5d06d2916dce9 SHA512 ce8d80794476a07740e2a0c62bf5b9a88d392e27285ba490813bf52c4b2b17cf26f24f43bc56673b8f7a11d7b204263ba9e0e8702ff8bf0a79f8478e0eb8efdc
26
27 diff --git a/sys-kernel/linux-firmware/linux-firmware-20210818.ebuild b/sys-kernel/linux-firmware/linux-firmware-20210818.ebuild
28 new file mode 100644
29 index 00000000000..c4bc4e2add9
30 --- /dev/null
31 +++ b/sys-kernel/linux-firmware/linux-firmware-20210818.ebuild
32 @@ -0,0 +1,354 @@
33 +# Copyright 1999-2021 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +inherit mount-boot savedconfig
38 +
39 +# In case this is a real snapshot, fill in commit below.
40 +# For normal, tagged releases, leave blank
41 +MY_COMMIT=""
42 +
43 +if [[ ${PV} == 99999999* ]]; then
44 + inherit git-r3
45 + EGIT_REPO_URI="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/${PN}.git"
46 +else
47 + if [[ -n "${MY_COMMIT}" ]]; then
48 + SRC_URI="https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/snapshot/${MY_COMMIT}.tar.gz -> ${P}.tar.gz"
49 + S="${WORKDIR}/${MY_COMMIT}"
50 + else
51 + SRC_URI="https://mirrors.edge.kernel.org/pub/linux/kernel/firmware/${P}.tar.xz"
52 + fi
53 +
54 + KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86"
55 +fi
56 +
57 +DESCRIPTION="Linux firmware files"
58 +HOMEPAGE="https://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git"
59 +
60 +LICENSE="GPL-2 GPL-2+ GPL-3 BSD MIT || ( MPL-1.1 GPL-2 )
61 + redistributable? (
62 + linux-fw-redistributable ( BSD-2 BSD BSD-4 ISC MIT no-source-code ) )
63 + unknown-license? ( all-rights-reserved )"
64 +SLOT="0"
65 +IUSE="initramfs +redistributable savedconfig unknown-license"
66 +REQUIRED_USE="initramfs? ( redistributable )"
67 +
68 +RESTRICT="binchecks strip test
69 + unknown-license? ( bindist )"
70 +
71 +BDEPEND="initramfs? ( app-arch/cpio )"
72 +
73 +#add anything else that collides to this
74 +RDEPEND="!savedconfig? (
75 + redistributable? (
76 + !sys-firmware/alsa-firmware[alsa_cards_ca0132]
77 + !sys-block/qla-fc-firmware
78 + !sys-firmware/iwl1000-ucode
79 + !sys-firmware/iwl6005-ucode
80 + !sys-firmware/iwl6030-ucode
81 + !sys-firmware/iwl6050-ucode
82 + !sys-firmware/iwl3160-ucode
83 + !sys-firmware/iwl7260-ucode
84 + !sys-firmware/iwl3160-7260-bt-ucode
85 + !sys-firmware/raspberrypi-wifi-ucode
86 + )
87 + unknown-license? (
88 + !sys-firmware/alsa-firmware[alsa_cards_korg1212]
89 + !sys-firmware/alsa-firmware[alsa_cards_maestro3]
90 + !sys-firmware/alsa-firmware[alsa_cards_sb16]
91 + !sys-firmware/alsa-firmware[alsa_cards_ymfpci]
92 + )
93 + )"
94 +
95 +QA_PREBUILT="*"
96 +
97 +pkg_pretend() {
98 + use initramfs && mount-boot_pkg_pretend
99 +}
100 +
101 +src_unpack() {
102 + if [[ ${PV} == 99999999* ]]; then
103 + git-r3_src_unpack
104 + else
105 + default
106 + # rename directory from git snapshot tarball
107 + if [[ ${#GIT_COMMIT} -gt 8 ]]; then
108 + mv ${PN}-*/ ${P} || die
109 + fi
110 + fi
111 +}
112 +
113 +src_prepare() {
114 + default
115 +
116 + find . -type f -not -perm 0644 -print0 \
117 + | xargs --null --no-run-if-empty chmod 0644 \
118 + || die
119 +
120 + chmod +x copy-firmware.sh || die
121 +
122 + if use initramfs; then
123 + if [[ -d "${S}/amd-ucode" ]]; then
124 + local UCODETMP="${T}/ucode_tmp"
125 + local UCODEDIR="${UCODETMP}/kernel/x86/microcode"
126 + mkdir -p "${UCODEDIR}" || die
127 + echo 1 > "${UCODETMP}/early_cpio"
128 +
129 + local amd_ucode_file="${UCODEDIR}/AuthenticAMD.bin"
130 + cat "${S}"/amd-ucode/*.bin > "${amd_ucode_file}" || die "Failed to concat amd cpu ucode"
131 +
132 + if [[ ! -s "${amd_ucode_file}" ]]; then
133 + die "Sanity check failed: '${amd_ucode_file}' is empty!"
134 + fi
135 +
136 + pushd "${UCODETMP}" &>/dev/null || die
137 + find . -print0 | cpio --quiet --null -o -H newc -R 0:0 > "${S}"/amd-uc.img
138 + popd &>/dev/null || die
139 + if [[ ! -s "${S}/amd-uc.img" ]]; then
140 + die "Failed to create '${S}/amd-uc.img'!"
141 + fi
142 + else
143 + # If this will ever happen something has changed which
144 + # must be reviewed
145 + die "'${S}/amd-ucode' not found!"
146 + fi
147 + fi
148 +
149 + # whitelist of misc files
150 + local misc_files=(
151 + copy-firmware.sh
152 + WHENCE
153 + README
154 + )
155 +
156 + # whitelist of images with a free software license
157 + local free_software=(
158 + # keyspan_pda (GPL-2+)
159 + keyspan_pda/keyspan_pda.fw
160 + keyspan_pda/xircom_pgs.fw
161 + # dsp56k (GPL-2+)
162 + dsp56k/bootstrap.bin
163 + # ath9k_htc (BSD GPL-2+ MIT)
164 + ath9k_htc/htc_7010-1.4.0.fw
165 + ath9k_htc/htc_9271-1.4.0.fw
166 + # pcnet_cs, 3c589_cs, 3c574_cs, serial_cs (dual GPL-2/MPL-1.1)
167 + cis/LA-PCM.cis
168 + cis/PCMLM28.cis
169 + cis/DP83903.cis
170 + cis/NE2K.cis
171 + cis/tamarack.cis
172 + cis/PE-200.cis
173 + cis/PE520.cis
174 + cis/3CXEM556.cis
175 + cis/3CCFEM556.cis
176 + cis/MT5634ZLX.cis
177 + cis/RS-COM-2P.cis
178 + cis/COMpad2.cis
179 + cis/COMpad4.cis
180 + # serial_cs (GPL-3)
181 + cis/SW_555_SER.cis
182 + cis/SW_7xx_SER.cis
183 + cis/SW_8xx_SER.cis
184 + # dvb-ttpci (GPL-2+)
185 + av7110/bootcode.bin
186 + # usbdux, usbduxfast, usbduxsigma (GPL-2+)
187 + usbdux_firmware.bin
188 + usbduxfast_firmware.bin
189 + usbduxsigma_firmware.bin
190 + # brcmfmac (GPL-2+)
191 + brcm/brcmfmac4330-sdio.Prowise-PT301.txt
192 + brcm/brcmfmac43340-sdio.meegopad-t08.txt
193 + brcm/brcmfmac43362-sdio.cubietech,cubietruck.txt
194 + brcm/brcmfmac43362-sdio.lemaker,bananapro.txt
195 + brcm/brcmfmac43430a0-sdio.jumper-ezpad-mini3.txt
196 + "brcm/brcmfmac43430a0-sdio.ONDA-V80 PLUS.txt"
197 + brcm/brcmfmac43430-sdio.AP6212.txt
198 + brcm/brcmfmac43430-sdio.Hampoo-D2D3_Vi8A1.txt
199 + brcm/brcmfmac43430-sdio.MUR1DX.txt
200 + brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.txt
201 + brcm/brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt
202 + brcm/brcmfmac4356-pcie.gpd-win-pocket.txt
203 + # isci (GPL-2)
204 + isci/isci_firmware.bin
205 + # carl9170 (GPL-2+)
206 + carl9170-1.fw
207 + # atusb (GPL-2+)
208 + atusb/atusb-0.2.dfu
209 + atusb/atusb-0.3.dfu
210 + atusb/rzusb-0.3.bin
211 + # mlxsw_spectrum (dual BSD/GPL-2)
212 + mellanox/mlxsw_spectrum-13.1420.122.mfa2
213 + mellanox/mlxsw_spectrum-13.1530.152.mfa2
214 + mellanox/mlxsw_spectrum-13.1620.192.mfa2
215 + mellanox/mlxsw_spectrum-13.1702.6.mfa2
216 + mellanox/mlxsw_spectrum-13.1703.4.mfa2
217 + mellanox/mlxsw_spectrum-13.1910.622.mfa2
218 + mellanox/mlxsw_spectrum-13.2000.1122.mfa2
219 + )
220 +
221 + # blacklist of images with unknown license
222 + local unknown_license=(
223 + atmsar11.fw
224 + korg/k1212.dsp
225 + ess/maestro3_assp_kernel.fw
226 + ess/maestro3_assp_minisrc.fw
227 + yamaha/ds1_ctrl.fw
228 + yamaha/ds1_dsp.fw
229 + yamaha/ds1e_ctrl.fw
230 + tr_smctr.bin
231 + ttusb-budget/dspbootcode.bin
232 + emi62/bitstream.fw
233 + emi62/loader.fw
234 + emi62/midi.fw
235 + emi62/spdif.fw
236 + ti_3410.fw
237 + ti_5052.fw
238 + mts_mt9234mu.fw
239 + mts_mt9234zba.fw
240 + whiteheat.fw
241 + whiteheat_loader.fw
242 + intelliport2.bin
243 + cpia2/stv0672_vp4.bin
244 + vicam/firmware.fw
245 + edgeport/boot.fw
246 + edgeport/boot2.fw
247 + edgeport/down.fw
248 + edgeport/down2.fw
249 + edgeport/down3.bin
250 + sb16/mulaw_main.csp
251 + sb16/alaw_main.csp
252 + sb16/ima_adpcm_init.csp
253 + sb16/ima_adpcm_playback.csp
254 + sb16/ima_adpcm_capture.csp
255 + sun/cassini.bin
256 + acenic/tg1.bin
257 + acenic/tg2.bin
258 + adaptec/starfire_rx.bin
259 + adaptec/starfire_tx.bin
260 + yam/1200.bin
261 + yam/9600.bin
262 + 3com/3C359.bin
263 + ositech/Xilinx7OD.bin
264 + qlogic/isp1000.bin
265 + myricom/lanai.bin
266 + yamaha/yss225_registers.bin
267 + lgs8g75.fw
268 + )
269 +
270 + if use !unknown-license; then
271 + einfo "Removing files with unknown license ..."
272 + rm -v "${unknown_license[@]}" || die
273 + fi
274 +
275 + if use !redistributable; then
276 + # remove files _not_ in the free_software or unknown_license lists
277 + # everything else is confirmed (or assumed) to be redistributable
278 + # based on upstream acceptance policy
279 + einfo "Removing non-redistributable files ..."
280 + local OLDIFS="${IFS}"
281 + local IFS=$'\n'
282 + set -o pipefail
283 + find ! -type d -printf "%P\n" \
284 + | grep -Fvx -e "${misc_files[*]}" -e "${free_software[*]}" -e "${unknown_license[*]}" \
285 + | xargs -d '\n' --no-run-if-empty rm -v
286 +
287 + [[ ${?} -ne 0 ]] && die "Failed to remove non-redistributable files"
288 +
289 + IFS="${OLDIFS}"
290 + fi
291 +
292 + restore_config ${PN}.conf
293 +}
294 +
295 +src_install() {
296 + ./copy-firmware.sh -v "${ED}/lib/firmware" || die
297 +
298 + pushd "${ED}/lib/firmware" &>/dev/null || die
299 +
300 + # especially use !redistributable will cause some broken symlinks
301 + einfo "Removing broken symlinks ..."
302 + find * -xtype l -print -delete || die
303 +
304 + if use savedconfig; then
305 + if [[ -s "${S}/${PN}.conf" ]]; then
306 + local files_to_keep="${T}/files_to_keep.lst"
307 + grep -v '^#' "${S}/${PN}.conf" 2>/dev/null > "${files_to_keep}" || die
308 + [[ -s "${files_to_keep}" ]] || die "grep failed, empty config file?"
309 +
310 + einfo "Applying USE=savedconfig; Removing all files not listed in config ..."
311 + find ! -type d -printf "%P\n" \
312 + | grep -Fvx -f "${files_to_keep}" \
313 + | xargs -d '\n' --no-run-if-empty rm -v
314 +
315 + if [[ ${PIPESTATUS[0]} -ne 0 ]]; then
316 + die "Find failed to print installed files"
317 + elif [[ ${PIPESTATUS[1]} -eq 2 ]]; then
318 + # grep returns exit status 1 if no lines were selected
319 + # which is the case when we want to keep all files
320 + die "Grep failed to select files to keep"
321 + elif [[ ${PIPESTATUS[2]} -ne 0 ]]; then
322 + die "Failed to remove files not listed in config"
323 + fi
324 + fi
325 + fi
326 +
327 + # remove empty directories, bug #396073
328 + find -type d -empty -delete || die
329 +
330 + # sanity check
331 + if ! ( shopt -s failglob; : * ) 2>/dev/null; then
332 + eerror "No files to install. Check your USE flag settings"
333 + eerror "and the list of files in your saved configuration."
334 + die "Refusing to install an empty package"
335 + fi
336 +
337 + # create config file
338 + echo "# Remove files that shall not be installed from this list." > "${S}"/${PN}.conf || die
339 + find * ! -type d >> "${S}"/${PN}.conf || die
340 + save_config "${S}"/${PN}.conf
341 +
342 + popd &>/dev/null || die
343 +
344 + if use initramfs ; then
345 + insinto /boot
346 + doins "${S}"/amd-uc.img
347 + fi
348 +}
349 +
350 +pkg_preinst() {
351 + if use savedconfig; then
352 + ewarn "USE=savedconfig is active. You must handle file collisions manually."
353 + fi
354 +
355 + # Make sure /boot is available if needed.
356 + use initramfs && mount-boot_pkg_preinst
357 +}
358 +
359 +pkg_postinst() {
360 + elog "If you are only interested in particular firmware files, edit the saved"
361 + elog "configfile and remove those that you do not want."
362 +
363 + local ver
364 + for ver in ${REPLACING_VERSIONS}; do
365 + if ver_test ${ver} -lt 20190514; then
366 + elog
367 + elog 'Starting with version 20190514, installation of many firmware'
368 + elog 'files is controlled by USE flags. Please review your USE flag'
369 + elog 'and package.license settings if you are missing some files.'
370 + break
371 + fi
372 + done
373 +
374 + # Don't forget to umount /boot if it was previously mounted by us.
375 + use initramfs && mount-boot_pkg_postinst
376 +}
377 +
378 +pkg_prerm() {
379 + # Make sure /boot is mounted so that we can remove /boot/amd-uc.img!
380 + use initramfs && mount-boot_pkg_prerm
381 +}
382 +
383 +pkg_postrm() {
384 + # Don't forget to umount /boot if it was previously mounted by us.
385 + use initramfs && mount-boot_pkg_postrm
386 +}