intel_microcode: copy the current cpu microcode in non-packaged

the boot loader can then pick and load the microcode on the next boot
This commit is contained in:
Jérôme Duval
2024-10-23 17:29:16 +02:00
parent 7077a0d29d
commit a22efece8b
2 changed files with 16 additions and 1 deletions

View File

@@ -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