sys-firmware/intel-microcode: Sync with Gentoo

It's from Gentoo commit 24aae6dd6e42c19b4e7415b9477621a357648219.
This commit is contained in:
Flatcar Buildbot 2024-07-29 07:19:35 +00:00 committed by Krzesimir Nowak
parent 4c66571e04
commit d7cfcffdb9
3 changed files with 36 additions and 19 deletions

View File

@ -35,13 +35,18 @@ opts=(
--no-downgrade
)
if [[ ${KERNEL_INSTALL_VERBOSE} == 1 ]]; then
echo "Generating Intel CPU Microcode early initramfs image..."
opts+=(
--list-all
--list
)
fi
if [[ -d /lib/firmware/intel-ucode ]]; then
if [[ ${KERNEL_INSTALL_VERBOSE} == 1 ]]; then
echo "Generating Intel CPU Microcode early initramfs image..."
opts+=(
--list-all
--list
)
fi
iucode_tool /lib/firmware/intel-ucode "${opts[@]}" ||
{ echo "iucode_tool failed" && exit 1; }
iucode_tool /lib/firmware/intel-ucode "${opts[@]}" ||
{ echo "iucode_tool failed" && exit 1; }
else
[[ ${KERNEL_INSTALL_VERBOSE} == 1 ]] && echo \
"No Intel CPU Microcode installed, nothing to do here."
fi

View File

@ -41,9 +41,13 @@ main() {
--list
)
einfo "Generating Intel CPU Microcode early initramfs image..."
iucode_tool /lib/firmware/intel-ucode "${opts[@]}" ||
die "iucode_tool failed"
if [[ -d /lib/firmware/intel-ucode ]]; then
einfo "Generating Intel CPU Microcode early initramfs image..."
iucode_tool /lib/firmware/intel-ucode "${opts[@]}" ||
die "iucode_tool failed"
else
einfo "No Intel CPU Microcode installed, nothing to do here."
fi
}
main

View File

@ -45,16 +45,24 @@ LICENSE="intel-ucode"
SLOT="0"
KEYWORDS="-* ~amd64 ~x86"
IUSE="dist-kernel hostonly +initramfs +split-ucode vanilla"
REQUIRED_USE="!dist-kernel? ( || ( initramfs split-ucode ) )"
REQUIRED_USE="
|| ( initramfs split-ucode )
dist-kernel? ( split-ucode )
"
RESTRICT="binchecks strip"
BDEPEND=">=sys-apps/iucode_tool-2.3"
# !<sys-apps/microcode-ctl-1.17-r2 due to bug #268586
RDEPEND="
dist-kernel? ( virtual/dist-kernel )
hostonly? ( sys-apps/iucode_tool )
dist-kernel? (
virtual/dist-kernel
initramfs? (
sys-apps/iucode_tool
)
)
"
IDEPEND="
hostonly? ( sys-apps/iucode_tool )
dist-kernel? (
initramfs? ( sys-kernel/installkernel )
)
@ -84,10 +92,10 @@ MICROCODE_SIGNATURES_DEFAULT=""
pkg_pretend() {
if use initramfs; then
if [[ -z ${ROOT} ]] && use dist-kernel; then
if use dist-kernel; then
# Check, but don't die because we can fix the problem and then
# emerge --config ... to re-run installation.
nonfatal mount-boot_check_status
[[ -z ${ROOT} ]] && nonfatal mount-boot_check_status
else
mount-boot_pkg_pretend
fi
@ -302,8 +310,8 @@ pkg_postrm() {
pkg_postinst() {
if use initramfs; then
if [[ -z ${ROOT} ]] && use dist-kernel; then
dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}"
if use dist-kernel; then
[[ -z ${ROOT} ]] && dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}"
else
# Don't forget to umount /boot if it was previously mounted by us.
mount-boot_pkg_postinst