mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-29 01:21:02 +02:00
sys-firmware/intel-microcode: Sync with Gentoo
It's from Gentoo commit 24aae6dd6e42c19b4e7415b9477621a357648219.
This commit is contained in:
parent
4c66571e04
commit
d7cfcffdb9
@ -35,13 +35,18 @@ opts=(
|
|||||||
--no-downgrade
|
--no-downgrade
|
||||||
)
|
)
|
||||||
|
|
||||||
if [[ ${KERNEL_INSTALL_VERBOSE} == 1 ]]; then
|
if [[ -d /lib/firmware/intel-ucode ]]; then
|
||||||
echo "Generating Intel CPU Microcode early initramfs image..."
|
if [[ ${KERNEL_INSTALL_VERBOSE} == 1 ]]; then
|
||||||
opts+=(
|
echo "Generating Intel CPU Microcode early initramfs image..."
|
||||||
--list-all
|
opts+=(
|
||||||
--list
|
--list-all
|
||||||
)
|
--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
|
||||||
|
@ -41,9 +41,13 @@ main() {
|
|||||||
--list
|
--list
|
||||||
)
|
)
|
||||||
|
|
||||||
einfo "Generating Intel CPU Microcode early initramfs image..."
|
if [[ -d /lib/firmware/intel-ucode ]]; then
|
||||||
iucode_tool /lib/firmware/intel-ucode "${opts[@]}" ||
|
einfo "Generating Intel CPU Microcode early initramfs image..."
|
||||||
die "iucode_tool failed"
|
iucode_tool /lib/firmware/intel-ucode "${opts[@]}" ||
|
||||||
|
die "iucode_tool failed"
|
||||||
|
else
|
||||||
|
einfo "No Intel CPU Microcode installed, nothing to do here."
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user