Files
haikuports/sys-firmware/intel-microcode/additional-files/intel_copy_microcode.sh
Jérôme Duval a22efece8b intel_microcode: copy the current cpu microcode in non-packaged
the boot loader can then pick and load the microcode on the next boot
2024-10-23 17:39:01 +02:00

9 lines
413 B
Bash
Executable File

#!/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