aboutsummaryrefslogtreecommitdiffstats
path: root/sdk/bin/diag
blob: aa56844d02b02c83f230aecde7acf1db4545bf1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#!/bin/sh

files=''
ldd='no'
gcc='no'
hardware='no'
startup='no'
drivers='no'
symbols='no'
tracer=''

if [ -f /usr/bin/strace ] ; then
	tracer='strace'
fi

if [ -f /bin/strace ] ; then
	tracer='strace'
fi

if [ -f /sbin/strace ] ; then
	tracer='strace'
fi

if [ -f /bin/ldd ] ; then
	ldd='yes'
fi

if [ -f /usr/bin/ldd ] ; then
	ldd='yes'
fi

if [ -f /usr/bin/gcc ] ; then
	gcc='yes'
fi

if [ -f /usr/local/bin/gcc ] ; then
	gcc='yes'
fi

if [ -f config.diag ] ; then
	. ./config.diag
fi

if [ ! -z "$title" ] ; then
	echo $title
fi

if [ ! -z "$strace" ] ; then
	for trace in $strace ; do
		echo
		ls -l $trace
		if [ $ldd = 'yes' ] ; then
			echo
			echo "Library map for " $trace
			ldd $trace
		fi
		if [ $symbols = 'yes' ] ; then
			echo
			nm $trace
		fi
		if [ ! -z "$tracer" ] ; then
			echo
			$tracer $opts $trace 2>&1
		fi
	done
fi

echo
echo -n "System Type: "
uname -s 

echo -n "Achitecture: " 
uname -m 

echo -n "Release:     " 
uname -r

if [ $gcc = 'yes' ] ; then
	echo 
	echo "GCC Information:" 
	gcc -v 2>&1
fi

if [ -f /proc/meminfo ] ; then
	echo 
	echo "Memory:" 
	cat /proc/meminfo 
fi

echo "" 
echo "Disks:" 
df 

if [ $startup = 'yes' ] ; then

	if [ -d /etc/rc.d ] ; then
		echo 
		echo "Services:" 
		ls -l /etc/rc.d 
		if [ -d /etc/rc.d/rc3.d ] ; then
			echo 
			echo "Startup:"
			ls /etc/rc.d/rc3.d 
		fi
	fi
fi

if [ -f config.cache ] ; then
	echo 
	echo "Configuration:" 
	cat config.cache
fi

if [ -f config.cc ] ; then
	echo 
	echo "Compiler:" 
	cat config.cc
fi

if [ ! -z "$files" ] ; then
	for file in $files ; do
		if [ -f $file ] ; then
			echo
			echo "Found: " $file
			echo
			cat $file
		fi
	done
fi

if [ $drivers = 'yes' ] ; then

	if [ -f /proc/modules ] ; then
		echo 
		echo "Modules:" 
		cat /proc/modules
	fi
fi

if [ $hardware = 'yes' ] ; then

	if [ -f /proc/devices ] ; then
		echo 
		echo "Devices:" 
		cat /proc/devices 
	fi

	if [ -f /proc/ioports ] ; then
		echo 
		echo "Ports:" 
		cat /proc/ioports 
	fi

	if [ -f /proc/interrupts ] ; then
		echo 
		echo "Interrupts:" 
		cat /proc/interrupts 
	fi

	if [ -f /proc/dma ] ; then
		echo
		echo "DMA:"
		cat /proc/dma
	fi

	if [ -f /proc/cpuinfo ] ; then
		echo 
		cat /proc/cpuinfo 
	fi
fi