Bug #4160: Fix Altix kernel version check.
This commit is contained in:
parent
6b0cdc5dd9
commit
5ffff7cb86
|
@ -32,6 +32,7 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <stdlib,h>
|
||||||
|
|
||||||
#include "ia64Pci.h"
|
#include "ia64Pci.h"
|
||||||
#include "Pci.h"
|
#include "Pci.h"
|
||||||
|
@ -47,11 +48,21 @@ IA64Chipset OS_PROBE_PCI_CHIPSET(scanpciWrapperOpt flags)
|
||||||
return ZX1_CHIPSET;
|
return ZX1_CHIPSET;
|
||||||
|
|
||||||
if (!stat("/proc/sgi_sn/licenseID", &unused)) {
|
if (!stat("/proc/sgi_sn/licenseID", &unused)) {
|
||||||
/*
|
int major, minor, patch;
|
||||||
* We need a 2.6.11 or better kernel for Altix support
|
char *c;
|
||||||
*/
|
|
||||||
|
/* We need a 2.6.11 or better kernel for Altix support */
|
||||||
uname(&utsName);
|
uname(&utsName);
|
||||||
if (!strstr(utsName.release, "2.6.11")) {
|
c = utsName.release;
|
||||||
|
|
||||||
|
major = atoi(c);
|
||||||
|
c = strstr(c, ".") + 1;
|
||||||
|
minor = atoi(c);
|
||||||
|
c = strstr(c, ".") + 1;
|
||||||
|
patch = atoi(c);
|
||||||
|
|
||||||
|
if (major < 2 || (major == 2 && minor < 6) ||
|
||||||
|
(major == 2 && minor == 6 && patch < 11)) {
|
||||||
ErrorF("Kernel 2.6.11 or better needed for Altix support\n");
|
ErrorF("Kernel 2.6.11 or better needed for Altix support\n");
|
||||||
return NONE_CHIPSET;
|
return NONE_CHIPSET;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue