Sophie

Sophie

distrib > Mageia > 1 > i586 > by-pkgid > efd3a9e4d12b18e6fb3e673e7cc73fc4 > files > 9

microcode_ctl-1.17-13.mga1.src.rpm

#!/bin/sh
#
# check if there is a new microcode for your CPU and update it 

# Intel 686 and above, AMD family 16 and above
vendor=`grep "^vendor_id" /proc/cpuinfo | head -n1 | awk -F ": " '{ print $2 }'`
family=`grep "^cpu family" /proc/cpuinfo | head -n1 | awk -F ": " '{ print $2 }'`

if [ "$vendor" = "GenuineIntel" ] && [ $family -ge 6 ]; then
	/usr/sbin/update-intel-microcode
elif [ "$vendor" = "AuthenticAMD" ] && [ $family -ge 16 ]; then
	minor=`uname -r |  cut -d . -f 3 | cut -d - -f 1`
	if [ $minor -ge 29 ]; then
		/usr/sbin/update-amd-microcode
	fi
fi