Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-release-src > by-pkgid > f57152313af0f690408b7805e2163b04 > files > 7

microcode_ctl-2.1-4.mga5.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