update to upstream version 1.18

ssia

Signed-off-by: Anton Arapov <anton@redhat.com>
This commit is contained in:
Anton Arapov 2012-07-25 20:54:18 +02:00
parent 30a3475ab6
commit 1f1833d8cb
7 changed files with 19 additions and 172 deletions

2
.gitignore vendored
View File

@ -14,3 +14,5 @@ microcode-20100826.dat
/microcode-20111110.dat
/amd-ucode-2012-01-17.tar
/microcode-20120606.dat
/microcode_ctl-1.18.tar.xz
/microcode_ctl.rules

View File

@ -1,23 +0,0 @@
diff -up microcode_ctl-1.17/microcode_ctl.c.getopt microcode_ctl-1.17/microcode_ctl.c
--- microcode_ctl-1.17/microcode_ctl.c.getopt 2011-12-22 13:15:55.073783568 +0100
+++ microcode_ctl-1.17/microcode_ctl.c 2011-12-22 13:14:22.000000000 +0100
@@ -151,7 +151,8 @@ int main(int argc, char *argv[])
break;
case 'd':
- strcpy(device, optarg);
+ strncpy(device, optarg, sizeof(device));
+ device[sizeof(device)-1] = '\0'; /* ensure null terminated */
break;
case 'u': /* do a microcode upload */
@@ -160,7 +161,8 @@ int main(int argc, char *argv[])
case 'f': /* set microcode file to optarg and upload */
upload++;
- strcpy(filename, optarg);
+ strncpy(filename, optarg, sizeof(filename));
+ filename[sizeof(filename)-1] = '\0'; /* ensure null terminated */
break;
case '?':

View File

@ -1,12 +0,0 @@
diff -urpN microcode_ctl-1.17.orig/microcode_ctl.8 microcode_ctl-1.17/microcode_ctl.8
--- microcode_ctl-1.17.orig/microcode_ctl.8 2011-01-19 16:32:06.039628069 +0100
+++ microcode_ctl-1.17/microcode_ctl.8 2011-01-19 16:32:25.111506738 +0100
@@ -10,7 +10,7 @@ microcode_ctl \- microcode utility for I
." Add any additional description here
.PP
The microcode_ctl utility is a companion to the IA32 microcode driver written
-by Tigran Aivazian <tigran@aivazian.fsnet.co.uk>. The uaility has two uses:
+by Tigran Aivazian <tigran@aivazian.fsnet.co.uk>. The utility has two uses:
.br
.PP
\fBa)\fR it decodes and sends new microcode to the kernel driver to be

View File

