Sophie

Sophie

distrib > Mandriva > current > i586 > media > contrib-release-src > by-pkgid > 667ab6a7e95c26210050fc053654c898 > files > 9

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