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