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