From a22efece8b7bd581c68b8f4811d9621d5646d228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Wed, 23 Oct 2024 17:29:16 +0200 Subject: [PATCH] intel_microcode: copy the current cpu microcode in non-packaged the boot loader can then pick and load the microcode on the next boot --- .../additional-files/intel_copy_microcode.sh | 8 ++++++++ .../intel-microcode/intel_microcode-20240312.recipe | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 sys-firmware/intel-microcode/additional-files/intel_copy_microcode.sh diff --git a/sys-firmware/intel-microcode/additional-files/intel_copy_microcode.sh b/sys-firmware/intel-microcode/additional-files/intel_copy_microcode.sh new file mode 100755 index 000000000..82721c693 --- /dev/null +++ b/sys-firmware/intel-microcode/additional-files/intel_copy_microcode.sh @@ -0,0 +1,8 @@ +#!/bin/sh +dataDir=`finddir B_SYSTEM_DATA_DIRECTORY`/firmware/intel-ucode +targetDir=`finddir B_SYSTEM_NONPACKAGED_DATA_DIRECTORY`/firmware/intel-ucode +mkdir -p $targetDir +cpuinfo=$(sysinfo -cpu | grep -oE 'family [[:digit:]]+, model [[:digit:]]+, stepping [[:digit:]]+' | uniq | sed -e 's/[^0-9]\+/ /g' -e 's/^ //') +microcodeFile=$(printf '%02x-%02x-%02x\n' $cpuinfo) +cp -p $dataDir/$microcodeFile $targetDir +true diff --git a/sys-firmware/intel-microcode/intel_microcode-20240312.recipe b/sys-firmware/intel-microcode/intel_microcode-20240312.recipe index b126018b9..5442128f3 100644 --- a/sys-firmware/intel-microcode/intel_microcode-20240312.recipe +++ b/sys-firmware/intel-microcode/intel_microcode-20240312.recipe @@ -7,14 +7,17 @@ using the system BIOS, but for a subset of Intel's processors this can be done\ HOMEPAGE="https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/" COPYRIGHT="2018-2024 Intel Corporation" LICENSE="Intel CPU Microcode" -REVISION="1" +REVISION="2" SOURCE_URI="https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/archive/microcode-$portVersion.tar.gz" SOURCE_DIR="Intel-Linux-Processor-Microcode-Data-Files-microcode-$portVersion" CHECKSUM_SHA256="9575c6d74491058bbf998c359d7f25f23655d97a31663a8ed6a98def2b0aaf2b" +ADDITIONAL_FILES="intel_copy_microcode.sh" ARCHITECTURES="any" DISABLE_SOURCE_PACKAGE="yes" +POST_INSTALL_SCRIPTS="$relativePostInstallDir/intel_copy_microcode.sh" + PROVIDES=" intel_microcode = $portVersion " @@ -23,4 +26,8 @@ INSTALL() { mkdir -p $dataDir/firmware/intel-ucode cp intel-ucode{,-with-caveats}/* $dataDir/firmware/intel-ucode/ + + # install postinstallscript + mkdir -p $postInstallDir + install -t $postInstallDir $portDir/additional-files/intel_copy_microcode.sh }