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: Wed, 30 May 2018 22:41:32
Message-Id: 1527720078.8edea0b06510066c10fef7270d196b5ec1e6d056.whissi@gentoo
1 commit: 8edea0b06510066c10fef7270d196b5ec1e6d056
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 30 22:18:55 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Wed May 30 22:41:18 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8edea0b0
7
8 sys-firmware/intel-microcode: rev bump to address QA problem
9
10 - We now install splitted ucode(s) into the correct directory.
11
12 - Fixed an issue when emerge failed when no microcode was selected.
13
14 - "minimal" USE flag was renamed to "hostonly" and disabled per
15 default to avoid confusion.
16
17 - Additional sanity checks were added to show a warning if no
18 microcode update was installed (can be the case when user
19 set "hostonly" USE flag or uses MICROCODE_SIGNATURES environment
20 variable).
21
22 Closes: https://bugs.gentoo.org/654638
23 Package-Manager: Portage-2.3.40, Repoman-2.3.9
24
25 ...7.ebuild => intel-microcode-20180527-r1.ebuild} | 42 ++++++++++++++++------
26 sys-firmware/intel-microcode/metadata.xml | 2 +-
27 2 files changed, 32 insertions(+), 12 deletions(-)
28
29 diff --git a/sys-firmware/intel-microcode/intel-microcode-20180527.ebuild b/sys-firmware/intel-microcode/intel-microcode-20180527-r1.ebuild
30 similarity index 79%
31 rename from sys-firmware/intel-microcode/intel-microcode-20180527.ebuild
32 rename to sys-firmware/intel-microcode/intel-microcode-20180527-r1.ebuild
33 index a439501ae4b..f8b64c6ca86 100644
34 --- a/sys-firmware/intel-microcode/intel-microcode-20180527.ebuild
35 +++ b/sys-firmware/intel-microcode/intel-microcode-20180527-r1.ebuild
36 @@ -19,14 +19,14 @@ SRC_URI="https://downloadmirror.intel.com/${NUM}/eng/microcode-${INTEL_SNAPSHOT}
37 LICENSE="intel-ucode"
38 SLOT="0"
39 KEYWORDS="-* ~amd64 ~x86"
40 -IUSE="initramfs +minimal +split-ucode vanilla"
41 +IUSE="hostonly initramfs +split-ucode vanilla"
42 REQUIRED_USE="|| ( initramfs split-ucode )"
43
44 DEPEND="sys-apps/iucode_tool"
45
46 # !<sys-apps/microcode-ctl-1.17-r2 due to bug #268586
47 RDEPEND="!<sys-apps/microcode-ctl-1.17-r2
48 - minimal? ( sys-apps/iucode_tool )"
49 + hostonly? ( sys-apps/iucode_tool )"
50
51 S=${WORKDIR}
52
53 @@ -100,8 +100,9 @@ src_install() {
54 # rootfs is mounted.
55 use initramfs && dodir /boot && opts+=( --write-earlyfw="${ED%/}"/boot/intel-uc.img )
56 # split location (we use a temporary location so that we are able
57 - # to re-run iucode_tool in pkg_preinst):
58 - dodir /tmp/intel-ucode && opts+=( --write-firmware="${ED%/}"/tmp/intel-ucode )
59 + # to re-run iucode_tool in pkg_preinst; use keepdir instead of dodir to carry
60 + # this folder to pkg_preinst to avoid an error even if no microcode was selected):
61 + keepdir /tmp/intel-ucode && opts+=( --write-firmware="${ED%/}"/tmp/intel-ucode )
62
63 iucode_tool \
64 "${opts[@]}" \
65 @@ -114,8 +115,8 @@ src_install() {
66 pkg_preinst() {
67 use initramfs && mount-boot_pkg_preinst
68
69 - if use minimal; then
70 - einfo "Removing ucode(s) not supported by any currently available (=online) processor(s) due to USE=minimal ..."
71 + if use hostonly; then
72 + einfo "Removing ucode(s) not supported by any currently available (=online) processor(s) due to USE=hostonly ..."
73 opts=(
74 --scan-system
75 # be strict about what we are doing
76 @@ -144,14 +145,14 @@ pkg_preinst() {
77 else
78 if use split-ucode; then
79 # Temporary /tmp/intel-ucode will become final /lib/firmware/intel-ucode ...
80 - dodir /lib/firmware/intel-ucode
81 - mv "${ED%/}"/tmp/intel-ucode "${ED%/}"/lib/firmware/intel-ucode || die "Failed to install splitted ucodes!"
82 + dodir /lib/firmware
83 + mv "${ED%/}/tmp/intel-ucode" "${ED%/}/lib/firmware" || die "Failed to install splitted ucodes!"
84 fi
85 fi
86
87 # Cleanup any temporary leftovers so that we don't merge any
88 # unneeded files on disk
89 - rm -r "${ED%/}"/tmp || die "Failed to cleanup '${ED%/}/tmp'"
90 + rm -r "${ED%/}/tmp" || die "Failed to cleanup '${ED%/}/tmp'"
91 }
92
93 pkg_prerm() {
94 @@ -165,11 +166,30 @@ pkg_postrm() {
95 pkg_postinst() {
96 use initramfs && mount-boot_pkg_postinst
97
98 - if use minimal; then
99 - elog "You only installed ucodes for all currently available (=online)"
100 + local _has_installed_something=
101 + if use initramfs && [[ -s "${EROOT%/}/boot/intel-uc.img" ]]; then
102 + _has_installed_something="yes"
103 + elif use split-ucode; then
104 + _has_installed_something=$(find "${EROOT%/}/lib/firmware/intel-ucode" -maxdepth 0 -not -empty -exec echo yes \;)
105 + fi
106 +
107 + if use hostonly && [[ -n "${_has_installed_something}" ]]; then
108 + elog "You only installed ucode(s) for all currently available (=online)"
109 elog "processor(s). Remember to re-emerge this package whenever you"
110 elog "change the system's processor model."
111 elog ""
112 + elif [[ -z "${_has_installed_something}" ]]; then
113 + ewarn "WARNING:"
114 + ewarn "No ucode was installed! You can ignore this warning if there"
115 + ewarn "aren't any microcode updates available for your processor(s)."
116 + ewarn "But if you use MICROCODE_SIGNATURES variable please double check"
117 + ewarn "if you have an invalid select."
118 + ewarn ""
119 +
120 + if use hostonly; then
121 + ewarn "Unset \"hostonly\" USE flag to install all available ucodes."
122 + ewarn ""
123 + fi
124 fi
125
126 # We cannot give detailed information if user is affected or not:
127
128 diff --git a/sys-firmware/intel-microcode/metadata.xml b/sys-firmware/intel-microcode/metadata.xml
129 index 593b3a92123..6708ec7d79d 100644
130 --- a/sys-firmware/intel-microcode/metadata.xml
131 +++ b/sys-firmware/intel-microcode/metadata.xml
132 @@ -7,7 +7,7 @@
133 </maintainer>
134 <use>
135 <flag name="initramfs">install a small initramfs for use with CONFIG_MICROCODE_EARLY</flag>
136 - <flag name="minimal">only install ucode(s) supported by currently available (=online) processor(s)</flag>
137 + <flag name="hostonly">only install ucode(s) supported by currently available (=online) processor(s)</flag>
138 <flag name="monolithic">install the large text microcode.dat (used by older kernels via microcode_ctl)</flag>
139 <flag name="split-ucode">install the split binary ucode files (used by the kernel directly)</flag>
140 <flag name="vanilla">install only microcode updates from Intel's official microcode tarball</flag>