rpms/microcode_ctl/F-11 .cvsignore, 1.14, 1.15 microcode_ctl.init, 1.13, 1.14 microcode_ctl.spec, 1.51, 1.52 sources, 1.11, 1.12

Kyle McMartin kyle at fedoraproject.org
Fri Dec 4 17:40:22 UTC 2009


Author: kyle

Update of /cvs/pkgs/rpms/microcode_ctl/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv23492

Modified Files:
	.cvsignore microcode_ctl.init microcode_ctl.spec sources 
Log Message:
* Wed Dec 02 2009 Kyle McMartin <kyle at redhat.com> 1.17-1.52
- Add AMD x86/x86-64 microcode. (Dated: 2009-10-09)
  Doesn't need microcode_ctl modifications as it's loaded by
  request_firmware() like any other sensible driver.
- Eventually, this AMD firmware can probably live inside
  kernel-firmware once it is split out.



Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/microcode_ctl/F-11/.cvsignore,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -p -r1.14 -r1.15
--- .cvsignore	24 May 2009 01:28:16 -0000	1.14
+++ .cvsignore	4 Dec 2009 17:40:21 -0000	1.15
@@ -2,3 +2,4 @@ clog
 microcode_ctl-1.17
 microcode_ctl-1.17.tar.gz
 microcode-20090330.dat
+amd-ucode-2009-10-09.tar


Index: microcode_ctl.init
===================================================================
RCS file: /cvs/pkgs/rpms/microcode_ctl/F-11/microcode_ctl.init,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -p -r1.13 -r1.14
--- microcode_ctl.init	22 Feb 2008 20:01:12 -0000	1.13
+++ microcode_ctl.init	4 Dec 2009 17:40:21 -0000	1.14
@@ -2,20 +2,9 @@
 # chkconfig: 2345 0 99
 # description: script to apply cpu microcode
 
-# vars:
-#
-# START			distribution specific way of kicking programs
-# END			distribution specific way of checking return status
-# PROGRAM		the executable to run
-# ARGUMENTS		the argument we're going to call PROGRAM with
-
 # Check that we're a priviledged user
 [ `id -u` = 0 ] || exit 0
 
-DEVICE=/dev/cpu/microcode
-ARGUMENTS=-Qu
-RETVAL=0
-PROGRAM=/sbin/microcode_ctl
 DATAFILE=/lib/firmware/microcode.dat
 
 . /etc/init.d/functions
@@ -26,13 +15,20 @@ RETVAL=0
 function start ()
 {
 	RETVAL=1
-	# Make sure we are on an Intel machine
-	vendor=`grep "^vendor_id" /proc/cpuinfo | head -n1 | awk -F ": " '{ print $2 }'`
-	[ "$vendor" != "GenuineIntel" ] && return
 
-	# Microcode wasn't available until 686's.
+	# 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 }'`
-	[ $family -lt 6 ] && return
+
+	if [ "$vendor" = "GenuineIntel" ] && [ $family -ge 6 ]; then
+		echo -n $"Applying Intel CPU microcode update: "
+	elif [ "$vendor" = "AuthenticAMD" ] && [ $family -ge 16 ]; then
+		echo $"Loading AMD microcode update module"
+		/sbin/modprobe microcode	# and we're done!
+		return
+	else
+		return
+	fi
 
 	echo -n $"Applying Intel CPU microcode update: "
 
@@ -44,38 +40,22 @@ function start ()
 	/sbin/modprobe microcode
 
 	lt=0
-	while [ ! -c $DEVICE ]; do
+	while [ ! -c /dev/cpu/microcode ]; do
 		lt=$[lt+1];
 		[ $lt -gt 5 ] && break;
-		sleep 1;
+		sleep 0.1;
 	done
 
-	# Lets just be sure we have a device file...
-	if [ ! -e $DEVICE ]; then
-		echo $"$0: microcode device $DEVICE doesn't exist?"
-		exit 1
-	elif [ ! -c $DEVICE ]; then
-		echo $"$0: $DEVICE not a character device?"
-		exit 1
-	fi
-
-	daemon $PROGRAM $ARGUMENTS
+	/sbin/microcode_ctl -Qu
 	RETVAL=$?
 
-	# trap the most common case, errno 19 = no device
-	if [ $RETVAL -eq 19 ]; then
-		echo $"$0: kernel does not have CPU microcode device support"
-	fi
 	/sbin/rmmod microcode
-	echo
 
-	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/microcode_ctl
 	return $RETVAL
 }
 
 stop()
 {
-	rm -f /var/lock/subsys/microcode_ctl
 }
 
 case "$1" in
@@ -87,7 +67,7 @@ case "$1" in
 	stop
 	;;
   restart|reload|force-reload)
-    stop
+	stop
 	start
 	;;
   status)


Index: microcode_ctl.spec
===================================================================
RCS file: /cvs/pkgs/rpms/microcode_ctl/F-11/microcode_ctl.spec,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -p -r1.51 -r1.52
--- microcode_ctl.spec	3 Jun 2009 18:45:24 -0000	1.51
+++ microcode_ctl.spec	4 Dec 2009 17:40:21 -0000	1.52
@@ -11,6 +11,8 @@ Source1:        microcode_ctl.init
 # Microcode now distributed directly by Intel, at
 # http://downloadcenter.intel.com (just search for microcode)
 Source2:        microcode-20090330.dat
