r570 - in /trunk/boinc/debian/patches: 00list
14_cpuinfo-sparc.dpatch
smoe-guest at users.alioth.debian.org
smoe-guest at users.alioth.debian.org
Sun Feb 4 00:50:04 CET 2007
Author: smoe-guest
Date: Sun Feb 4 00:50:03 2007
New Revision: 570
URL: http://svn.debian.org/wsvn/pkg-boinc/?sc=1&rev=570
Log:
Added Thibaut Varene's patch on detection version information on more
exotic platforms like Debian Sparc.
Added:
trunk/boinc/debian/patches/14_cpuinfo-sparc.dpatch
Modified:
trunk/boinc/debian/patches/00list
Modified: trunk/boinc/debian/patches/00list
URL: http://svn.debian.org/wsvn/pkg-boinc/trunk/boinc/debian/patches/00list?rev=570&op=diff
==============================================================================
--- trunk/boinc/debian/patches/00list (original)
+++ trunk/boinc/debian/patches/00list Sun Feb 4 00:50:03 2007
@@ -1,3 +1,4 @@
01_amd64-disable-platform-reset.dpatch
07_use-sensible-browser.dpatch
10_exclude-sea.dpatch
+14_cpuinfo-sparc.dpatch
Added: trunk/boinc/debian/patches/14_cpuinfo-sparc.dpatch
URL: http://svn.debian.org/wsvn/pkg-boinc/trunk/boinc/debian/patches/14_cpuinfo-sparc.dpatch?rev=570&op=file
==============================================================================
--- trunk/boinc/debian/patches/14_cpuinfo-sparc.dpatch (added)
+++ trunk/boinc/debian/patches/14_cpuinfo-sparc.dpatch Sun Feb 4 00:50:03 2007
@@ -1,0 +1,181 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 14_cpuinfo-sparc.dpatch by <steffen_moeller at gmx.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fixing readout of architecture-dependent /proc/cpuinfo
+## DP: Patch submitted by Thibaut Varene.
+
+ at DPATCH@
+
+--- boinc-5.4.11.orig/client/hostinfo_unix.C 2006-03-02 08:17:17.000000000 +0100
++++ boinc-5.4.11/client/hostinfo_unix.C 2007-02-03 01:32:36.491942808 +0100
+@@ -323,7 +323,168 @@
+ fclose(f);
+ }
+
+-#else // not mips or alpha
++#elif __ia64__
++
++void parse_cpuinfo(HOST_INFO& host) {
++ char buf[256];
++ int system_found=0,model_found=0;
++ int n;
++ host.m_cache = 0;
++
++ FILE* f = fopen("/proc/cpuinfo", "r");
++ if (!f) return;
++
++ while (fgets(buf, 256, f)) {
++ if ( (strstr(buf, "vendor : ") == buf) &&
++ (system_found == 0) ) {
++ system_found = 1;
++ strncpy(host.p_vendor, strchr(buf, ':') + 2, sizeof(host.p_vendor) - 1);
++ char * p = strchr(host.p_vendor, '\n');
++ if (p) {
++ *p = '\0';
++ }
++ }
++ if ( (strstr(buf, "family : ") == buf) &&
++ (model_found == 0) ) {
++ model_found = 1;
++ strncpy(host.p_model, strchr(buf, ':') + 2, sizeof(host.p_model) - 1);
++ char * p = strchr(host.p_model, '\n');
++ if (p) {
++ *p = '\0';
++ }
++ }
++ }
++
++ fclose(f);
++}
++
++#elif __hppa__
++
++void parse_cpuinfo(HOST_INFO& host) {
++ char buf[256];
++ int system_found=0,model_found=0,icache_found=0,dcache_found=0;
++ int n;
++ host.m_cache = 0;
++
++ FILE* f = fopen("/proc/cpuinfo", "r");
++ if (!f) return;
++
++ while (fgets(buf, 256, f)) {
++ if ( (strstr(buf, "cpu\t\t: ") == buf) &&
++ (system_found == 0) ) {
++ system_found = 1;
++ strncpy(host.p_vendor, strchr(buf, ':') + 2, sizeof(host.p_vendor) - 1);
++ char * p = strchr(host.p_vendor, '\n');
++ if (p) {
++ *p = '\0';
++ }
++ }
++ if ( (strstr(buf, "model name\t: ") == buf) &&
++ (model_found == 0) ) {
++ model_found = 1;
++ strncpy(host.p_model, strchr(buf, ':') + 2, sizeof(host.p_model) - 1);
++ char * p = strchr(host.p_model, '\n');
++ if (p) {
++ *p = '\0';
++ }
++ }
++ if ( (strstr(buf, "I-cache\t\t: ") == buf) &&
++ (icache_found == 0) ) {
++ icache_found = 1;
++ sscanf(buf, "I-cache\t\t: %d", &n);
++ host.m_cache += n*1024;
++ }
++ if ( (strstr(buf, "D-cache\t\t: ") == buf) &&
++ (dcache_found == 0) ) {
++ dcache_found = 1;
++ sscanf(buf, "D-cache\t\t: %d", &n);
++ host.m_cache += n*1024;
++ }
++ }
++
++ fclose(f);
++}
++
++#elif __powerpc__
++
++void parse_cpuinfo(HOST_INFO& host) {
++ char buf[256];
++ int system_found=0,model_found=0,cache_found=0;
++ int n;
++ char* coma=NULL;
++ host.m_cache=0;
++
++ FILE* f = fopen("/proc/cpuinfo", "r");
++ if (!f) return;
++
++ while (fgets(buf, 256, f)) {
++ if ( (strstr(buf, "machine\t\t: ") == buf) &&
++ (system_found == 0) ) {
++ system_found = 1;
++ strncpy(host.p_vendor, strchr(buf, ':') + 2, sizeof(host.p_vendor) - 1);
++ char * p = strchr(host.p_vendor, '\n');
++ if (p) {
++ *p = '\0';
++ }
++ }
++ if ( (strstr(buf, "cpu\t\t: ") == buf) &&
++ (model_found == 0) ) {
++ model_found = 1;
++ if ((coma = strrchr(buf, ',')))
++ *coma = '\0'; /* we don't want the ", altivec supported" */
++ strncpy(host.p_model, strchr(buf, ':') + 2, sizeof(host.p_model) - 1);
++ char * p = strchr(host.p_model, '\n');
++ if (p) {
++ *p = '\0';
++ }
++ }
++ if ( (strstr(buf, "L2-cache\t: ") == buf) &&
++ (cache_found == 0) ) {
++ cache_found = 1;
++ sscanf(buf, "L2-cache\t: %d", &n);
++ host.m_cache = n*1024;
++ }
++ }
++
++ fclose(f);
++}
++
++#elif __sparc__
++
++void parse_cpuinfo(HOST_INFO& host) {
++ char buf[256];
++ int system_found=0,model_found=0;
++ int n;
++ host.m_cache=0;
++
++ FILE* f = fopen("/proc/cpuinfo", "r");
++ if (!f) return;
++
++ while (fgets(buf, 256, f)) {
++ if ( (strstr(buf, "type\t\t: ") == buf) &&
++ (system_found == 0) ) {
++ system_found = 1;
++ strncpy(host.p_vendor, strchr(buf, ':') + 2, sizeof(host.p_vendor) - 1);
++ char * p = strchr(host.p_vendor, '\n');
++ if (p) {
++ *p = '\0';
++ }
++ }
++ if ( (strstr(buf, "cpu\t\t: ") == buf) &&
++ (model_found == 0) ) {
++ model_found = 1;
++ strncpy(host.p_model, strchr(buf, ':') + 2, sizeof(host.p_model) - 1);
++ char * p = strchr(host.p_model, '\n');
++ if (p) {
++ *p = '\0';
++ }
++ }
++ }
++
++ fclose(f);
++}
++
++#else // not mips or alpha or ia64 or hppa or powerpc or sparc
+
+ // Unfortunately the format of /proc/cpuinfo is not standardized.
+ // See http://people.nl.linux.org/~hch/cpuinfo/ for some examples.
More information about the pkg-boinc-commits
mailing list