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