Sophie

Sophie

distrib > Mandriva > current > x86_64 > by-pkgid > 4caac2bfb76a26ec95257880f1dd6ad8 > files > 1

microcode_ctl-1.17-11mdv2010.1.x86_64.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