+# http://www.amd64.org/support/microcode.html
+Source3:        amd-ucode-2009-10-09.tar
 Buildroot:      %{_tmppath}/%{name}-%{version}-root
 Requires(pre):  /sbin/chkconfig /sbin/service
 Requires(pre):  grep gawk coreutils
@@ -20,11 +22,12 @@ ExclusiveArch:  i586 x86_64
 Patch1: microcode_ctl.patch
 
 %description
-microcode_ctl - updates the microcode on Intel x86/x86-64 CPU's
+microcode_ctl - updates the microcode on Intel and AMD x86/x86-64 CPU's
 
 %prep
 %setup -q
 %patch1 -p1
+tar xvf %{SOURCE3}
 
 %build
 make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
@@ -34,6 +37,7 @@ rm -rf %{buildroot}
 
 mkdir -p %{buildroot}/usr/share/man/man{1,8}
 mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
+mkdir -p %{buildroot}/lib/firmware/amd-ucode/
 
 make DESTDIR=%{buildroot} PREFIX=%{_prefix} \
      INSDIR=/sbin MANDIR=%{_mandir}/man8 RCDIR=%{_sysconfdir} install clean
@@ -41,6 +45,11 @@ make DESTDIR=%{buildroot} PREFIX=%{_pref
 install %{SOURCE1} %{buildroot}%{_sysconfdir}/init.d/microcode_ctl
 install -m 644 %{SOURCE2} %{buildroot}/lib/firmware/microcode.dat
 
+install -m 644 amd-ucode-2009-10-09/microcode_amd.bin %{buildroot}/lib/firmware/amd-ucode/microcode_amd.bin
+install -m 644 amd-ucode-2009-10-09/LICENSE LICENSE.microcode_amd
+install -m 644 amd-ucode-2009-10-09/README README.microcode_amd
+install -m 644 amd-ucode-2009-10-09/INSTALL INSTALL.microcode_amd
+
 chmod -R a-s %{buildroot}
 
 %clean
@@ -51,33 +60,52 @@ rm -rf %{buildroot}
 %{_sysconfdir}/init.d/microcode_ctl
 /lib/firmware/*
 /sbin/microcode_ctl
+%doc LICENSE.microcode_amd README.microcode_amd INSTALL.microcode_amd
 %attr(0644,root,root) %{_mandir}/*/*
 
-
-
 %preun
 if [ "$1" = "0" ] ; then
     /sbin/chkconfig --del microcode_ctl
 fi
 
 %post
-# Only enable on Intel 686's and above.
+# Only enable on Intel 686's and above or AMD family 0x10 and above
 vendor=`cat /proc/cpuinfo | grep "^vendor_id" | sort -u | awk -F ": " '{ print $2 }'`
-[ "$vendor" != "GenuineIntel" ] && exit 0
 family=`cat /proc/cpuinfo | grep "^cpu family" | sort -u | awk -F ": " '{ print $2 }'`
-[ $family -lt 6 ] && exit 0
+if [ "$vendor" = "GenuineIntel" ]; then
+ [ $family -lt 6 ] && exit 0
+elif [ "$vendor" = "AuthenticAMD" ]; then
+ [ $family -lt 16 ] && exit 0
+else
+ exit 0
+fi
+
 /sbin/chkconfig --add microcode_ctl
+exit 0
 
 %triggerpostun -- kernel-utils
-# Only enable on Intel 686's and above.
+# Only enable on Intel 686's and above or AMD family 0x10 and above
 vendor=`cat /proc/cpuinfo | grep "^vendor_id" | sort -u | awk -F ": " '{ print $2 }'`
-[ "$vendor" != "GenuineIntel" ] && exit 0
 family=`cat /proc/cpuinfo | grep "^cpu family" | sort -u | awk -F ": " '{ print $2 }'`
-[ $family -lt 6 ] && exit 0
+if [ "$vendor" = "GenuineIntel" ]; then
+ [ $family -lt 6 ] && exit 0
+elif [ "$vendor" = "AuthenticAMD" ]; then
+ [ $family -lt 16 ] && exit 0
+else
+ exit 0
+fi
+
 /sbin/chkconfig --add microcode_ctl
 exit 0
 
 %changelog
+* Wed Dec 02 2009 Kyle McMartin <kyle at redhat.com> 1.17-1.52
+- Add AMD x86/x86-64 microcode. (Dated: 2009-10-09)
+  Doesn't need microcode_ctl modifications as it's loaded by
+  request_firmware() like any other sensible driver.
+- Eventually, this AMD firmware can probably live inside
+  kernel-firmware once it is split out.
+
 * Wed Jun  3 2009 Kyle McMartin <kyle at redhat.com>
 - s/i686/i586/
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/microcode_ctl/F-11/sources,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -p -r1.11 -r1.12
--- sources	24 May 2009 01:28:16 -0000	1.11
+++ sources	4 Dec 2009 17:40:21 -0000	1.12
@@ -1,2 +1,3 @@
 98a7f06acef8459c8ef2a1b0fb86a99e  microcode_ctl-1.17.tar.gz
 d4e108cf99867c1a350c62a92197873d  microcode-20090330.dat
+524c5680aae1de04da1bf3371fd07a2d  amd-ucode-2009-10-09.tar




More information about the fedora-extras-commits mailing list