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 --no-downgrade
) )
if [[ ${KERNEL_INSTALL_VERBOSE} == 1 ]]; then if [[ -d /lib/firmware/intel-ucode ]]; then
if [[ ${KERNEL_INSTALL_VERBOSE} == 1 ]]; then
echo "Generating Intel CPU Microcode early initramfs image..." echo "Generating Intel CPU Microcode early initramfs image..."
opts+=( opts+=(
--list-all --list-all
--list --list
) )
fi fi
iucode_tool /lib/firmware/intel-ucode "${opts[@]}" || iucode_tool /lib/firmware/intel-ucode "${opts[@]}" ||
{ echo "iucode_tool failed" && exit 1; } { 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 --list
) )
if [[ -d /lib/firmware/intel-ucode ]]; then
einfo "Generating Intel CPU Microcode early initramfs image..." einfo "Generating Intel CPU Microcode early initramfs image..."
iucode_tool /lib/firmware/intel-ucode "${opts[@]}" || iucode_tool /lib/firmware/intel-ucode "${opts[@]}" ||
die "iucode_tool failed" die "iucode_tool failed"
else
einfo "No Intel CPU Microcode installed, nothing to do here."
fi
} }
main main

View File

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