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