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