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