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, 18 Aug 2020 13:52:09
Message-Id: 1597758721.73d48347d4b50bf4b4eea5958f63b6df0e2babe3.whissi@gentoo
1 commit: 73d48347d4b50bf4b4eea5958f63b6df0e2babe3
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 18 13:51:50 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 18 13:52:01 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=73d48347
7
8 sys-kernel/linux-firmware: new snapshot
9
10 Package-Manager: Portage-3.0.3, Repoman-3.0.0
11 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
12
13 sys-kernel/linux-firmware/Manifest | 1 +
14 .../linux-firmware/linux-firmware-20200817.ebuild | 342 +++++++++++++++++++++
15 2 files changed, 343 insertions(+)
16
17 diff --git a/sys-kernel/linux-firmware/Manifest b/sys-kernel/linux-firmware/Manifest
18 index b529eb8d8a1..d94907c331a 100644
19 --- a/sys-kernel/linux-firmware/Manifest
20 +++ b/sys-kernel/linux-firmware/Manifest
21 @@ -3,3 +3,4 @@ DIST linux-firmware-20200421.tar.xz 98988760 BLAKE2B 171c8fdbf0724d1cf851a6daa44
22 DIST linux-firmware-20200519.tar.xz 101137720 BLAKE2B b73744d4f8d0fc74fb1388ee13c04e44db8ee68f51ceb0c5ad363b2dfa4b381806b18c3f2a926b6ee13e290db874ea41b3388d647a662f462eebfe93051bd95b SHA512 88fad2a87cfad329d89e266eee3f5afcf6d0b3bc29510e6ba7ca96a9e18ff9e8e15a7895d600d289bf2ba0c73a908affdd68697fd3f1753e22d9920f9d859e81
23 DIST linux-firmware-20200619.tar.xz 117836800 BLAKE2B 09312c70f81791f91547cf815ca0f07297c7ea4c527996504008e4c9dcc9d17c1eea192a646efc89146de62e886ccbf916a041247d642265ca375252e6af825e SHA512 8433646f2837fb5f52b2303316329f7c05423642085288f219d9955588441d50d6901cd31e0705a08453bda1882596ae6d8f8f922520579695f1b36b774b404b
24 DIST linux-firmware-20200721.tar.xz 118013188 BLAKE2B 648f22d63e8e8a791e3243f9afb2d097fb206cfa1c1fd37fede0fd555d4b7cf6af6b27f4d67e4dc32a6c70fc25c6aee813dc330b4861dbd13373f703a04edd1a SHA512 1dbbf92efd1ac282a72e2f7483c9b35fe3ec348ab3f6062edb34b7922b6c1a007851a87b1835ece16d3cf147fb20ce8602a0262b0c8c94902728ac2f108796e9
25 +DIST linux-firmware-20200817.tar.xz 121401548 BLAKE2B 77a9ddbab368994801c5f834b65e0c991798eb5ecaeecb84a5b69e886f7aae6e6186f60ebdd4f18449ffe639fb8230c3db108151026161ab23740da63be928a2 SHA512 dba347534d1b51ebcc55600c05293fad5f04f0bfdaec80b2ba27b40a9a20eb5c8bd76cb29d8ca6c814b067952cba4ee3fdb903510a171df98959d592b2c00c13
26
27 diff --git a/sys-kernel/linux-firmware/linux-firmware-20200817.ebuild b/sys-kernel/linux-firmware/linux-firmware-20200817.ebuild
28 new file mode 100644
29 index 00000000000..736bd949345
30 --- /dev/null
31 +++ b/sys-kernel/linux-firmware/linux-firmware-20200817.ebuild
32 @@ -0,0 +1,342 @@
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 +# 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 +RESTRICT="binchecks strip
66 + unknown-license? ( bindist )"
67 +
68 +REQUIRED_USE="initramfs? ( redistributable )"
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 + )
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 +pkg_pretend() {
96 + use initramfs && mount-boot_pkg_pretend
97 +}
98 +
99 +src_unpack() {
100 + if [[ ${PV} == 99999999* ]]; then
101 + git-r3_src_unpack
102 + else
103 + default
104 + # rename directory from git snapshot tarball
105 + if [[ ${#GIT_COMMIT} -gt 8 ]]; then
106 + mv ${PN}-*/ ${P} || die
107 + fi
108 + fi
109 +}
110 +
111 +src_prepare() {
112 + # source and documentation files, not to be installed
113 + local source_files=(
114 + README
115 + WHENCE
116 + "LICEN[CS]E*"
117 + "GPL*"
118 + configure
119 + Makefile
120 + check_whence.py
121 + atusb/ChangeLog
122 + av7110/Boot.S
123 + av7110/Makefile
124 + carl9170fw/
125 + cis/Makefile
126 + cis/src/
127 + dsp56k/bootstrap.asm
128 + dsp56k/concat-bootstrap.pl
129 + dsp56k/Makefile
130 + "isci/*.[ch]"
131 + isci/Makefile
132 + isci/README
133 + "keyspan_pda/*.S"
134 + keyspan_pda/Makefile
135 + usbdux/
136 + )
137 +
138 + # whitelist of images with a free software license
139 + local free_software=(
140 + # keyspan_pda (GPL-2+)
141 + keyspan_pda/keyspan_pda.fw
142 + keyspan_pda/xircom_pgs.fw
143 + # dsp56k (GPL-2+)
144 + dsp56k/bootstrap.bin
145 + # ath9k_htc (BSD GPL-2+ MIT)
146 + ath9k_htc/htc_7010-1.4.0.fw
147 + ath9k_htc/htc_9271-1.4.0.fw
148 + # pcnet_cs, 3c589_cs, 3c574_cs, serial_cs (dual GPL-2/MPL-1.1)
149 + cis/LA-PCM.cis
150 + cis/PCMLM28.cis
151 + cis/DP83903.cis
152 + cis/NE2K.cis
153 + cis/tamarack.cis
154 + cis/PE-200.cis
155 + cis/PE520.cis
156 + cis/3CXEM556.cis
157 + cis/3CCFEM556.cis
158 + cis/MT5634ZLX.cis
159 + cis/RS-COM-2P.cis
160 + cis/COMpad2.cis
161 + cis/COMpad4.cis
162 + # serial_cs (GPL-3)
163 + cis/SW_555_SER.cis
164 + cis/SW_7xx_SER.cis
165 + cis/SW_8xx_SER.cis
166 + # dvb-ttpci (GPL-2+)
167 + av7110/bootcode.bin
168 + # usbdux, usbduxfast, usbduxsigma (GPL-2+)
169 + usbdux_firmware.bin
170 + usbduxfast_firmware.bin
171 + usbduxsigma_firmware.bin
172 + # brcmfmac (GPL-2+)
173 + brcm/brcmfmac4330-sdio.Prowise-PT301.txt
174 + brcm/brcmfmac43340-sdio.meegopad-t08.txt
175 + brcm/brcmfmac43362-sdio.cubietech,cubietruck.txt
176 + brcm/brcmfmac43362-sdio.lemaker,bananapro.txt
177 + brcm/brcmfmac43430a0-sdio.jumper-ezpad-mini3.txt
178 + "brcm/brcmfmac43430a0-sdio.ONDA-V80 PLUS.txt"
179 + brcm/brcmfmac43430-sdio.AP6212.txt
180 + brcm/brcmfmac43430-sdio.Hampoo-D2D3_Vi8A1.txt
181 + brcm/brcmfmac43430-sdio.MUR1DX.txt
182 + brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.txt
183 + brcm/brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt
184 + brcm/brcmfmac4356-pcie.gpd-win-pocket.txt
185 + # isci (GPL-2)
186 + isci/isci_firmware.bin
187 + # carl9170 (GPL-2+)
188 + carl9170-1.fw
189 + # atusb (GPL-2+)
190 + atusb/atusb-0.2.dfu
191 + atusb/atusb-0.3.dfu
192 + atusb/rzusb-0.3.bin
193 + # mlxsw_spectrum (dual BSD/GPL-2)
194 + mellanox/mlxsw_spectrum-13.1420.122.mfa2
195 + mellanox/mlxsw_spectrum-13.1530.152.mfa2
196 + mellanox/mlxsw_spectrum-13.1620.192.mfa2
197 + mellanox/mlxsw_spectrum-13.1702.6.mfa2
198 + mellanox/mlxsw_spectrum-13.1703.4.mfa2
199 + mellanox/mlxsw_spectrum-13.1910.622.mfa2
200 + mellanox/mlxsw_spectrum-13.2000.1122.mfa2
201 + )
202 +
203 + # blacklist of images with unknown license
204 + local unknown_license=(
205 + atmsar11.fw
206 + korg/k1212.dsp
207 + ess/maestro3_assp_kernel.fw
208 + ess/maestro3_assp_minisrc.fw
209 + yamaha/ds1_ctrl.fw
210 + yamaha/ds1_dsp.fw
211 + yamaha/ds1e_ctrl.fw
212 + tr_smctr.bin
213 + ttusb-budget/dspbootcode.bin
214 + emi62/bitstream.fw
215 + emi62/loader.fw
216 + emi62/midi.fw
217 + emi62/spdif.fw
218 + ti_3410.fw
219 + ti_5052.fw
220 + mts_mt9234mu.fw
221 + mts_mt9234zba.fw
222 + whiteheat.fw
223 + whiteheat_loader.fw
224 + intelliport2.bin
225 + cpia2/stv0672_vp4.bin
226 + vicam/firmware.fw
227 + edgeport/boot.fw
228 + edgeport/boot2.fw
229 + edgeport/down.fw
230 + edgeport/down2.fw
231 + edgeport/down3.bin
232 + sb16/mulaw_main.csp
233 + sb16/alaw_main.csp
234 + sb16/ima_adpcm_init.csp
235 + sb16/ima_adpcm_playback.csp
236 + sb16/ima_adpcm_capture.csp
237 + sun/cassini.bin
238 + acenic/tg1.bin
239 + acenic/tg2.bin
240 + adaptec/starfire_rx.bin
241 + adaptec/starfire_tx.bin
242 + yam/1200.bin
243 + yam/9600.bin
244 + 3com/3C359.bin
245 + ositech/Xilinx7OD.bin
246 + qlogic/isp1000.bin
247 + myricom/lanai.bin
248 + yamaha/yss225_registers.bin
249 + lgs8g75.fw
250 + )
251 +
252 + default
253 +
254 + # remove sources and documentation (wildcards are expanded)
255 + rm -r ${source_files[@]} || die
256 + rm -rf .git
257 +
258 + if use !unknown-license; then
259 + # remove files in unknown_license
260 + rm "${unknown_license[@]}" || die
261 + fi
262 +
263 + if use !redistributable; then
264 + # remove files _not_ in the free_software or unknown_license lists
265 + # everything else is confirmed (or assumed) to be redistributable
266 + # based on upstream acceptance policy
267 + local IFS=$'\n'
268 + find ! -type d -printf "%P\n" \
269 + | grep -Fvx -e "${free_software[*]}" -e "${unknown_license[*]}" \
270 + | xargs -d '\n' rm || die
271 + IFS=$' \t\n'
272 + fi
273 +
274 + if use initramfs; then
275 + if [[ -d "${S}/amd-ucode" ]]; then
276 + local UCODETMP="${T}/ucode_tmp"
277 + local UCODEDIR="${UCODETMP}/kernel/x86/microcode"
278 + mkdir -p "${UCODEDIR}" || die
279 + echo 1 > "${UCODETMP}/early_cpio"
280 +
281 + local amd_ucode_file="${UCODEDIR}/AuthenticAMD.bin"
282 + cat "${S}"/amd-ucode/*.bin > "${amd_ucode_file}" || die "Failed to concat amd cpu ucode"
283 +
284 + if [[ ! -s "${amd_ucode_file}" ]]; then
285 + die "Sanity check failed: '${amd_ucode_file}' is empty!"
286 + fi
287 +
288 + pushd "${UCODETMP}" &>/dev/null || die
289 + find . -print0 | cpio --quiet --null -o -H newc -R 0:0 > "${S}"/amd-uc.img
290 + popd &>/dev/null || die
291 + if [[ ! -s "${S}/amd-uc.img" ]]; then
292 + die "Failed to create '${S}/amd-uc.img'!"
293 + fi
294 + else
295 + # If this will ever happen something has changed which
296 + # must be reviewed
297 + die "'${S}/amd-ucode' not found!"
298 + fi
299 + fi
300 +
301 + echo "# Remove files that shall not be installed from this list." > ${PN}.conf
302 + find * ! -type d ! \( -name ${PN}.conf -o -name amd-uc.img \) >> ${PN}.conf
303 +
304 + if use savedconfig; then
305 + restore_config ${PN}.conf
306 +
307 + ebegin "Removing all files not listed in config"
308 + find ! -type d ! \( -name ${PN}.conf -o -name amd-uc.img \) -printf "%P\n" \
309 + | grep -Fvx -f <(grep -v '^#' ${PN}.conf \
310 + || die "grep failed, empty config file?") \
311 + | xargs -d '\n' --no-run-if-empty rm
312 + eend $? || die
313 + fi
314 +
315 + # remove empty directories, bug #396073
316 + find -type d -empty -delete || die
317 +}
318 +
319 +src_install() {
320 + save_config ${PN}.conf
321 + rm ${PN}.conf || die
322 +
323 + if use initramfs ; then
324 + mkdir "${ED}/boot" || die
325 + mv "${S}"/amd-uc.img "${ED}/boot" || die
326 + fi
327 +
328 + if ! ( shopt -s failglob; : * ) 2>/dev/null; then
329 + eerror "No files to install. Check your USE flag settings"
330 + eerror "and the list of files in your saved configuration."
331 + die "Refusing to install an empty package"
332 + fi
333 +
334 + insinto /lib/firmware/
335 + doins -r *
336 +}
337 +
338 +pkg_preinst() {
339 + if use savedconfig; then
340 + ewarn "USE=savedconfig is active. You must handle file collisions manually."
341 + fi
342 +
343 + # Make sure /boot is available if needed.
344 + use initramfs && mount-boot_pkg_preinst
345 +}
346 +
347 +pkg_postinst() {
348 + elog "If you are only interested in particular firmware files, edit the saved"
349 + elog "configfile and remove those that you do not want."
350 +
351 + local ver
352 + for ver in ${REPLACING_VERSIONS}; do
353 + if ver_test ${ver} -lt 20190514; then
354 + elog
355 + elog 'Starting with version 20190514, installation of many firmware'
356 + elog 'files is controlled by USE flags. Please review your USE flag'
357 + elog 'and package.license settings if you are missing some files.'
358 + break
359 + fi
360 + done
361 +
362 + # Don't forget to umount /boot if it was previously mounted by us.
363 + use initramfs && mount-boot_pkg_postinst
364 +}
365 +
366 +pkg_prerm() {
367 + # Make sure /boot is mounted so that we can remove /boot/amd-uc.img!
368 + use initramfs && mount-boot_pkg_prerm
369 +}
370 +
371 +pkg_postrm() {
372 + # Don't forget to umount /boot if it was previously mounted by us.
373 + use initramfs && mount-boot_pkg_postrm
374 +}