[arch-commits] CVS update of extra/system/microcode_ctl (3 files)

Thomas Baechler thomas at archlinux.org
Mon Jul 9 23:10:32 UTC 2007


    Date: Monday, July 9, 2007 @ 19:10:32
  Author: thomas
    Path: /home/cvs-extra/extra/system/microcode_ctl

   Added: PKGBUILD (1.1) microcode (1.1) microcode.rules (1.1)

upgpkg: microcode_ctl 1.17-2


-----------------+
 PKGBUILD        |   26 +++++++++++++++++++++++++
 microcode       |   55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 microcode.rules |    1 
 3 files changed, 82 insertions(+)


Index: extra/system/microcode_ctl/PKGBUILD
diff -u /dev/null extra/system/microcode_ctl/PKGBUILD:1.1
--- /dev/null	Mon Jul  9 19:10:31 2007
+++ extra/system/microcode_ctl/PKGBUILD	Mon Jul  9 19:10:31 2007
@@ -0,0 +1,26 @@
+# $Id: PKGBUILD,v 1.1 2007/07/09 23:10:31 thomas Exp $
+# Contributor: Giovanni Scafora <linuxmania at gmail.com>
+# Maintainer: Thomas Baechler <thomas at archlinux.org>
+
+pkgname=microcode_ctl
+pkgver=1.17
+pkgrel=2
+pkgdesc="A companion to the IA32 microcode kernel driver"
+arch=('i686' 'x86_64')
+url="http://www.urbanmyth.org/microcode"
+license=('GPL')
+install=microcode_ctl.install
+#depends=('kernel26>=2.6.20')
+source=(http://www.urbanmyth.org/microcode/$pkgname-$pkgver.tar.gz
+        microcode
+        microcode.rules)
+md5sums=('98a7f06acef8459c8ef2a1b0fb86a99e'
+         'e694f32b7e30674786100b371ab50384'
+         'e6f212fcb6af8c4f3464db2e9210655e')
+
+build() {
+  cd $startdir/src/$pkgname-$pkgver
+  make all || return 1
+  make DESTDIR=$startdir/pkg PREFIX=/usr RCFILETO=/etc/rc.d RCFILE=../microcode RCFILEFINAL=microcode install
+  install -D -m644 ../microcode.rules $startdir/pkg/etc/udev/rules.d/microcode.rules
+}
Index: extra/system/microcode_ctl/microcode
diff -u /dev/null extra/system/microcode_ctl/microcode:1.1
--- /dev/null	Mon Jul  9 19:10:31 2007
+++ extra/system/microcode_ctl/microcode	Mon Jul  9 19:10:31 2007
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+DEVICE=/dev/cpu/microcode
+RETVAL=0
+MODULE=0
+
+case "$1" in
+start|restart|load)
+	stat_busy "Applying Intel IA32 Microcode update"
+	# Lets just be sure we have a device file...
+	if [ ! -e $DEVICE ]; then
+		modprobe microcode
+		if [ $? -le 0 ]; then
+			MODULE=1
+		else
+			stat_fail
+			echo "$0: microcode device $DEVICE doesn't exist"
+			exit 1
+		fi
+	fi
+
+	if [ ! -c $DEVICE ]; then
+		echo "$0: $DEVICE not a character device"
+		stat_fail
+		exit 1
+	fi
+
+	/usr/sbin/microcode_ctl -Qu
+	RETVAL=$?
+	if [ $RETVAL -le 0 ]; then
+		stat_done
+		if [ $MODULE = 1 ]; then
+			modprobe -r microcode
+		fi
+	else
+		stat_fail
+		# trap the most common cases
+		if [ $RETVAL -eq 3 ]; then
+			echo "$0: Cannot find source file \"/etc/microcode.dat\""
+		elif [ $RETVAL -eq 19 ]; then
+			grep MICROCODE /usr/include/linux/autoconf.h | grep -q ^#define
+			if [ $? -ne 0 ]; then
+				echo "$0: This kernel doesn't appear to have microcode device support"
+			fi
+		fi
+	fi
+	;;
+stop)
+	;;
+*)
+	echo "usage: $0 {start|restart}"  
+esac
Index: extra/system/microcode_ctl/microcode.rules
diff -u /dev/null extra/system/microcode_ctl/microcode.rules:1.1
--- /dev/null	Mon Jul  9 19:10:31 2007
+++ extra/system/microcode_ctl/microcode.rules	Mon Jul  9 19:10:32 2007
@@ -0,0 +1 @@
+KERNEL=="microcode", NAME="cpu/%k"




More information about the arch-commits mailing list