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-firmware/intel-microcode/
Date: Fri, 14 May 2021 14:58:52
Message-Id: 1621004322.361f080a7e856fd871c8997289e1a9272ff4fbe0.whissi@gentoo
1 commit: 361f080a7e856fd871c8997289e1a9272ff4fbe0
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 14 14:57:22 2021 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Fri May 14 14:58:42 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=361f080a
7
8 sys-firmware/intel-microcode: bump
9
10 - New microcodes:
11
12 sig 0x000606a4, pf_mask 0x87, 2020-08-17, rev 0xb000280
13 sig 0x000606a5, pf_mask 0x87, 2021-03-08, rev 0xc0002f0
14 sig 0x000606a6, pf_mask 0x87, 2021-03-31, rev 0xd000280
15 sig 0x000806d1, pf_mask 0xc2, 2021-03-16, rev 0x0024
16 sig 0x00090670, pf_mask 0x02, 2020-11-11, rev 0x0019
17
18 - Updated microcodes:
19
20 sig 0x000406e3, pf_mask 0xc0, 2020-07-14, rev 0x00e2 -> 2021-01-25, rev 0x00ea
21 sig 0x00050657, pf_mask 0xbf, 2020-12-31, rev 0x5003006 -> 2021-01-15, rev 0x5003101
22 sig 0x000506e3, pf_mask 0x36, 2020-07-14, rev 0x00e2 -> 2021-01-25, rev 0x00ea
23 sig 0x000706e5, pf_mask 0x80, 2020-07-30, rev 0x00a0 -> 2020-11-01, rev 0x00a6
24 sig 0x000806a1, pf_mask 0x10, 2020-06-26, rev 0x0028 -> 2020-11-06, rev 0x002a
25 sig 0x000806c1, pf_mask 0x80, 2021-01-25, rev 0x0078 -> 2021-03-17, rev 0x0086
26 sig 0x000806d0, pf_mask 0xc2, 2020-12-01, rev 0x004e -> 2020-11-04, rev 0x004c
27 sig 0x000806e9, pf_mask 0xc0, 2020-05-27, rev 0x00de -> 2021-01-05, rev 0x00ea
28 sig 0x000806eb, pf_mask 0xd0, 2020-06-03, rev 0x00de -> 2021-01-05, rev 0x00ea
29 sig 0x000806ec, pf_mask 0x94, 2020-10-23, rev 0x00e4 -> 2021-01-05, rev 0x00ea
30 sig 0x000906c0, pf_mask 0x01, 2020-12-13, rev 0x0019 -> 2021-03-23, rev 0x001d
31 sig 0x000906e9, pf_mask 0x2a, 2020-05-26, rev 0x00de -> 2021-01-05, rev 0x00ea
32 sig 0x000906ea, pf_mask 0x22, 2020-05-25, rev 0x00de -> 2021-01-05, rev 0x00ea
33 sig 0x000906eb, pf_mask 0x02, 2020-05-25, rev 0x00de -> 2021-01-05, rev 0x00ea
34 sig 0x000906ec, pf_mask 0x22, 2020-06-03, rev 0x00de -> 2021-01-05, rev 0x00ea
35 sig 0x000906ed, pf_mask 0x22, 2020-05-24, rev 0x00de -> 2021-01-05, rev 0x00ea
36 sig 0x000a0653, pf_mask 0x22, 2020-07-08, rev 0x00e0 -> 2021-03-08, rev 0x00ea
37 sig 0x000a0655, pf_mask 0x22, 2020-09-14, rev 0x00e2 -> 2021-03-08, rev 0x00ec
38 sig 0x000a0660, pf_mask 0x80, 2020-07-08, rev 0x00e0 -> 2020-12-08, rev 0x00e8
39 sig 0x000a0671, pf_mask 0x02, 2021-01-28, rev 0x002c -> 2021-03-19, rev 0x003c
40
41 Package-Manager: Portage-3.0.18, Repoman-3.0.3
42 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
43
44 sys-firmware/intel-microcode/Manifest | 1 +
45 .../intel-microcode-20210216_p20210514.ebuild | 262 +++++++++++++++++++++
46 2 files changed, 263 insertions(+)
47
48 diff --git a/sys-firmware/intel-microcode/Manifest b/sys-firmware/intel-microcode/Manifest
49 index 6363e8267c1..ad796bc4647 100644
50 --- a/sys-firmware/intel-microcode/Manifest
51 +++ b/sys-firmware/intel-microcode/Manifest
52 @@ -1,5 +1,6 @@
53 DIST intel-microcode-collection-20201116.tar.xz 6506624 BLAKE2B b74ec0ddafe9681ae94d6a0df1de51655004eecae83c413fa824c9ad25cf68a25059627e2809a3b8cd5b3cb18647455385de0be2b2a7fcc6bc6c30e2ccabd1af SHA512 3a1aab0af9ff6dc95778276964b457a4429aa12f13499f6f89fa48285cf8aef9a0990099a80e360b76b2d4b6a836f2528f984aab17f12d905cf237dbab2a8b33
54 DIST intel-microcode-collection-20210221.tar.xz 6690716 BLAKE2B 09758341d20d60b739c4859442457fcc4ce563327dd7f14e8a626f49198d3beb59ef580530500a2dacb5ab9832119e8d489f553ccffc56613b31df027eb93e98 SHA512 e3bb3644c46ee41752bbd21c56e69144d23dab9162ebfe9906a07ff646b7ba57d14b0280b044bf7ceab771fe80e75d7aed3808b68b823ae19bc0c7c4a94589dd
55 +DIST intel-microcode-collection-20210514.tar.xz 7907672 BLAKE2B d5226008e50e804c0acfa648393032b08a317572be1e38743721613000dede886d3885b36f7fa4a9c061e72855fc0ad409ce3299f679afc866abda7d29c9512a SHA512 fc4fcd3e2c4f1abdf5c0d23c1c0ac2f8c572531dadbc9a070c38150ec939cd4e2b13226b86df2371eb0679cef96307262d0356f2e617773c51c53f3e440894d2
56 DIST intel-ucode-sig_0x406e3-rev_0xd6.bin 101376 BLAKE2B 66d55867954d69dda1425febd93bb8c89f7aa836d504f8b5fee127f8505bcf2246f4fcc55cc245bc5e532528d60cca2eee278de7ab5174dc2862db7982a2b36f SHA512 248066b521bf512b5d8e4a8c7e921464ce52169c954d6e4ca580d8c172cd789519e22b4cf56c212e452b4191741f0202019f7061d322c9433b5af9ce5413b567
57 DIST microcode-20201112.tar.gz 3610834 BLAKE2B 4212924f1673afded961266a25fe6063ec6cdafaa26c8bee1c42372eb8ab5f278dc2501615b23e09e2f9809bf2792a8db317c98c170bf0c5e1dd62b7dc80a084 SHA512 0875675d065a83ee14fa34a31022ee34e46aee579d1ff192414e79861af157ae269ca7c2c462f03b3accbd45590c76e5cbf4f53d7a6ed237e410213a96459211
58 DIST microcode-20210216.tar.gz 3506111 BLAKE2B e09ab59dcccc77c15545b119dcf5309e626d53649a601c49fc7d6a65d774b8016d9ad44783f75ceb4bf384a03b909bc28693ed2be9f047029342dca9beae9cae SHA512 211ed90a248c891224bb8c569e24c04410d3f67ecc6daee41dc025042bd51c257baaba0da1ac5327df76352d2b53d812e81f06cc8726e43b95ea2f8898bc00bf
59
60 diff --git a/sys-firmware/intel-microcode/intel-microcode-20210216_p20210514.ebuild b/sys-firmware/intel-microcode/intel-microcode-20210216_p20210514.ebuild
61 new file mode 100644
62 index 00000000000..0a8e3fc79f0
63 --- /dev/null
64 +++ b/sys-firmware/intel-microcode/intel-microcode-20210216_p20210514.ebuild
65 @@ -0,0 +1,262 @@
66 +# Copyright 1999-2021 Gentoo Authors
67 +# Distributed under the terms of the GNU General Public License v2
68 +
69 +EAPI="7"
70 +
71 +inherit linux-info toolchain-funcs mount-boot
72 +
73 +# Find updates by searching and clicking the first link (hopefully it's the one):
74 +# https://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File
75 +
76 +COLLECTION_SNAPSHOT="${PV##*_p}"
77 +INTEL_SNAPSHOT="${PV/_p*}"
78 +#NUM="28087"
79 +#https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=${NUM}
80 +#https://downloadmirror.intel.com/${NUM}/eng/microcode-${INTEL_SNAPSHOT}.tgz
81 +DESCRIPTION="Intel IA32/IA64 microcode update data"
82 +HOMEPAGE="https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files http://inertiawar.com/microcode/"
83 +SRC_URI="https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/archive/microcode-${INTEL_SNAPSHOT}.tar.gz
84 + https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/raw/437f382b1be4412b9d03e2bbdcda46d83d581242/intel-ucode/06-4e-03 -> intel-ucode-sig_0x406e3-rev_0xd6.bin
85 + https://dev.gentoo.org/~whissi/dist/intel-microcode/intel-microcode-collection-${COLLECTION_SNAPSHOT}.tar.xz"
86 +
87 +LICENSE="intel-ucode"
88 +SLOT="0"
89 +KEYWORDS="-* amd64 x86"
90 +IUSE="hostonly initramfs +split-ucode vanilla"
91 +REQUIRED_USE="|| ( initramfs split-ucode )"
92 +
93 +BDEPEND=">=sys-apps/iucode_tool-2.3"
94 +
95 +# !<sys-apps/microcode-ctl-1.17-r2 due to bug #268586
96 +RDEPEND="hostonly? ( sys-apps/iucode_tool )"
97 +
98 +RESTRICT="binchecks bindist mirror strip"
99 +
100 +S=${WORKDIR}
101 +
102 +# Blacklist bad microcode here.
103 +# 0x000406f1 aka 06-4f-01 aka CPUID 406F1 require newer microcode loader
104 +MICROCODE_BLACKLIST_DEFAULT="-s !0x000406f1"
105 +
106 +# https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/issues/31
107 +MICROCODE_BLACKLIST_DEFAULT+=" -s !0x000406e3,0xc0,eq:0x00dc"
108 +
109 +# https://bugs.gentoo.org/722768
110 +MICROCODE_BLACKLIST_DEFAULT+=" -s !0x000406e3,0xc0,eq:0x00da"
111 +
112 +# https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/commit/49bb67f32a2e3e631ba1a9a73da1c52e1cac7fd9
113 +MICROCODE_BLACKLIST_DEFAULT+=" -s !0x000806c1,0x80,eq:0x0068"
114 +
115 +# In case we want to set some defaults ...
116 +MICROCODE_SIGNATURES_DEFAULT=""
117 +
118 +# Advanced users only!
119 +# Set MIRCOCODE_SIGNATURES to merge with:
120 +# only current CPU: MICROCODE_SIGNATURES="-S"
121 +# only specific CPU: MICROCODE_SIGNATURES="-s 0x00000f4a -s 0x00010676"
122 +# exclude specific CPU: MICROCODE_SIGNATURES="-s !0x00000686"
123 +
124 +pkg_pretend() {
125 + use initramfs && mount-boot_pkg_pretend
126 +}
127 +
128 +src_prepare() {
129 + default
130 +
131 + if cd Intel-Linux-Processor-Microcode-Data* &>/dev/null; then
132 + # new tarball format from GitHub
133 + mv * ../ || die "Failed to move Intel-Linux-Processor-Microcode-Data*"
134 + cd .. || die
135 + rm -r Intel-Linux-Processor-Microcode-Data* || die
136 + fi
137 +
138 + mkdir intel-ucode-old || die
139 + cp "${DISTDIR}"/intel-ucode-sig_0x406e3-rev_0xd6.bin "${S}"/intel-ucode-old/ || die
140 +
141 + # Prevent "invalid file format" errors from iucode_tool
142 + rm -f "${S}"/intel-ucod*/list || die
143 +}
144 +
145 +src_install() {
146 + # This will take ALL of the upstream microcode sources:
147 + # - microcode.dat
148 + # - intel-ucode/
149 + # In some cases, they have not contained the same content (eg the directory has newer stuff).
150 + MICROCODE_SRC=(
151 + "${S}"/intel-ucode/
152 + "${S}"/intel-ucode-with-caveats/
153 + "${S}"/intel-ucode-old/
154 + )
155 +
156 + # Allow users who are scared about microcode updates not included in Intel's official
157 + # microcode tarball to opt-out and comply with Intel marketing
158 + if ! use vanilla; then
159 + MICROCODE_SRC+=( "${S}"/intel-microcode-collection-${COLLECTION_SNAPSHOT} )
160 + fi
161 +
162 + # These will carry into pkg_preinst via env saving.
163 + : ${MICROCODE_BLACKLIST=${MICROCODE_BLACKLIST_DEFAULT}}
164 + : ${MICROCODE_SIGNATURES=${MICROCODE_SIGNATUES_DEFAULT}}
165 +
166 + opts=(
167 + ${MICROCODE_BLACKLIST}
168 + ${MICROCODE_SIGNATURES}
169 + # be strict about what we are doing
170 + --overwrite
171 + --strict-checks
172 + --no-ignore-broken
173 + # we want to install latest version
174 + --no-downgrade
175 + # show everything we find
176 + --list-all
177 + # show what we selected
178 + --list
179 + )
180 +
181 + # The earlyfw cpio needs to be in /boot because it must be loaded before
182 + # rootfs is mounted.
183 + use initramfs && dodir /boot && opts+=( --write-earlyfw="${ED}/boot/intel-uc.img" )
184 +
185 + keepdir /lib/firmware/intel-ucode
186 + opts+=( --write-firmware="${ED}/lib/firmware/intel-ucode" )
187 +
188 + iucode_tool \
189 + "${opts[@]}" \
190 + "${MICROCODE_SRC[@]}" \
191 + || die "iucode_tool ${opts[@]} ${MICROCODE_SRC[@]}"
192 +
193 + dodoc releasenote.md
194 +}
195 +
196 +pkg_preinst() {
197 + if [[ ${MICROCODE_BLACKLIST} != ${MICROCODE_BLACKLIST_DEFAULT} ]]; then
198 + ewarn "MICROCODE_BLACKLIST is set to \"${MICROCODE_BLACKLIST}\" instead of default \"${MICROCODE_BLACKLIST_DEFAULT}\". You are on your own!"
199 + fi
200 +
201 + if [[ ${MICROCODE_SIGNATURES} != ${MICROCODE_SIGNATURES_DEFAULT} ]]; then
202 + ewarn "Package was created using advanced options:"
203 + ewarn "MICROCODE_SIGNATURES is set to \"${MICROCODE_SIGNATURES}\" instead of default \"${MICROCODE_SIGNATURES_DEFAULT}\"!"
204 + fi
205 +
206 + # Make sure /boot is available if needed.
207 + use initramfs && mount-boot_pkg_preinst
208 +
209 + local _initramfs_file="${ED}/boot/intel-uc.img"
210 +
211 + if use hostonly; then
212 + # While this output looks redundant we do this check to detect
213 + # rare cases where iucode_tool was unable to detect system's processor(s).
214 + local _detected_processors=$(iucode_tool --scan-system 2>&1)
215 + if [[ -z "${_detected_processors}" ]]; then
216 + ewarn "Looks like iucode_tool was unable to detect any processor!"
217 + else
218 + einfo "Only installing ucode(s) for ${_detected_processors#iucode_tool: system has } due to USE=hostonly ..."
219 + fi
220 +
221 + opts=(
222 + --scan-system
223 + # be strict about what we are doing
224 + --overwrite
225 + --strict-checks
226 + --no-ignore-broken
227 + # we want to install latest version
228 + --no-downgrade
229 + # show everything we find
230 + --list-all
231 + # show what we selected
232 + --list
233 + )
234 +
235 + # The earlyfw cpio needs to be in /boot because it must be loaded before
236 + # rootfs is mounted.
237 + use initramfs && opts+=( --write-earlyfw=${_initramfs_file} )
238 +
239 + if use split-ucode; then
240 + opts+=( --write-firmware="${ED}/lib/firmware/intel-ucode" )
241 + fi
242 +
243 + opts+=( "${ED}/lib/firmware/intel-ucode-temp" )
244 +
245 + mv "${ED}"/lib/firmware/intel-ucode{,-temp} || die
246 + keepdir /lib/firmware/intel-ucode
247 +
248 + iucode_tool "${opts[@]}" || die "iucode_tool ${opts[@]}"
249 +
250 + rm -r "${ED}"/lib/firmware/intel-ucode-temp || die
251 +
252 + elif ! use split-ucode; then # hostonly disabled
253 + rm -r "${ED}"/lib/firmware/intel-ucode || die
254 + fi
255 +
256 + # Because it is possible that this package will install not one single file
257 + # due to user selection which is still somehow unexpected we add the following
258 + # check to inform user so that the user has at least a chance to detect
259 + # a problem/invalid select.
260 + local _has_installed_something=
261 + if use initramfs && [[ -s "${_initramfs_file}" ]]; then
262 + _has_installed_something="yes"
263 + elif use split-ucode; then
264 + _has_installed_something=$(find "${ED}/lib/firmware/intel-ucode" -maxdepth 0 -not -empty -exec echo yes \;)
265 + fi
266 +
267 + if use hostonly && [[ -n "${_has_installed_something}" ]]; then
268 + elog "You only installed ucode(s) for all currently available (=online)"
269 + elog "processor(s). Remember to re-emerge this package whenever you"
270 + elog "change the system's processor model."
271 + elog ""
272 + elif [[ -z "${_has_installed_something}" ]]; then
273 + ewarn "WARNING:"
274 + if [[ ${MICROCODE_SIGNATURES} != ${MICROCODE_SIGNATURES_DEFAULT} ]]; then
275 + ewarn "No ucode was installed! Because you have created this package"
276 + ewarn "using MICROCODE_SIGNATURES variable please double check if you"
277 + ewarn "have an invalid select."
278 + ewarn "It's rare but it is also possible that just no ucode update"
279 + ewarn "is available for your processor(s). In this case it is safe"
280 + ewarn "to ignore this warning."
281 + else
282 + ewarn "No ucode was installed! It's rare but it is also possible"
283 + ewarn "that just no ucode update is available for your processor(s)."
284 + ewarn "In this case it is safe to ignore this warning."
285 + fi
286 +
287 + ewarn ""
288 +
289 + if use hostonly; then
290 + ewarn "Unset \"hostonly\" USE flag to install all available ucodes."
291 + ewarn ""
292 + fi
293 + fi
294 +}
295 +
296 +pkg_prerm() {
297 + # Make sure /boot is mounted so that we can remove /boot/intel-uc.img!
298 + use initramfs && mount-boot_pkg_prerm
299 +}
300 +
301 +pkg_postrm() {
302 + # Don't forget to umount /boot if it was previously mounted by us.
303 + use initramfs && mount-boot_pkg_postrm
304 +}
305 +
306 +pkg_postinst() {
307 + # Don't forget to umount /boot if it was previously mounted by us.
308 + use initramfs && mount-boot_pkg_postinst
309 +
310 + # We cannot give detailed information if user is affected or not:
311 + # If MICROCODE_BLACKLIST wasn't modified, user can still use MICROCODE_SIGNATURES
312 + # to to force a specific, otherwise blacklisted, microcode. So we
313 + # only show a generic warning based on running kernel version:
314 + if kernel_is -lt 4 14 34; then
315 + ewarn "${P} contains microcode updates which require"
316 + ewarn "additional kernel patches which aren't yet included in kernel <4.14.34."
317 + ewarn "Loading such a microcode through kernel interface from an unpatched kernel"
318 + ewarn "can crash your system!"
319 + ewarn ""
320 + ewarn "Those microcodes are blacklisted per default. However, if you have altered"
321 + ewarn "MICROCODE_BLACKLIST or MICROCODE_SIGNATURES, you maybe have unintentionally"
322 + ewarn "re-enabled those microcodes...!"
323 + ewarn ""
324 + ewarn "Check \"${EROOT}/usr/share/doc/${PN}-*/releasenot*\" if your microcode update"
325 + ewarn "requires additional kernel patches or not."
326 + fi
327 +}