1 |
commit: 4fb4eed6c4eb582c3e07099a8577a1a3ab7a52a7 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jan 14 02:38:49 2019 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 14 02:38:49 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4fb4eed6 |
7 |
|
8 |
sys-firmware/intel-microcode: drop old |
9 |
|
10 |
Package-Manager: Portage-2.3.55, Repoman-2.3.12 |
11 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
12 |
|
13 |
sys-firmware/intel-microcode/Manifest | 2 - |
14 |
.../intel-microcode-20180807a_p20181117.ebuild | 253 --------------------- |
15 |
.../intel-microcode-20180807a_p20181215.ebuild | 239 ------------------- |
16 |
3 files changed, 494 deletions(-) |
17 |
|
18 |
diff --git a/sys-firmware/intel-microcode/Manifest b/sys-firmware/intel-microcode/Manifest |
19 |
index c35614983ee..e6f978da207 100644 |
20 |
--- a/sys-firmware/intel-microcode/Manifest |
21 |
+++ b/sys-firmware/intel-microcode/Manifest |
22 |
@@ -1,4 +1,2 @@ |
23 |
-DIST intel-microcode-collection-20181117.tar.xz 4454740 BLAKE2B c9f106a6c6477966d535faef6a6a6a547218b0162ed6405dd9ab47967a87b2c4d9d2d33e8caf716720179bb0035df8c4a38d06c654584396f2af82828fcabd5e SHA512 cdff0e9d88c7848746487710c17cbcdf2adb0940072d71d6f32651a7e2fb66751409856e28d36e7e156e1bae08ad6575098972572bf809db5f07023870b2b9c6 |
24 |
-DIST intel-microcode-collection-20181215.tar.xz 4455584 BLAKE2B 7535283f38ce82cc7e90f45e3201665e46b3c00becd3f6432843c3d960f0a8f11b8c394bc736e7c02e9e34ea31832bd7335603f8727f114f5d3eafa7fb6ea630 SHA512 ec32ef3c625426c98902b7716abc400001c440b8136f13ba89e0dd707690f82dd5afd8849b61f86507b3a78ef7a96b8750dca24fdf4c42b53275fa87e50ed561 |
25 |
DIST intel-microcode-collection-20190112.tar.xz 4748576 BLAKE2B a6db3a1b357bdd1db65885b0de0d8a871573b6ec025eaff6c8991ef03eed6f32f298ecb736b42e09a94ca880ace984b276672245f5651982093d405abd588712 SHA512 6602772bd44aa9fad27275d515f73db041c3e18964fdfbea8d5f7917d456e5a5ca343999b7a9b48245b115290490c525e24cd575532ba8b2169a8229a69b9fa4 |
26 |
DIST microcode-20180807a.tgz 1628061 BLAKE2B a6b5a07596a0b1687efb95c207b2194865b2f975cc0d761a687d5b9d8fea63e777eb73373113f356a18592fd53651cf37d044d4e98cdfe6b306393b54ac06129 SHA512 3cd6794a5ce26e86f7b644e523ba978699316046e593da215b73b17c4b43049ac4a81636e2ce3e727d06c2efbac98657764aa3ff355edb429127585bb49a9b10 |
27 |
|
28 |
diff --git a/sys-firmware/intel-microcode/intel-microcode-20180807a_p20181117.ebuild b/sys-firmware/intel-microcode/intel-microcode-20180807a_p20181117.ebuild |
29 |
deleted file mode 100644 |
30 |
index cf35c112d2d..00000000000 |
31 |
--- a/sys-firmware/intel-microcode/intel-microcode-20180807a_p20181117.ebuild |
32 |
+++ /dev/null |
33 |
@@ -1,253 +0,0 @@ |
34 |
-# Copyright 1999-2018 Gentoo Authors |
35 |
-# Distributed under the terms of the GNU General Public License v2 |
36 |
- |
37 |
-EAPI="6" |
38 |
- |
39 |
-inherit linux-info toolchain-funcs mount-boot |
40 |
- |
41 |
-# Find updates by searching and clicking the first link (hopefully it's the one): |
42 |
-# https://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File |
43 |
- |
44 |
-COLLECTION_SNAPSHOT="${PV##*_p}" |
45 |
-INTEL_SNAPSHOT="${PV/_p*}" |
46 |
-NUM="28087" |
47 |
-DESCRIPTION="Intel IA32/IA64 microcode update data" |
48 |
-HOMEPAGE="http://inertiawar.com/microcode/ https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=${NUM}" |
49 |
-SRC_URI="https://downloadmirror.intel.com/${NUM}/eng/microcode-${INTEL_SNAPSHOT}.tgz |
50 |
- https://dev.gentoo.org/~whissi/dist/intel-microcode/intel-microcode-collection-${COLLECTION_SNAPSHOT}.tar.xz" |
51 |
- |
52 |
-LICENSE="intel-ucode" |
53 |
-SLOT="0" |
54 |
-KEYWORDS="-* amd64 x86" |
55 |
-IUSE="hostonly initramfs +split-ucode vanilla" |
56 |
-REQUIRED_USE="|| ( initramfs split-ucode )" |
57 |
- |
58 |
-DEPEND="sys-apps/iucode_tool" |
59 |
- |
60 |
-# !<sys-apps/microcode-ctl-1.17-r2 due to bug #268586 |
61 |
-RDEPEND="hostonly? ( sys-apps/iucode_tool )" |
62 |
- |
63 |
-RESTRICT="binchecks bindist mirror strip" |
64 |
- |
65 |
-S=${WORKDIR} |
66 |
- |
67 |
-# Blacklist bad microcode here. |
68 |
-# 0x000406f1 aka 06-4f-01 aka CPUID 406F1 require newer microcode loader |
69 |
-MICROCODE_BLACKLIST_DEFAULT="-s !0x000406f1" |
70 |
-MICROCODE_BLACKLIST="${MICROCODE_BLACKLIST:=${MICROCODE_BLACKLIST_DEFAULT}}" |
71 |
- |
72 |
-# In case we want to set some defaults ... |
73 |
-MICROCODE_SIGNATURES_DEFAULT="" |
74 |
- |
75 |
-# Advanced users only: |
76 |
-# merge with: |
77 |
-# only current CPU: MICROCODE_SIGNATURES="-S" |
78 |
-# only specific CPU: MICROCODE_SIGNATURES="-s 0x00000f4a -s 0x00010676" |
79 |
-# exclude specific CPU: MICROCODE_SIGNATURES="-s !0x00000686" |
80 |
-MICROCODE_SIGNATURES="${MICROCODE_SIGNATURES:=${MICROCODE_SIGNATURES_DEFAULT}}" |
81 |
- |
82 |
-pkg_pretend() { |
83 |
- use initramfs && mount-boot_pkg_pretend |
84 |
-} |
85 |
- |
86 |
-src_prepare() { |
87 |
- default |
88 |
- |
89 |
- # Prevent "invalid file format" errors from iucode_tool |
90 |
- rm -f "${S}"/intel-ucod*/list || die |
91 |
-} |
92 |
- |
93 |
-src_install() { |
94 |
- # This will take ALL of the upstream microcode sources: |
95 |
- # - microcode.dat |
96 |
- # - intel-ucode/ |
97 |
- # In some cases, they have not contained the same content (eg the directory has newer stuff). |
98 |
- MICROCODE_SRC=( |
99 |
- "${S}"/intel-ucode/ |
100 |
- "${S}"/intel-ucode-with-caveats/ |
101 |
- ) |
102 |
- |
103 |
- # Allow users who are scared about microcode updates not included in Intel's official |
104 |
- # microcode tarball to opt-out and comply with Intel marketing |
105 |
- if ! use vanilla; then |
106 |
- MICROCODE_SRC+=( "${S}"/intel-microcode-collection-${COLLECTION_SNAPSHOT} ) |
107 |
- fi |
108 |
- |
109 |
- opts=( |
110 |
- ${MICROCODE_BLACKLIST} |
111 |
- ${MICROCODE_SIGNATURES} |
112 |
- # be strict about what we are doing |
113 |
- --overwrite |
114 |
- --strict-checks |
115 |
- --no-ignore-broken |
116 |
- # we want to install latest version |
117 |
- --no-downgrade |
118 |
- # show everything we find |
119 |
- --list-all |
120 |
- # show what we selected |
121 |
- --list |
122 |
- ) |
123 |
- |
124 |
- # The earlyfw cpio needs to be in /boot because it must be loaded before |
125 |
- # rootfs is mounted. |
126 |
- use initramfs && dodir /boot && opts+=( --write-earlyfw="${ED%/}"/boot/intel-uc.img ) |
127 |
- # split location (we use a temporary location so that we are able |
128 |
- # to re-run iucode_tool in pkg_preinst; use keepdir instead of dodir to carry |
129 |
- # this folder to pkg_preinst to avoid an error even if no microcode was selected): |
130 |
- keepdir /tmp/intel-ucode && opts+=( --write-firmware="${ED%/}"/tmp/intel-ucode ) |
131 |
- |
132 |
- iucode_tool \ |
133 |
- "${opts[@]}" \ |
134 |
- "${MICROCODE_SRC[@]}" \ |
135 |
- || die "iucode_tool ${opts[@]} ${MICROCODE_SRC[@]}" |
136 |
- |
137 |
- dodoc releasenote |
138 |
- |
139 |
- # Record how package was created so we can show this in build.log |
140 |
- # even for binary packages. |
141 |
- if [[ "${MICROCODE_BLACKLIST}" != "${MICROCODE_BLACKLIST_DEFAULT}" ]]; then |
142 |
- echo ${MICROCODE_BLACKLIST} > "${ED%/}/tmp/.blacklist_altered" || die "Failed to add marker that MICROCODE_BLACKLIST variable was used" |
143 |
- fi |
144 |
- |
145 |
- if [[ "${MICROCODE_SIGNATURES}" != "${MICROCODE_SIGNATURES_DEFAULT}" ]]; then |
146 |
- echo ${MICROCODE_SIGNATURES} > "${ED%/}/tmp/.signatures_altered" || die "Failed to add marker that MICROCODE_SIGNATURES variable was used" |
147 |
- fi |
148 |
-} |
149 |
- |
150 |
-pkg_preinst() { |
151 |
- if [[ -f "${ED%/}/tmp/.blacklist_altered" ]]; then |
152 |
- local _recorded_MICROCODE_BLACKLIST_value=$(cat "${ED%/}/tmp/.blacklist_altered") |
153 |
- ewarn "MICROCODE_BLACKLIST is set to \"${_recorded_MICROCODE_BLACKLIST_value}\" instead of default \"${MICROCODE_BLACKLIST_DEFAULT}\". You are on your own!" |
154 |
- fi |
155 |
- |
156 |
- if [[ -f "${ED%/}/tmp/.signatures_altered" ]]; then |
157 |
- local _recorded_MICROCODE_SIGNATURES_value=$(cat "${ED%/}/tmp/.signatures_altered") |
158 |
- ewarn "Package was created using advanced options:" |
159 |
- ewarn "MICROCODE_SIGNATURES is set to \"${_recorded_MICROCODE_SIGNATURES_value}\" instead of default \"${MICROCODE_SIGNATURES_DEFAULT}\"!" |
160 |
- fi |
161 |
- |
162 |
- # Make sure /boot is available if needed. |
163 |
- use initramfs && mount-boot_pkg_preinst |
164 |
- |
165 |
- local _initramfs_file="${ED%/}/boot/intel-uc.img" |
166 |
- local _ucode_dir="${ED%/}/lib/firmware/intel-ucode" |
167 |
- |
168 |
- if use hostonly; then |
169 |
- # While this output looks redundant we do this check to detect |
170 |
- # rare cases where iucode_tool was unable to detect system's processor(s). |
171 |
- local _detected_processors=$(iucode_tool --scan-system 2>&1) |
172 |
- if [[ -z "${_detected_processors}" ]]; then |
173 |
- ewarn "Looks like iucode_tool was unable to detect any processor!" |
174 |
- else |
175 |
- einfo "Only installing ucode(s) for ${_detected_processors#iucode_tool: system has } due to USE=hostonly ..." |
176 |
- fi |
177 |
- |
178 |
- opts=( |
179 |
- --scan-system |
180 |
- # be strict about what we are doing |
181 |
- --overwrite |
182 |
- --strict-checks |
183 |
- --no-ignore-broken |
184 |
- # we want to install latest version |
185 |
- --no-downgrade |
186 |
- # show everything we find |
187 |
- --list-all |
188 |
- # show what we selected |
189 |
- --list |
190 |
- ) |
191 |
- |
192 |
- # The earlyfw cpio needs to be in /boot because it must be loaded before |
193 |
- # rootfs is mounted. |
194 |
- use initramfs && opts+=( --write-earlyfw=${_initramfs_file} ) |
195 |
- # split location: |
196 |
- use split-ucode && dodir /lib/firmware/intel-ucode && opts+=( --write-firmware=${_ucode_dir} ) |
197 |
- |
198 |
- iucode_tool \ |
199 |
- "${opts[@]}" \ |
200 |
- "${ED%/}"/tmp/intel-ucode \ |
201 |
- || die "iucode_tool ${opts[@]} ${ED%/}/tmp/intel-ucode" |
202 |
- |
203 |
- else |
204 |
- if use split-ucode; then |
205 |
- # Temporary /tmp/intel-ucode will become final /lib/firmware/intel-ucode ... |
206 |
- dodir /lib/firmware |
207 |
- mv "${ED%/}/tmp/intel-ucode" "${ED%/}/lib/firmware" || die "Failed to install splitted ucodes!" |
208 |
- fi |
209 |
- fi |
210 |
- |
211 |
- # Because it is possible that this package will install not one single file |
212 |
- # due to user selection which is still somehow unexpected we add the following |
213 |
- # check to inform user so that the user has at least a chance to detect |
214 |
- # a problem/invalid select. |
215 |
- local _has_installed_something= |
216 |
- if use initramfs && [[ -s "${_initramfs_file}" ]]; then |
217 |
- _has_installed_something="yes" |
218 |
- elif use split-ucode; then |
219 |
- _has_installed_something=$(find "${_ucode_dir}" -maxdepth 0 -not -empty -exec echo yes \;) |
220 |
- fi |
221 |
- |
222 |
- if use hostonly && [[ -n "${_has_installed_something}" ]]; then |
223 |
- elog "You only installed ucode(s) for all currently available (=online)" |
224 |
- elog "processor(s). Remember to re-emerge this package whenever you" |
225 |
- elog "change the system's processor model." |
226 |
- elog "" |
227 |
- elif [[ -z "${_has_installed_something}" ]]; then |
228 |
- ewarn "WARNING:" |
229 |
- if [[ -f "${ED%/}/tmp/.signatures_altered" ]]; then |
230 |
- ewarn "No ucode was installed! Because you have created this package" |
231 |
- ewarn "using MICROCODE_SIGNATURES variable please double check if you" |
232 |
- ewarn "have an invalid select." |
233 |
- ewarn "It's rare but it is also possible that just no ucode update" |
234 |
- ewarn "is available for your processor(s). In this case it is safe" |
235 |
- ewarn "to ignore this warning." |
236 |
- else |
237 |
- ewarn "No ucode was installed! It's rare but it is also possible" |
238 |
- ewarn "that just no ucode update is available for your processor(s)." |
239 |
- ewarn "In this case it is safe to ignore this warning." |
240 |
- fi |
241 |
- |
242 |
- ewarn "" |
243 |
- |
244 |
- if use hostonly; then |
245 |
- ewarn "Unset \"hostonly\" USE flag to install all available ucodes." |
246 |
- ewarn "" |
247 |
- fi |
248 |
- fi |
249 |
- |
250 |
- # Cleanup any temporary leftovers so that we don't merge any |
251 |
- # unneeded files on disk. |
252 |
- rm -r "${ED%/}/tmp" || die "Failed to cleanup '${ED%/}/tmp'" |
253 |
-} |
254 |
- |
255 |
-pkg_prerm() { |
256 |
- # Make sure /boot is mounted so that we can remove /boot/intel-uc.img! |
257 |
- use initramfs && mount-boot_pkg_prerm |
258 |
-} |
259 |
- |
260 |
-pkg_postrm() { |
261 |
- # Don't forget to umount /boot if it was previously mounted by us. |
262 |
- use initramfs && mount-boot_pkg_postrm |
263 |
-} |
264 |
- |
265 |
-pkg_postinst() { |
266 |
- # Don't forget to umount /boot if it was previously mounted by us. |
267 |
- use initramfs && mount-boot_pkg_postinst |
268 |
- |
269 |
- # We cannot give detailed information if user is affected or not: |
270 |
- # If MICROCODE_BLACKLIST wasn't modified, user can still use MICROCODE_SIGNATURES |
271 |
- # to to force a specific, otherwise blacklisted, microcode. So we |
272 |
- # only show a generic warning based on running kernel version: |
273 |
- if kernel_is -lt 4 14 34; then |
274 |
- ewarn "${P} contains microcode updates which require" |
275 |
- ewarn "additional kernel patches which aren't yet included in kernel <4.14.34." |
276 |
- ewarn "Loading such a microcode through kernel interface from an unpatched kernel" |
277 |
- ewarn "can crash your system!" |
278 |
- ewarn "" |
279 |
- ewarn "Those microcodes are blacklisted per default. However, if you have altered" |
280 |
- ewarn "MICROCODE_BLACKLIST or MICROCODE_SIGNATURES, you maybe have unintentionally" |
281 |
- ewarn "re-enabled those microcodes...!" |
282 |
- ewarn "" |
283 |
- ewarn "Check \"${EROOT%/}/usr/share/doc/${PN}-*/releasenot*\" if your microcode update" |
284 |
- ewarn "requires additional kernel patches or not." |
285 |
- fi |
286 |
-} |
287 |
|
288 |
diff --git a/sys-firmware/intel-microcode/intel-microcode-20180807a_p20181215.ebuild b/sys-firmware/intel-microcode/intel-microcode-20180807a_p20181215.ebuild |
289 |
deleted file mode 100644 |
290 |
index e284cd8fcf3..00000000000 |
291 |
--- a/sys-firmware/intel-microcode/intel-microcode-20180807a_p20181215.ebuild |
292 |
+++ /dev/null |
293 |
@@ -1,239 +0,0 @@ |
294 |
-# Copyright 1999-2018 Gentoo Authors |
295 |
-# Distributed under the terms of the GNU General Public License v2 |
296 |
- |
297 |
-EAPI="6" |
298 |
- |
299 |
-inherit linux-info toolchain-funcs mount-boot |
300 |
- |
301 |
-# Find updates by searching and clicking the first link (hopefully it's the one): |
302 |
-# https://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File |
303 |
- |
304 |
-COLLECTION_SNAPSHOT="${PV##*_p}" |
305 |
-INTEL_SNAPSHOT="${PV/_p*}" |
306 |
-NUM="28087" |
307 |
-DESCRIPTION="Intel IA32/IA64 microcode update data" |
308 |
-HOMEPAGE="http://inertiawar.com/microcode/ https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=${NUM}" |
309 |
-SRC_URI="https://downloadmirror.intel.com/${NUM}/eng/microcode-${INTEL_SNAPSHOT}.tgz |
310 |
- https://dev.gentoo.org/~whissi/dist/intel-microcode/intel-microcode-collection-${COLLECTION_SNAPSHOT}.tar.xz" |
311 |
- |
312 |
-LICENSE="intel-ucode" |
313 |
-SLOT="0" |
314 |
-KEYWORDS="-* amd64 x86" |
315 |
-IUSE="hostonly initramfs +split-ucode vanilla" |
316 |
-REQUIRED_USE="|| ( initramfs split-ucode )" |
317 |
- |
318 |
-DEPEND="sys-apps/iucode_tool" |
319 |
- |
320 |
-# !<sys-apps/microcode-ctl-1.17-r2 due to bug #268586 |
321 |
-RDEPEND="hostonly? ( sys-apps/iucode_tool )" |
322 |
- |
323 |
-RESTRICT="binchecks bindist mirror strip" |
324 |
- |
325 |
-S=${WORKDIR} |
326 |
- |
327 |
-# Blacklist bad microcode here. |
328 |
-# 0x000406f1 aka 06-4f-01 aka CPUID 406F1 require newer microcode loader |
329 |
-MICROCODE_BLACKLIST_DEFAULT="-s !0x000406f1" |
330 |
- |
331 |
-# In case we want to set some defaults ... |
332 |
-MICROCODE_SIGNATURES_DEFAULT="" |
333 |
- |
334 |
-# Advanced users only! |
335 |
-# Set MIRCOCODE_SIGNATURES to merge with: |
336 |
-# only current CPU: MICROCODE_SIGNATURES="-S" |
337 |
-# only specific CPU: MICROCODE_SIGNATURES="-s 0x00000f4a -s 0x00010676" |
338 |
-# exclude specific CPU: MICROCODE_SIGNATURES="-s !0x00000686" |
339 |
- |
340 |
-pkg_pretend() { |
341 |
- use initramfs && mount-boot_pkg_pretend |
342 |
-} |
343 |
- |
344 |
-src_prepare() { |
345 |
- default |
346 |
- |
347 |
- # Prevent "invalid file format" errors from iucode_tool |
348 |
- rm -f "${S}"/intel-ucod*/list || die |
349 |
-} |
350 |
- |
351 |
-src_install() { |
352 |
- # This will take ALL of the upstream microcode sources: |
353 |
- # - microcode.dat |
354 |
- # - intel-ucode/ |
355 |
- # In some cases, they have not contained the same content (eg the directory has newer stuff). |
356 |
- MICROCODE_SRC=( |
357 |
- "${S}"/intel-ucode/ |
358 |
- "${S}"/intel-ucode-with-caveats/ |
359 |
- ) |
360 |
- |
361 |
- # Allow users who are scared about microcode updates not included in Intel's official |
362 |
- # microcode tarball to opt-out and comply with Intel marketing |
363 |
- if ! use vanilla; then |
364 |
- MICROCODE_SRC+=( "${S}"/intel-microcode-collection-${COLLECTION_SNAPSHOT} ) |
365 |
- fi |
366 |
- |
367 |
- # These will carry into pkg_preinst via env saving. |
368 |
- : ${MICROCODE_BLACKLIST=${MICROCODE_BLACKLIST_DEFAULT}} |
369 |
- : ${MICROCODE_SIGNATURES=${MICROCODE_SIGNATUES_DEFAULT}} |
370 |
- |
371 |
- opts=( |
372 |
- ${MICROCODE_BLACKLIST} |
373 |
- ${MICROCODE_SIGNATURES} |
374 |
- # be strict about what we are doing |
375 |
- --overwrite |
376 |
- --strict-checks |
377 |
- --no-ignore-broken |
378 |
- # we want to install latest version |
379 |
- --no-downgrade |
380 |
- # show everything we find |
381 |
- --list-all |
382 |
- # show what we selected |
383 |
- --list |
384 |
- ) |
385 |
- |
386 |
- # The earlyfw cpio needs to be in /boot because it must be loaded before |
387 |
- # rootfs is mounted. |
388 |
- use initramfs && dodir /boot && opts+=( --write-earlyfw="${ED%/}"/boot/intel-uc.img ) |
389 |
- |
390 |
- keepdir /lib/firmware/intel-ucode |
391 |
- opts+=( --write-firmware="${ED%/}/lib/firmware/intel-ucode" ) |
392 |
- |
393 |
- iucode_tool \ |
394 |
- "${opts[@]}" \ |
395 |
- "${MICROCODE_SRC[@]}" \ |
396 |
- || die "iucode_tool ${opts[@]} ${MICROCODE_SRC[@]}" |
397 |
- |
398 |
- dodoc releasenote |
399 |
-} |
400 |
- |
401 |
-pkg_preinst() { |
402 |
- if [[ ${MICROCODE_BLACKLIST} != ${MICROCODE_BLACKLIST_DEFAULT} ]]; then |
403 |
- ewarn "MICROCODE_BLACKLIST is set to \"${MICROCODE_BLACKLIST}\" instead of default \"${MICROCODE_BLACKLIST_DEFAULT}\". You are on your own!" |
404 |
- fi |
405 |
- |
406 |
- if [[ ${MICROCODE_SIGNATURES} != ${MICROCODE_SIGNATURES_DEFAULT} ]]; then |
407 |
- ewarn "Package was created using advanced options:" |
408 |
- ewarn "MICROCODE_SIGNATURES is set to \"${MICROCODE_SIGNATURES}\" instead of default \"${MICROCODE_SIGNATURES_DEFAULT}\"!" |
409 |
- fi |
410 |
- |
411 |
- # Make sure /boot is available if needed. |
412 |
- use initramfs && mount-boot_pkg_preinst |
413 |
- |
414 |
- local _initramfs_file="${ED%/}/boot/intel-uc.img" |
415 |
- |
416 |
- if use hostonly; then |
417 |
- # While this output looks redundant we do this check to detect |
418 |
- # rare cases where iucode_tool was unable to detect system's processor(s). |
419 |
- local _detected_processors=$(iucode_tool --scan-system 2>&1) |
420 |
- if [[ -z "${_detected_processors}" ]]; then |
421 |
- ewarn "Looks like iucode_tool was unable to detect any processor!" |
422 |
- else |
423 |
- einfo "Only installing ucode(s) for ${_detected_processors#iucode_tool: system has } due to USE=hostonly ..." |
424 |
- fi |
425 |
- |
426 |
- opts=( |
427 |
- --scan-system |
428 |
- # be strict about what we are doing |
429 |
- --overwrite |
430 |
- --strict-checks |
431 |
- --no-ignore-broken |
432 |
- # we want to install latest version |
433 |
- --no-downgrade |
434 |
- # show everything we find |
435 |
- --list-all |
436 |
- # show what we selected |
437 |
- --list |
438 |
- ) |
439 |
- |
440 |
- # The earlyfw cpio needs to be in /boot because it must be loaded before |
441 |
- # rootfs is mounted. |
442 |
- use initramfs && opts+=( --write-earlyfw=${_initramfs_file} ) |
443 |
- |
444 |
- if use split-ucode; then |
445 |
- opts+=( --write-firmware="${ED%/}/lib/firmware/intel-ucode" ) |
446 |
- fi |
447 |
- |
448 |
- opts+=( "${ED%/}"/lib/firmware/intel-ucode-temp ) |
449 |
- |
450 |
- mv "${ED%/}"/lib/firmware/intel-ucode{,-temp} || die |
451 |
- keepdir /lib/firmware/intel-ucode |
452 |
- |
453 |
- iucode_tool "${opts[@]}" || die "iucode_tool ${opts[@]}" |
454 |
- |
455 |
- rm -r "${ED%/}"/lib/firmware/intel-ucode-temp || die |
456 |
- |
457 |
- elif ! use split-ucode; then # hostonly disabled |
458 |
- rm -r "${ED%/}"/lib/firmware/intel-ucode || die |
459 |
- fi |
460 |
- |
461 |
- # Because it is possible that this package will install not one single file |
462 |
- # due to user selection which is still somehow unexpected we add the following |
463 |
- # check to inform user so that the user has at least a chance to detect |
464 |
- # a problem/invalid select. |
465 |
- local _has_installed_something= |
466 |
- if use initramfs && [[ -s "${_initramfs_file}" ]]; then |
467 |
- _has_installed_something="yes" |
468 |
- elif use split-ucode; then |
469 |
- _has_installed_something=$(find "${ED%/}/lib/firmware/intel-ucode" -maxdepth 0 -not -empty -exec echo yes \;) |
470 |
- fi |
471 |
- |
472 |
- if use hostonly && [[ -n "${_has_installed_something}" ]]; then |
473 |
- elog "You only installed ucode(s) for all currently available (=online)" |
474 |
- elog "processor(s). Remember to re-emerge this package whenever you" |
475 |
- elog "change the system's processor model." |
476 |
- elog "" |
477 |
- elif [[ -z "${_has_installed_something}" ]]; then |
478 |
- ewarn "WARNING:" |
479 |
- if [[ ${MICROCODE_SIGNATURES} != ${MICROCODE_SIGNATURES_DEFAULT} ]]; then |
480 |
- ewarn "No ucode was installed! Because you have created this package" |
481 |
- ewarn "using MICROCODE_SIGNATURES variable please double check if you" |
482 |
- ewarn "have an invalid select." |
483 |
- ewarn "It's rare but it is also possible that just no ucode update" |
484 |
- ewarn "is available for your processor(s). In this case it is safe" |
485 |
- ewarn "to ignore this warning." |
486 |
- else |
487 |
- ewarn "No ucode was installed! It's rare but it is also possible" |
488 |
- ewarn "that just no ucode update is available for your processor(s)." |
489 |
- ewarn "In this case it is safe to ignore this warning." |
490 |
- fi |
491 |
- |
492 |
- ewarn "" |
493 |
- |
494 |
- if use hostonly; then |
495 |
- ewarn "Unset \"hostonly\" USE flag to install all available ucodes." |
496 |
- ewarn "" |
497 |
- fi |
498 |
- fi |
499 |
-} |
500 |
- |
501 |
-pkg_prerm() { |
502 |
- # Make sure /boot is mounted so that we can remove /boot/intel-uc.img! |
503 |
- use initramfs && mount-boot_pkg_prerm |
504 |
-} |
505 |
- |
506 |
-pkg_postrm() { |
507 |
- # Don't forget to umount /boot if it was previously mounted by us. |
508 |
- use initramfs && mount-boot_pkg_postrm |
509 |
-} |
510 |
- |
511 |
-pkg_postinst() { |
512 |
- # Don't forget to umount /boot if it was previously mounted by us. |
513 |
- use initramfs && mount-boot_pkg_postinst |
514 |
- |
515 |
- # We cannot give detailed information if user is affected or not: |
516 |
- # If MICROCODE_BLACKLIST wasn't modified, user can still use MICROCODE_SIGNATURES |
517 |
- # to to force a specific, otherwise blacklisted, microcode. So we |
518 |
- # only show a generic warning based on running kernel version: |
519 |
- if kernel_is -lt 4 14 34; then |
520 |
- ewarn "${P} contains microcode updates which require" |
521 |
- ewarn "additional kernel patches which aren't yet included in kernel <4.14.34." |
522 |
- ewarn "Loading such a microcode through kernel interface from an unpatched kernel" |
523 |
- ewarn "can crash your system!" |
524 |
- ewarn "" |
525 |
- ewarn "Those microcodes are blacklisted per default. However, if you have altered" |
526 |
- ewarn "MICROCODE_BLACKLIST or MICROCODE_SIGNATURES, you maybe have unintentionally" |
527 |
- ewarn "re-enabled those microcodes...!" |
528 |
- ewarn "" |
529 |
- ewarn "Check \"${EROOT%/}/usr/share/doc/${PN}-*/releasenot*\" if your microcode update" |
530 |
- ewarn "requires additional kernel patches or not." |
531 |
- fi |
532 |
-} |