diff options
Diffstat (limited to 'sys-firmware/intel-microcode')
-rw-r--r-- | sys-firmware/intel-microcode/intel-microcode-20240312_p20240312.ebuild | 38 | ||||
-rw-r--r-- | sys-firmware/intel-microcode/intel-microcode-20240514_p20240514.ebuild | 38 |
2 files changed, 62 insertions, 14 deletions
diff --git a/sys-firmware/intel-microcode/intel-microcode-20240312_p20240312.ebuild b/sys-firmware/intel-microcode/intel-microcode-20240312_p20240312.ebuild index 5992eadefd5f..957da662f92e 100644 --- a/sys-firmware/intel-microcode/intel-microcode-20240312_p20240312.ebuild +++ b/sys-firmware/intel-microcode/intel-microcode-20240312_p20240312.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit linux-info mount-boot +inherit dist-kernel-utils linux-info mount-boot # Find updates by searching and clicking the first link (hopefully it's the one): # https://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File @@ -44,13 +44,21 @@ S="${WORKDIR}" LICENSE="intel-ucode" SLOT="0" KEYWORDS="-* amd64 x86" -IUSE="hostonly initramfs +split-ucode vanilla" -REQUIRED_USE="|| ( initramfs split-ucode )" +IUSE="dist-kernel hostonly +initramfs +split-ucode vanilla" +REQUIRED_USE="!dist-kernel? ( || ( initramfs split-ucode ) )" RESTRICT="binchecks strip" BDEPEND=">=sys-apps/iucode_tool-2.3" # !<sys-apps/microcode-ctl-1.17-r2 due to bug #268586 -RDEPEND="hostonly? ( sys-apps/iucode_tool )" +RDEPEND=" + dist-kernel? ( virtual/dist-kernel ) + hostonly? ( sys-apps/iucode_tool ) +" +IDEPEND=" + dist-kernel? ( + initramfs? ( sys-kernel/installkernel ) + ) +" # Blacklist bad microcode here. # 0x000406f1 aka 06-4f-01 aka CPUID 406F1 require newer microcode loader @@ -138,9 +146,18 @@ src_install() { --list ) + # Instruct Dracut on whether or not we want the microcode in initramfs + # Use here 15 instead of 10, intel-microcode overwrites linux-firmware + ( + insinto /usr/lib/dracut/dracut.conf.d + newins - 15-${PN}.conf <<<"early_microcode=$(usex initramfs)" + ) + # The earlyfw cpio needs to be in /boot because it must be loaded before # rootfs is mounted. - use initramfs && dodir /boot && opts+=( --write-earlyfw="${ED}/boot/intel-uc.img" ) + if ! use dist-kernel && use initramfs; then + dodir /boot && opts+=( --write-earlyfw="${ED}/boot/intel-uc.img" ) + fi keepdir /lib/firmware/intel-ucode opts+=( --write-firmware="${ED}/lib/firmware/intel-ucode" ) @@ -194,7 +211,9 @@ pkg_preinst() { # The earlyfw cpio needs to be in /boot because it must be loaded before # rootfs is mounted. - use initramfs && opts+=( --write-earlyfw=${_initramfs_file} ) + if ! use dist-kernel && use initramfs; then + opts+=( --write-earlyfw=${_initramfs_file} ) + fi if use split-ucode; then opts+=( --write-firmware="${ED}/lib/firmware/intel-ucode" ) @@ -265,7 +284,12 @@ pkg_postrm() { pkg_postinst() { # Don't forget to umount /boot if it was previously mounted by us. - use initramfs && mount-boot_pkg_postinst + if use initramfs; then + if [[ -z ${ROOT} ]] && use dist-kernel; then + dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" + fi + mount-boot_pkg_postinst + fi # We cannot give detailed information if user is affected or not: # If MICROCODE_BLACKLIST wasn't modified, user can still use MICROCODE_SIGNATURES diff --git a/sys-firmware/intel-microcode/intel-microcode-20240514_p20240514.ebuild b/sys-firmware/intel-microcode/intel-microcode-20240514_p20240514.ebuild index 418ab5cc22e2..c33321a94497 100644 --- a/sys-firmware/intel-microcode/intel-microcode-20240514_p20240514.ebuild +++ b/sys-firmware/intel-microcode/intel-microcode-20240514_p20240514.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit linux-info mount-boot +inherit dist-kernel-utils linux-info mount-boot # Find updates by searching and clicking the first link (hopefully it's the one): # https://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File @@ -44,13 +44,21 @@ S="${WORKDIR}" LICENSE="intel-ucode" SLOT="0" KEYWORDS="-* ~amd64 ~x86" -IUSE="hostonly initramfs +split-ucode vanilla" -REQUIRED_USE="|| ( initramfs split-ucode )" +IUSE="dist-kernel hostonly +initramfs +split-ucode vanilla" +REQUIRED_USE="!dist-kernel? ( || ( initramfs split-ucode ) )" RESTRICT="binchecks strip" BDEPEND=">=sys-apps/iucode_tool-2.3" # !<sys-apps/microcode-ctl-1.17-r2 due to bug #268586 -RDEPEND="hostonly? ( sys-apps/iucode_tool )" +RDEPEND=" + dist-kernel? ( virtual/dist-kernel ) + hostonly? ( sys-apps/iucode_tool ) +" +IDEPEND=" + dist-kernel? ( + initramfs? ( sys-kernel/installkernel ) + ) +" # Blacklist bad microcode here. # 0x000406f1 aka 06-4f-01 aka CPUID 406F1 require newer microcode loader @@ -138,9 +146,18 @@ src_install() { --list ) + # Instruct Dracut on whether or not we want the microcode in initramfs + # Use here 15 instead of 10, intel-microcode overwrites linux-firmware + ( + insinto /usr/lib/dracut/dracut.conf.d + newins - 15-${PN}.conf <<<"early_microcode=$(usex initramfs)" + ) + # The earlyfw cpio needs to be in /boot because it must be loaded before # rootfs is mounted. - use initramfs && dodir /boot && opts+=( --write-earlyfw="${ED}/boot/intel-uc.img" ) + if ! use dist-kernel && use initramfs; then + dodir /boot && opts+=( --write-earlyfw="${ED}/boot/intel-uc.img" ) + fi keepdir /lib/firmware/intel-ucode opts+=( --write-firmware="${ED}/lib/firmware/intel-ucode" ) @@ -194,7 +211,9 @@ pkg_preinst() { # The earlyfw cpio needs to be in /boot because it must be loaded before # rootfs is mounted. - use initramfs && opts+=( --write-earlyfw=${_initramfs_file} ) + if ! use dist-kernel && use initramfs; then + opts+=( --write-earlyfw=${_initramfs_file} ) + fi if use split-ucode; then opts+=( --write-firmware="${ED}/lib/firmware/intel-ucode" ) @@ -265,7 +284,12 @@ pkg_postrm() { pkg_postinst() { # Don't forget to umount /boot if it was previously mounted by us. - use initramfs && mount-boot_pkg_postinst + if use initramfs; then + if [[ -z ${ROOT} ]] && use dist-kernel; then + dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" + fi + mount-boot_pkg_postinst + fi # We cannot give detailed information if user is affected or not: # If MICROCODE_BLACKLIST wasn't modified, user can still use MICROCODE_SIGNATURES |