nodetype 1.31 KB
Newer Older
1
#!/bin/sh
Leigh B. Stoller's avatar
Leigh B. Stoller committed
2
3
#
# EMULAB-COPYRIGHT
Mike Hibler's avatar
Mike Hibler committed
4
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
Leigh B. Stoller's avatar
Leigh B. Stoller committed
5
6
# All rights reserved.
#
7
. /etc/emulab/paths.sh
8

Mike Hibler's avatar
Mike Hibler committed
9
10
11
12
13
14
15
16
17
18
# Why am I trying to fix this script!?
if [ -r $BOOTDIR/nodeid -a -r $BOOTDIR/ltpmap ]; then
    nid=`cat $BOOTDIR/nodeid`
    nt=`grep $nid $BOOTDIR/ltpmap 2>/dev/null | awk "/^H/ { if (\\$3 == \"$nid\") print \\$5 }" 2>/dev/null`
    if [ -n "$nt" ]; then
	echo $nt
	exit 0
    fi
fi

19
20
if [ -x $BINDIR/cpuspeed.awk ]; then
	cpuspeed=`$BINDIR/cpuspeed.awk /proc/cpuinfo`;
21
22
23
24
25
26
else
	cpuspeed='';
fi

if [ x$cpuspeed = x ] || [ $cpuspeed = 0 ]; then
	echo "unknown";
27

Mike Hibler's avatar
Mike Hibler committed
28
# XXX hack for minibed and buff pc600s
29
elif [ $cpuspeed = "850" -a -x $BINDIR/chipset.awk -a -e /proc/pci ]; then
Mike Hibler's avatar
Mike Hibler committed
30
31
32
33
34
35
36
37
38
39
40
41
42
43
    case `$BINDIR/chipset.awk /proc/pci` in
    BX)
	echo pc850	# normal pc850
	;;
    GX)
	echo pcL440GX	# minibed node
	;;
    BX-AGP)
	echo pc850a    # buff pc600 node
	;;
    *)
	echo unknown
   	;;
esac
44
45
46
47
# For Aerospace Corp and Rutgers nodes
elif [ $cpuspeed = "2400" -a -x $BINDIR/chipset.awk -a -e /proc/pci ]; then
    case `$BINDIR/chipset.awk /proc/pci` in
    HI_C)
48
	echo pc${cpuspeed}-aero;
49
50
51
52
53
54
55
56
	;;
    HI_B)
	echo pc${cpuspeed}-orbit;
	;;
    *)
	echo unknown
   	;;
    esac
57
58
59
60
# For Wiconsin nodes - they have a different node typing scheme
elif [ $cpuspeed = "2500" ]; then
	echo i2;

61
62
63
else
	echo pc$cpuspeed;
fi