From e2a1957964392ce34e41bd11628b96b31a16ee03 Mon Sep 17 00:00:00 2001 From: Jarod Wilson Date: Fri, 8 Feb 2008 02:36:06 +0000 Subject: [PATCH] - Spec cleanup and macro standardization. - Update license - Update microcode data file to 20080131 revision. --- .cvsignore | 1 + microcode_ctl.patch | 52 ++++++++++++++++++++++----------------------- microcode_ctl.spec | 47 ++++++++++++++++++++-------------------- sources | 1 + 4 files changed, 52 insertions(+), 49 deletions(-) diff --git a/.cvsignore b/.cvsignore index 84ef4b8..f6dc173 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,3 +1,4 @@ clog microcode_ctl-1.17 microcode_ctl-1.17.tar.gz +microcode-20080131.dat diff --git a/microcode_ctl.patch b/microcode_ctl.patch index ede95da..e6f7849 100644 --- a/microcode_ctl.patch +++ b/microcode_ctl.patch @@ -1,29 +1,41 @@ ---- microcode_ctl-1.17/Makefile~ Mon Jun 11 16:57:42 2001 -+++ microcode_ctl-1.17/Makefile Tue Jan 8 20:20:58 2002 -@@ -20,7 +20,7 @@ +diff -Naurp microcode_ctl-1.17.orig/Makefile microcode_ctl-1.17/Makefile +--- microcode_ctl-1.17.orig/Makefile 2007-04-26 06:59:44.000000000 -0400 ++++ microcode_ctl-1.17/Makefile 2008-02-05 11:22:23.000000000 -0500 +@@ -20,8 +20,8 @@ DESTDIR = PREFIX = /usr/local INSDIR = $(PREFIX)/sbin -MANDIR = $(PREFIX)/man/man8 +-MICDIR = /etc +MANDIR = $(PREFIX)/share/man/man8 - MICDIR = /etc ++MICDIR = /etc/firmware RCFILE = microcode_ctl.start -@@ -45,7 +45,7 @@ + RCFILEFINAL = microcode_ctl +@@ -44,7 +44,7 @@ install: + $(DESTDIR)$(MANDIR) $(DESTDIR)$(RCFILETO) \ $(DESTDIR)$(RCLINKTO) - $(INS) -s -m 755 $(PROGRAM) $(DESTDIR)$(INSDIR) + $(INS) -m 755 $(PROGRAM) $(DESTDIR)$(INSDIR) -- $(INS) -m 644 $(MICROCODE) $(DESTDIR)$(MICDIR)/microcode.dat -+ $(INS) -m 644 $(MICROCODE) $(DESTDIR)/etc/firmware/microcode.dat + $(INS) -m 644 $(MICROCODE) $(DESTDIR)$(MICDIR)/microcode.dat $(INS) -m 644 $(MANPAGE) $(DESTDIR)$(MANDIR) - gzip -9f $(DESTDIR)$(MANDIR)/$(MANPAGE) ---- microcode_ctl-1.17/microcode_ctl.c.org 2003-05-28 19:56:22.000000000 +0200 -+++ microcode_ctl-1.17/microcode_ctl.c 2003-05-28 19:57:01.000000000 +0200 -@@ -95,11 +95,13 @@ +diff -Naurp microcode_ctl-1.17.orig/microcode_ctl.c microcode_ctl-1.17/microcode_ctl.c +--- microcode_ctl-1.17.orig/microcode_ctl.c 2006-06-28 10:51:31.000000000 -0400 ++++ microcode_ctl-1.17/microcode_ctl.c 2008-02-05 11:21:31.000000000 -0500 +@@ -25,7 +25,7 @@ int print_error_messages=1; + #define MAX_MICROCODE 2000000 + + #define MICROCODE_DEVICE_DEFAULT "/dev/cpu/microcode" +-#define MICROCODE_FILE_DEFAULT "/etc/microcode.dat" ++#define MICROCODE_FILE_DEFAULT "/etc/firmware/microcode.dat" + + static void usage(void) { - FILE *fd; +@@ -52,11 +52,13 @@ static int do_update(char *device, char + { + FILE *fp; char line_buffer[BUFFER_SIZE]; - int microcode[MAX_MICROCODE]; + int *microcode; @@ -34,9 +46,9 @@ + microcode=malloc(sizeof(int)* MAX_MICROCODE); + if (!microcode) return ENOMEM; - if( (fd=fopen(filename, "r")) == NULL){ + if( (fp=fopen(filename, "r")) == NULL){ if(print_error_messages) -@@ -146,7 +146,7 @@ +@@ -101,7 +103,7 @@ static int do_update(char *device, char return errno; } @@ -45,15 +57,3 @@ if(print_error_messages) fprintf(stderr, "%s: error writing to '%s' errno=%d (%s)\n" "%s: there may be messages from the driver in your system log.\n", - ---- microcode_ctl-1.17/microcode_ctl.c~ 2005-01-21 17:42:53.000000000 -0500 -+++ microcode_ctl-1.17/microcode_ctl.c 2005-01-21 17:43:03.000000000 -0500 -@@ -25,7 +25,7 @@ int print_error_messages=1; - #define MAX_MICROCODE 2000000 - - #define MICROCODE_DEVICE_DEFAULT "/dev/cpu/microcode" --#define MICROCODE_FILE_DEFAULT "/etc/microcode.dat" -+#define MICROCODE_FILE_DEFAULT "/etc/firmware/microcode.dat" - - static void usage(void) - { diff --git a/microcode_ctl.spec b/microcode_ctl.spec index d42d2cf..c9c5442 100644 --- a/microcode_ctl.spec +++ b/microcode_ctl.spec @@ -4,9 +4,13 @@ Version: 1.17 Release: %(R="$Revision$"; RR="${R##: }"; echo ${RR%%?})%{?dist} Epoch: 1 Group: System Environment/Base -License: GPL -Source0: microcode_ctl-%{version}.tar.gz +License: GPLv2+ +URL: http://www.urbanmyth.org/microcode/ +Source0: http://www.urbanmyth.org/microcode/microcode_ctl-%{version}.tar.gz Source1: microcode_ctl.init +# Microcode now distributed directly by Intel, at +# http://downloadcenter.intel.com/default.aspx (just search for microcode) +Source2: microcode-20080131.dat Buildroot: %{_tmppath}/%{name}-%{version}-root Prereq: /sbin/chkconfig /sbin/service Prereq: grep gawk coreutils @@ -19,41 +23,33 @@ Patch1: microcode_ctl.patch microcode_ctl - updates the microcode on Intel x86/x86-64 CPU's %prep -%setup -q -c -%patch1 -p0 +%setup -q +%patch1 -p1 %build -rm -rf $RPM_BUILD_ROOT - -mkdir -p %{buildroot}/usr/sbin -mkdir -p %{buildroot}/usr/man -mkdir -p %{buildroot}/etc/rc.d/init.d -mkdir -p %{buildroot}/etc/sysconfig - -cd microcode_ctl-%{version} make CFLAGS="$RPM_OPT_FLAGS" -cd .. %install +rm -rf %{buildroot} + mkdir -p %{buildroot}/usr/share/man/man{1,8} +mkdir -p %{buildroot}%{_sysconfdir}/sysconfig -cd microcode_ctl-%{version} +make DESTDIR=%{buildroot} PREFIX=%{_prefix} \ + INSDIR=/sbin MANDIR=%{_mandir}/man8 RCDIR=%{_sysconfdir} MICDIR=%{_sysconfdir}/firmware install clean -make DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix} \ - INSDIR=/sbin MANDIR=%{_mandir}/man8 RCDIR=/etc MICDIR=/etc/firmware install clean - -install %{SOURCE1} %{buildroot}/etc/rc.d/init.d/microcode_ctl -rm %{buildroot}/etc/init.d/microcode_ctl -cd .. +install %{SOURCE1} %{buildroot}%{_sysconfdir}/init.d/microcode_ctl +install %{SOURCE2} %{buildroot}%{_sysconfdir}/firmware/microcode.dat chmod -R a-s %{buildroot} + %clean -[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; +[ "%{buildroot}" != "/" ] && [ -d %{buildroot} ] && rm -rf %{buildroot}; %files %defattr(-,root,root) -/etc/rc.d/init.d/microcode_ctl -/etc/firmware/* +%{_sysconfdir}/init.d/microcode_ctl +%{_sysconfdir}/firmware/* /sbin/microcode_ctl %attr(0644,root,root) %{_mandir}/*/* @@ -82,6 +78,11 @@ family=`cat /proc/cpuinfo | grep "^cpu family" | sort -u | awk -F ": " '{ print exit 0 %changelog +* Thu Feb 07 2008 Jarod Wilson +- Spec cleanup and macro standardization. +- Update license +- Update microcode data file to 20080131 revision. + * Mon Jul 2 2007 Dave Jones - Update to upstream 1.17 diff --git a/sources b/sources index e041598..c5f5239 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ 98a7f06acef8459c8ef2a1b0fb86a99e microcode_ctl-1.17.tar.gz +87feaa28fee76eebdd6cf57a80c41e5f microcode-20080131.dat