2008-02-08 02:36:06 +00:00
|
|
|
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 =
|
2005-01-08 08:23:02 +00:00
|
|
|
PREFIX = /usr/local
|
|
|
|
|
|
|
|
INSDIR = $(PREFIX)/sbin
|
|
|
|
-MANDIR = $(PREFIX)/man/man8
|
2008-02-08 02:36:06 +00:00
|
|
|
-MICDIR = /etc
|
2005-01-08 08:23:02 +00:00
|
|
|
+MANDIR = $(PREFIX)/share/man/man8
|
2008-02-08 02:36:06 +00:00
|
|
|
+MICDIR = /etc/firmware
|
2005-01-08 08:23:02 +00:00
|
|
|
|
|
|
|
RCFILE = microcode_ctl.start
|
2008-02-08 02:36:06 +00:00
|
|
|
RCFILEFINAL = microcode_ctl
|
|
|
|
@@ -44,7 +44,7 @@ install:
|
|
|
|
$(DESTDIR)$(MANDIR) $(DESTDIR)$(RCFILETO) \
|
2005-01-08 08:23:02 +00:00
|
|
|
$(DESTDIR)$(RCLINKTO)
|
|
|
|
|
|
|
|
- $(INS) -s -m 755 $(PROGRAM) $(DESTDIR)$(INSDIR)
|
|
|
|
+ $(INS) -m 755 $(PROGRAM) $(DESTDIR)$(INSDIR)
|
2008-02-08 02:36:06 +00:00
|
|
|
$(INS) -m 644 $(MICROCODE) $(DESTDIR)$(MICDIR)/microcode.dat
|
2005-01-08 08:23:02 +00:00
|
|
|
|
|
|
|
$(INS) -m 644 $(MANPAGE) $(DESTDIR)$(MANDIR)
|
2008-02-08 02:36:06 +00:00
|
|
|
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)
|
|
|
|
{
|
|
|
|
@@ -52,11 +52,13 @@ static int do_update(char *device, char
|
2005-01-08 08:23:02 +00:00
|
|
|
{
|
2008-02-08 02:36:06 +00:00
|
|
|
FILE *fp;
|
2005-01-08 08:23:02 +00:00
|
|
|
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;
|
|
|
|
|
2008-02-08 02:36:06 +00:00
|
|
|
if( (fp=fopen(filename, "r")) == NULL){
|
2005-01-08 08:23:02 +00:00
|
|
|
if(print_error_messages)
|
2008-02-08 02:36:06 +00:00
|
|
|
@@ -101,7 +103,7 @@ static int do_update(char *device, char
|
2005-01-08 08:23:02 +00:00
|
|
|
return errno;
|
|
|
|
}
|
|
|
|
|
|
|
|
- if( (wrote = write(outfd, µcode, 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",
|