@ -1,95 +0,0 @@
diff -urpN microcode_ctl-1.17.orig/Makefile microcode_ctl-1.17/Makefile
--- microcode_ctl-1.17.orig/Makefile 2011-03-24 10:28:12.553269014 +0100
+++ microcode_ctl-1.17/Makefile 2011-03-24 10:28:26.644387088 +0100
@@ -20,8 +20,8 @@ DESTDIR =
PREFIX = /usr/local
INSDIR = $(PREFIX)/sbin
-MANDIR = $(PREFIX)/man/man8
-MICDIR = /etc
+MANDIR = $(PREFIX)/share/man/man8
+MICDIR = /lib/firmware
RCFILE = microcode_ctl.start
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 $(MANPAGE) $(DESTDIR)$(MANDIR)
diff -urpN microcode_ctl-1.17.orig/microcode_ctl.c microcode_ctl-1.17/microcode_ctl.c
--- microcode_ctl-1.17.orig/microcode_ctl.c 2011-03-24 10:28:12.553269014 +0100
+++ microcode_ctl-1.17/microcode_ctl.c 2011-03-24 10:28:29.244262053 +0100
@@ -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 "/lib/firmware/microcode.dat"
static void usage(void)
{
@@ -52,17 +52,19 @@ static int do_update(char *device, char
{
FILE *fp;
char line_buffer[BUFFER_SIZE];
- int microcode[MAX_MICROCODE];
+ int *microcode;
int *pos;
int outfd;
int wrote, length;
+ microcode=malloc(sizeof(int)* MAX_MICROCODE);
+ if (!microcode) return ENOMEM;
if( (fp=fopen(filename, "r")) == NULL){
if(print_error_messages)
fprintf(stderr, "%s: cannot open source file '%s' errno=%d (%s)\n",
progname, filename, errno, strerror(errno));
- return errno;
+ goto end;
}
pos = microcode;
@@ -84,7 +86,7 @@ static int do_update(char *device, char
fprintf(stderr, "%s: file too large for utility microcode buffer\n"
"%s: change MAX_MICROCODE yourself :)\n", progname, progname);
fclose(fp);
- return errno;
+ goto end;
}
}
@@ -98,16 +100,16 @@ static int do_update(char *device, char
if(print_error_messages)
fprintf(stderr, "%s: cannot open %s for writing errno=%d (%s)\n",
progname, device, errno, strerror(errno));
- return errno;
+ goto end;
}
- if( (wrote = write(outfd, &microcode, length)) < 0){
+ if( (wrote = write(outfd, microcode, length)) < 0){
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",
progname, device, errno, strerror(errno), progname);
close(outfd);
- return errno;
+ goto end;
}
if((wrote == length) && print_normal_messages)
@@ -116,6 +118,8 @@ static int do_update(char *device, char
close(outfd);
+end:
+ free(microcode);
return errno;
}

View File

@ -1 +0,0 @@
KERNEL=="cpu[0-9]*", ACTION=="add", RUN+="/sbin/modprobe microcode"

View File

@ -1,73 +1,47 @@
Summary: Tool to update x86/x86-64 CPU microcode.
Name: microcode_ctl
Version: 1.17
Release: 26%{?dist}
Version: 1.18
Release: 1%{?dist}
Epoch: 1
Group: System Environment/Base
License: GPLv2+ and Redistributable, no modification permitted
URL: http://www.urbanmyth.org/microcode/
Source0: http://www.urbanmyth.org/microcode/microcode_ctl-%{version}.tar.gz
URL: http://fedorahosted.org/microcode_ctl
Source0: http://fedorahosted.org/released/microcode_ctl/%{name}-%{version}.tar.xz
Source1: microcode_ctl.rules
# Microcode now distributed directly by Intel, at
# http://downloadcenter.intel.com (just search for microcode)
Source2: microcode-20120606.dat
# http://www.amd64.org/support/microcode.html
Source3: amd-ucode-2012-01-17.tar
# Tool for splitting Intel's microcode file
Source4: intel-microcode2ucode.c
Source2: intel-microcode2ucode.c
Buildroot: %{_tmppath}/%{name}-%{version}-root
Requires: udev
Requires(pre): /sbin/chkconfig /sbin/service
Requires(pre): grep gawk coreutils
ExclusiveArch: %{ix86} x86_64
Patch1: microcode_ctl.patch
Patch2: microcode_ctl-manpage-0.patch
Patch3: microcode_ctl-1.17-getopt.patch
%description
microcode_ctl - updates the microcode on Intel and AMD x86/x86-64 CPU's
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
tar xf %{SOURCE3}
%build
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
gcc -Wall -o intel-microcode2ucode %{SOURCE4}
gcc -Wall -o intel-microcode2ucode %{SOURCE2}
%install
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
INSDIR=/usr/sbin MANDIR=%{_mandir}/man8 install clean
rm -rf %{buildroot}/etc/*
mkdir -p %{buildroot}/lib/udev/rules.d
install -m 644 %{SOURCE1} %{buildroot}/lib/udev/rules.d/89-microcode.rules
install -m 644 amd-ucode-2012-01-17/microcode_amd.bin %{buildroot}/lib/firmware/amd-ucode/microcode_amd.bin
install -m 644 amd-ucode-2012-01-17/microcode_amd_fam15h.bin %{buildroot}/lib/firmware/amd-ucode/microcode_amd_fam15h.bin
install -m 644 amd-ucode-2012-01-17/LICENSE LICENSE.microcode_amd
install -m 644 amd-ucode-2012-01-17/README README.microcode_amd
install -m 644 amd-ucode-2012-01-17/INSTALL INSTALL.microcode_amd
install -m 755 intel-microcode2ucode %{buildroot}/sbin
%{buildroot}/sbin/intel-microcode2ucode %{SOURCE2} >/dev/null
install -m 755 intel-microcode2ucode %{buildroot}/usr/sbin/
%{buildroot}/usr/sbin/intel-microcode2ucode %{buildroot}/lib/firmware/microcode.dat >/dev/null
chmod 0755 intel-ucode
mv intel-ucode %{buildroot}/lib/firmware
rm %{buildroot}/lib/firmware/microcode.dat
chmod -R a-s %{buildroot}
%clean
rm -rf %{buildroot}
@ -75,9 +49,9 @@ rm -rf %{buildroot}
%defattr(-,root,root)
/lib/firmware/*
/lib/udev/rules.d/*
/sbin/microcode_ctl
/sbin/intel-microcode2ucode
%doc LICENSE.microcode_amd README.microcode_amd INSTALL.microcode_amd
/usr/sbin/microcode_ctl
/usr/sbin/intel-microcode2ucode
%doc /usr/share/doc/microcode_ctl/*
%attr(0644,root,root) %{_mandir}/*/*
%triggerun -- microcode_ctl < 1:1.17-2
@ -86,6 +60,9 @@ exit 0
%changelog
* Wed Jul 25 2012 Anton Arapov <anton@redhat.com> 1.18-1
- Update to upstream 1.18
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.17-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

View File

@ -1,4 +1,3 @@
c0eabb7e25e1f9045b7dd5ceabfddd09 amd-ucode-2012-01-17.tar
e56c4ded4787fbccf5e503165f1559b8 microcode_ctl-1.18.tar.xz
0efc5f6c74a4d7e61ca22683c93c98cf intel-microcode2ucode.c
98a7f06acef8459c8ef2a1b0fb86a99e microcode_ctl-1.17.tar.gz
1a1cf79dd1fab186c8a8fbae69aa9649 microcode-20120606.dat
33aa5714e6b7df82a62700109cdf6ef9 microcode_ctl.rules