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, 29 Oct 2018 14:54:21
Message-Id: 1540824842.873efa6d3f5d6bc5070088f45fff18a92e462776.whissi@gentoo
1 commit: 873efa6d3f5d6bc5070088f45fff18a92e462776
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Mon Oct 29 13:28:36 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 29 14:54:02 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=873efa6d
7
8 sys-firmware/intel-microcode: drop old
9
10 Package-Manager: Portage-2.3.51, Repoman-2.3.11
11 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
12
13 sys-firmware/intel-microcode/Manifest | 1 -
14 .../intel-microcode-20180807a_p20180922.ebuild | 253 ---------------------
15 2 files changed, 254 deletions(-)
16
17 diff --git a/sys-firmware/intel-microcode/Manifest b/sys-firmware/intel-microcode/Manifest
18 index 59fe1a9b4b9..20c20a365e3 100644
19 --- a/sys-firmware/intel-microcode/Manifest
20 +++ b/sys-firmware/intel-microcode/Manifest
21 @@ -1,3 +1,2 @@
22 -DIST intel-microcode-collection-20180922.tar.xz 4506768 BLAKE2B c985c20e01ab171637bf8acbab912a802608681a7f62779a63cd4218008435638c06452fef157d26ff6295dbee963827493dd85fb31b6e2b8e447158eb55d9f9 SHA512 08d38e25d02a45cbc2272c440e64255dbaac90efc67dd241f8e329c84eff2baab38236ee97a52e3803ecbc87a751d1d44f08a18288fba52cbbf916390d461646
23 DIST intel-microcode-collection-20181027.tar.xz 4517880 BLAKE2B 189e23cfc77d89da945dec6e1762ce9ba16c1cbc0a618e80f3c328b3d9766ef3bb8e62c84c3a6f32ef994f426b5f00ff1ec520105ac7734f25a606e7cb036ec6 SHA512 fc96d0bbacea9da7a232a6482a7731a029c7e110c3358f917d99e1906c9a783b90df22dde2ad4043e8029a4e3ca5a86d43927b38f668456dfda4098d9d5f37c5
24 DIST microcode-20180807a.tgz 1628061 BLAKE2B a6b5a07596a0b1687efb95c207b2194865b2f975cc0d761a687d5b9d8fea63e777eb73373113f356a18592fd53651cf37d044d4e98cdfe6b306393b54ac06129 SHA512 3cd6794a5ce26e86f7b644e523ba978699316046e593da215b73b17c4b43049ac4a81636e2ce3e727d06c2efbac98657764aa3ff355edb429127585bb49a9b10
25
26 diff --git a/sys-firmware/intel-microcode/intel-microcode-20180807a_p20180922.ebuild b/sys-firmware/intel-microcode/intel-microcode-20180807a_p20180922.ebuild
27 deleted file mode 100644
28 index cf35c112d2d..00000000000
29 --- a/sys-firmware/intel-microcode/intel-microcode-20180807a_p20180922.ebuild
30 +++ /dev/null
31 @@ -1,253 +0,0 @@
32 -# Copyright 1999-2018 Gentoo Authors
33 -# Distributed under the terms of the GNU General Public License v2
34 -
35 -EAPI="6"
36 -
37 -inherit linux-info toolchain-funcs mount-boot
38 -
39 -# Find updates by searching and clicking the first link (hopefully it's the one):
40 -# https://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File
41 -
42 -COLLECTION_SNAPSHOT="${PV##*_p}"
43 -INTEL_SNAPSHOT="${PV/_p*}"
44 -NUM="28087"
45 -DESCRIPTION="Intel IA32/IA64 microcode update data"
46 -HOMEPAGE="http://inertiawar.com/microcode/ https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=${NUM}"
47 -SRC_URI="https://downloadmirror.intel.com/${NUM}/eng/microcode-${INTEL_SNAPSHOT}.tgz
48 - https://dev.gentoo.org/~whissi/dist/intel-microcode/intel-microcode-collection-${COLLECTION_SNAPSHOT}.tar.xz"
49 -
50 -LICENSE="intel-ucode"
51 -SLOT="0"
52 -KEYWORDS="-* amd64 x86"
53 -IUSE="hostonly initramfs +split-ucode vanilla"
54 -REQUIRED_USE="|| ( initramfs split-ucode )"
55 -
56 -DEPEND="sys-apps/iucode_tool"
57 -
58 -# !<sys-apps/microcode-ctl-1.17-r2 due to bug #268586
59 -RDEPEND="hostonly? ( sys-apps/iucode_tool )"
60 -
61 -RESTRICT="binchecks bindist mirror strip"
62 -
63 -S=${WORKDIR}
64 -
65 -# Blacklist bad microcode here.
66 -# 0x000406f1 aka 06-4f-01 aka CPUID 406F1 require newer microcode loader
67 -MICROCODE_BLACKLIST_DEFAULT="-s !0x000406f1"
68 -MICROCODE_BLACKLIST="${MICROCODE_BLACKLIST:=${MICROCODE_BLACKLIST_DEFAULT}}"
69 -
70 -# In case we want to set some defaults ...
71 -MICROCODE_SIGNATURES_DEFAULT=""
72 -
73 -# Advanced users only:
74 -# merge with:
75 -# only current CPU: MICROCODE_SIGNATURES="-S"
76 -# only specific CPU: MICROCODE_SIGNATURES="-s 0x00000f4a -s 0x00010676"
77 -# exclude specific CPU: MICROCODE_SIGNATURES="-s !0x00000686"
78 -MICROCODE_SIGNATURES="${MICROCODE_SIGNATURES:=${MICROCODE_SIGNATURES_DEFAULT}}"
79 -
80 -pkg_pretend() {
81 - use initramfs && mount-boot_pkg_pretend
82 -}
83 -
84 -src_prepare() {
85 - default
86 -
87 - # Prevent "invalid file format" errors from iucode_tool
88 - rm -f "${S}"/intel-ucod*/list || die
89 -}
90 -
91 -src_install() {
92 - # This will take ALL of the upstream microcode sources:
93 - # - microcode.dat
94 - # - intel-ucode/
95 - # In some cases, they have not contained the same content (eg the directory has newer stuff).
96 - MICROCODE_SRC=(
97 - "${S}"/intel-ucode/
98 - "${S}"/intel-ucode-with-caveats/
99 - )
100 -
101 - # Allow users who are scared about microcode updates not included in Intel's official
102 - # microcode tarball to opt-out and comply with Intel marketing
103 - if ! use vanilla; then
104 - MICROCODE_SRC+=( "${S}"/intel-microcode-collection-${COLLECTION_SNAPSHOT} )
105 - fi
106 -
107 - opts=(
108 - ${MICROCODE_BLACKLIST}
109 - ${MICROCODE_SIGNATURES}
110 - # be strict about what we are doing
111 - --overwrite
112 - --strict-checks
113 - --no-ignore-broken
114 - # we want to install latest version
115 - --no-downgrade
116 - # show everything we find
117 - --list-all
118 - # show what we selected
119 - --list
120 - )
121 -
122 - # The earlyfw cpio needs to be in /boot because it must be loaded before
123 - # rootfs is mounted.
124 - use initramfs && dodir /boot && opts+=( --write-earlyfw="${ED%/}"/boot/intel-uc.img )
125 - # split location (we use a temporary location so that we are able
126 - # to re-run iucode_tool in pkg_preinst; use keepdir instead of dodir to carry
127 - # this folder to pkg_preinst to avoid an error even if no microcode was selected):
128 - keepdir /tmp/intel-ucode && opts+=( --write-firmware="${ED%/}"/tmp/intel-ucode )
129 -
130 - iucode_tool \
131 - "${opts[@]}" \
132 - "${MICROCODE_SRC[@]}" \
133 - || die "iucode_tool ${opts[@]} ${MICROCODE_SRC[@]}"
134 -
135 - dodoc releasenote
136 -
137 - # Record how package was created so we can show this in build.log
138 - # even for binary packages.
139 - if [[ "${MICROCODE_BLACKLIST}" != "${MICROCODE_BLACKLIST_DEFAULT}" ]]; then
140 - echo ${MICROCODE_BLACKLIST} > "${ED%/}/tmp/.blacklist_altered" || die "Failed to add marker that MICROCODE_BLACKLIST variable was used"
141 - fi
142 -
143 - if [[ "${MICROCODE_SIGNATURES}" != "${MICROCODE_SIGNATURES_DEFAULT}" ]]; then
144 - echo ${MICROCODE_SIGNATURES} > "${ED%/}/tmp/.signatures_altered" || die "Failed to add marker that MICROCODE_SIGNATURES variable was used"
145 - fi
146 -}
147 -
148 -pkg_preinst() {
149 - if [[ -f "${ED%/}/tmp/.blacklist_altered" ]]; then
150 - local _recorded_MICROCODE_BLACKLIST_value=$(cat "${ED%/}/tmp/.blacklist_altered")
151 - ewarn "MICROCODE_BLACKLIST is set to \"${_recorded_MICROCODE_BLACKLIST_value}\" instead of default \"${MICROCODE_BLACKLIST_DEFAULT}\". You are on your own!"
152 - fi
153 -
154 - if [[ -f "${ED%/}/tmp/.signatures_altered" ]]; then
155 - local _recorded_MICROCODE_SIGNATURES_value=$(cat "${ED%/}/tmp/.signatures_altered")
156 - ewarn "Package was created using advanced options:"
157 - ewarn "MICROCODE_SIGNATURES is set to \"${_recorded_MICROCODE_SIGNATURES_value}\" instead of default \"${MICROCODE_SIGNATURES_DEFAULT}\"!"
158 - fi
159 -
160 - # Make sure /boot is available if needed.
161 - use initramfs && mount-boot_pkg_preinst
162 -
163 - local _initramfs_file="${ED%/}/boot/intel-uc.img"
164 - local _ucode_dir="${ED%/}/lib/firmware/intel-ucode"
165 -
166 - if use hostonly; then
167 - # While this output looks redundant we do this check to detect
168 - # rare cases where iucode_tool was unable to detect system's processor(s).
169 - local _detected_processors=$(iucode_tool --scan-system 2>&1)
170 - if [[ -z "${_detected_processors}" ]]; then
171 - ewarn "Looks like iucode_tool was unable to detect any processor!"
172 - else
173 - einfo "Only installing ucode(s) for ${_detected_processors#iucode_tool: system has } due to USE=hostonly ..."
174 - fi
175 -
176 - opts=(
177 - --scan-system
178 - # be strict about what we are doing
179 - --overwrite
180 - --strict-checks
181 - --no-ignore-broken
182 - # we want to install latest version
183 - --no-downgrade
184 - # show everything we find
185 - --list-all
186 - # show what we selected
187 - --list
188 - )
189 -
190 - # The earlyfw cpio needs to be in /boot because it must be loaded before
191 - # rootfs is mounted.
192 - use initramfs && opts+=( --write-earlyfw=${_initramfs_file} )
193 - # split location:
194 - use split-ucode && dodir /lib/firmware/intel-ucode && opts+=( --write-firmware=${_ucode_dir} )
195 -
196 - iucode_tool \
197 - "${opts[@]}" \
198 - "${ED%/}"/tmp/intel-ucode \
199 - || die "iucode_tool ${opts[@]} ${ED%/}/tmp/intel-ucode"
200 -
201 - else
202 - if use split-ucode; then
203 - # Temporary /tmp/intel-ucode will become final /lib/firmware/intel-ucode ...
204 - dodir /lib/firmware
205 - mv "${ED%/}/tmp/intel-ucode" "${ED%/}/lib/firmware" || die "Failed to install splitted ucodes!"
206 - fi
207 - fi
208 -
209 - # Because it is possible that this package will install not one single file
210 - # due to user selection which is still somehow unexpected we add the following
211 - # check to inform user so that the user has at least a chance to detect
212 - # a problem/invalid select.
213 - local _has_installed_something=
214 - if use initramfs && [[ -s "${_initramfs_file}" ]]; then
215 - _has_installed_something="yes"
216 - elif use split-ucode; then
217 - _has_installed_something=$(find "${_ucode_dir}" -maxdepth 0 -not -empty -exec echo yes \;)
218 - fi
219 -
220 - if use hostonly && [[ -n "${_has_installed_something}" ]]; then
221 - elog "You only installed ucode(s) for all currently available (=online)"
222 - elog "processor(s). Remember to re-emerge this package whenever you"
223 - elog "change the system's processor model."
224 - elog ""
225 - elif [[ -z "${_has_installed_something}" ]]; then
226 - ewarn "WARNING:"
227 - if [[ -f "${ED%/}/tmp/.signatures_altered" ]]; then
228 - ewarn "No ucode was installed! Because you have created this package"
229 - ewarn "using MICROCODE_SIGNATURES variable please double check if you"
230 - ewarn "have an invalid select."
231 - ewarn "It's rare but it is also possible that just no ucode update"
232 - ewarn "is available for your processor(s). In this case it is safe"
233 - ewarn "to ignore this warning."
234 - else
235 - ewarn "No ucode was installed! It's rare but it is also possible"
236 - ewarn "that just no ucode update is available for your processor(s)."
237 - ewarn "In this case it is safe to ignore this warning."
238 - fi
239 -
240 - ewarn ""
241 -
242 - if use hostonly; then
243 - ewarn "Unset \"hostonly\" USE flag to install all available ucodes."
244 - ewarn ""
245 - fi
246 - fi
247 -
248 - # Cleanup any temporary leftovers so that we don't merge any
249 - # unneeded files on disk.
250 - rm -r "${ED%/}/tmp" || die "Failed to cleanup '${ED%/}/tmp'"
251 -}
252 -
253 -pkg_prerm() {
254 - # Make sure /boot is mounted so that we can remove /boot/intel-uc.img!
255 - use initramfs && mount-boot_pkg_prerm
256 -}
257 -
258 -pkg_postrm() {
259 - # Don't forget to umount /boot if it was previously mounted by us.
260 - use initramfs && mount-boot_pkg_postrm
261 -}
262 -
263 -pkg_postinst() {
264 - # Don't forget to umount /boot if it was previously mounted by us.
265 - use initramfs && mount-boot_pkg_postinst
266 -
267 - # We cannot give detailed information if user is affected or not:
268 - # If MICROCODE_BLACKLIST wasn't modified, user can still use MICROCODE_SIGNATURES
269 - # to to force a specific, otherwise blacklisted, microcode. So we
270 - # only show a generic warning based on running kernel version:
271 - if kernel_is -lt 4 14 34; then
272 - ewarn "${P} contains microcode updates which require"
273 - ewarn "additional kernel patches which aren't yet included in kernel <4.14.34."
274 - ewarn "Loading such a microcode through kernel interface from an unpatched kernel"
275 - ewarn "can crash your system!"
276 - ewarn ""
277 - ewarn "Those microcodes are blacklisted per default. However, if you have altered"
278 - ewarn "MICROCODE_BLACKLIST or MICROCODE_SIGNATURES, you maybe have unintentionally"
279 - ewarn "re-enabled those microcodes...!"
280 - ewarn ""
281 - ewarn "Check \"${EROOT%/}/usr/share/doc/${PN}-*/releasenot*\" if your microcode update"
282 - ewarn "requires additional kernel patches or not."
283 - fi
284 -}