File: system_report

package info (click to toggle)
megaglest 3.13.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 12,844 kB
  • ctags: 18,191
  • sloc: cpp: 144,280; ansic: 11,861; sh: 3,233; perl: 1,904; python: 1,751; objc: 142; asm: 42; makefile: 24
file content (432 lines) | stat: -rwxr-xr-x 18,466 bytes parent folder | download | duplicates (4)
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
#!/bin/sh
#
# MegaGlest System Report
#
# Examines the Linux operating environment of a MegaGlest installation and 
# dumps this information into REPORT_LOCATION for support purposes.
#
# -----------------------------------------------------------------------------
#
# Written by Tom Reynolds <tomreyn[at]megaglest.org>
# Copyright (c) 2012-2016 Tom Reynolds, The MegaGlest Team, under GNU GPL v3.0
#
# -----------------------------------------------------------------------------
#
# Configuration section

# Location to write report to
#REPORT_LOCATION=

# MegaGlest installation directory, see --help
#INSTALLATION_LOCATION=

# Make user press Enter to exit
#PAUSE=1

# End of configuration section
#
# -----------------------------------------------------------------------------
#

LANG=C
VERSION='0.3.4'
MYNAME=`basename $0`
DEFAULT_REPORT_FILENAME=system_report.log

if [ "$1"'x' = '-vx' -o "$1"'x' = '--versionx' ]
then
	echo 'MegaGlest System Report '"$VERSION"
	echo ''
	exit 0
fi

if [ "$1"'x' = '-hx' -o "$1"'x' = '--helpx' ]
then
	echo 'Usage:'
	echo ' '"$MYNAME"' <OPTION>'
	echo ' '"$MYNAME"' [INSTALLATION LOCATION]'
	echo ''
	echo 'Available options:'
	echo ' --version   output version information and exit'
	echo ' --help      display this help and exit'
	echo ''
	echo 'INSTALLATION LOCATION is an optional argument which specifies the MegaGlest'
	echo 'installation directory, containing the "start_megaglest" wrapper script.'
	echo ''
	exit 0
fi


if [ "$REPORT_LOCATION"'x' = 'x' ]
then
	REPORT_LOCATION=$DEFAULT_REPORT_FILENAME
fi

if [ "$PAUSE"'x' = 'x' ]
then
	PAUSE=1
fi

# Check whether report file is writable
rm -f "$REPORT_LOCATION"
touch "$REPORT_LOCATION" >/dev/null 2>&1
if [ "$?"'x' != '0x' ]
then # Unable to write report file
	rm -f /tmp/$DEFAULT_REPORT_FILENAME
	touch /tmp/$DEFAULT_REPORT_FILENAME >/dev/null 2>&1
	if [ "$?"'x' != '0x' ]
	then # Unable to write to backup report file location
		echo 'ERROR: Unable to write to either '"$REPORT_LOCATION"' or /tmp/'"$DEFAULT_REPORT_FILENAME" >&2
		echo '       Please edit this script and set REPORT_LOCATION to a writable location.' >&2
		echo '' >&2
		rm -f "$REPORT_LOCATION"
		exit 1
	else # Writing to backup report file location succeeded
		echo 'WARNING: Unable to write to '"$REPORT_LOCATION"'.'
		echo '         I will write to /tmp/'"$DEFAULT_REPORT_FILENAME"' (which is writable) instead.' >&2
		echo '' >&2
		REPORT_LOCATION=/tmp/$DEFAULT_REPORT_FILENAME
	fi
fi
rm -f "$REPORT_LOCATION"


installation_location_unusable () {
	echo 'ERROR: The INSTALLATION_LOCATION you provided is unusable:' >&2
	echo '  '"$INSTALLATION_LOCATION" >&2
	echo '' >&2
	echo 'Please specify the directory you installed to (which must contain the' >&2
	echo 'start_megaglest script) as first parameter to this script, e.g.:' >&2
	echo '  '"$MYNAME"' /home/paulo/MegaGlest-3' >&2
	echo '' >&2
	echo 'You may try to use the following commands to locate the script:' >&2
	echo '  locate -b '"'"'\start_megaglest'"'" >&2
	echo '  find -type f -name start_megaglest ~/' >&2
	echo '  sudo find -type f -name start_megaglest /' >&2
	echo '' >&2
	echo 'Please be aware that this script is written to work with installations created' >&2
	echo 'using the installation instructions on http://megaglest.org. It may or may not' >&2
	echo 'work with variants of MegaGlest which were packaged by your Linux distribution.' >&2
	echo '' >&2
}

# Locate MegaGlest installation location
if [ "$INSTALLATION_LOCATION"'x' != 'x' ] # The user provided an installation directory via env. variable
then
	if [ -f "$INSTALLATION_LOCATION/start_megaglest" -o -h "$INSTALLATION_LOCATION/start_megaglest" ]
	then # The user provided an installation directory which is usable
		true
	else # The user provided an installation directory which is NOT usable
		installation_location_unusable
		exit 1
	fi
else # The user did not specify the $INSTALLATION_LOCATION environment variable
	if [ "$1"'x' != 'x' ]
	then # The user did, however, specify the installation location as a command line argument
		INSTALLATION_LOCATION=$1
		if [ -f "$INSTALLATION_LOCATION/start_megaglest" -o -h "$INSTALLATION_LOCATION/start_megaglest" ]
		then # The user provided an installation directory which is usable
			true
		else # The user provided an installation directory which is NOT usable
			installation_location_unusable
			exit 1
		fi
	else # The user did not specify the installation location at all
		if [ -f ~/megaglest/start_megaglest -o -h ~/megaglest/start_megaglest ]
		then # However, there is a usable installation at ~/megaglest/ 
			INSTALLATION_LOCATION=~/megaglest
			echo 'WARNING: Using automatically selected installation directory ~/megaglest' >&2
			echo '         This is usually what you want. To manually specify it, see --help.' >&2
			echo '' >&2
		else # Failed to guess the installation location, so give up.
			echo 'ERROR: Unable to determine MegaGlest installation location.' >&2
			echo '' >&2
			echo 'Please specify the directory you installed to (which must contain the' >&2
			echo 'start_megaglest script) as first parameter to this script, e.g.:' >&2
			echo '  '"$MYNAME"' /home/paulo/MegaGlest-3' >&2
			echo '' >&2
			echo 'You may try to use the following commands to locate the script:' >&2
			echo '  locate -b '"'"'\start_megaglest'"'" >&2
			echo '  find -type f -name start_megaglest ~/' >&2
			echo '  sudo find -type f -name start_megaglest /' >&2
			echo '' >&2
			echo 'Please be aware that this script is written to work with installations' >&2
			echo 'created using the instructions on megaglest.org. It may not work with' >&2
			echo 'variants of MegaGlest which were packaged by your Linux distribution.' >&2
			echo '' >&2
			exit 1
		fi
	fi
fi


# Start gathering information, writing it to REPORT_LOCATION
cat <<'EOF'

                                                                         a.     
     __,.  ._a,,           v          ..                                =ma;    
   <wVUXSc<ZA2YS>         j[        _a2`            :.                 .]W#=;   
  ]ZgQ#Zq2Xmmmmmoc    .. jX( _ss,%_wXZ'    _a,       i                _u)W#>>   
 =ZmWXY!3Qm$Z13WQo,.adUXXS3;uASoZXXnnSauudZXSn.      +;.           _=%|IcWWmm;  
 3qQEe .nQBd` 1dQZsdSmmmqmnZqmBW#BWomwwwwwmX8I        3,        ._iii=<in3WWm'  
.S**X( .n?S2  <2TCXSUXZS1SXXXGZ"?nnXXZd8X3Ev+`        -h, s,. .=v+||1+<nmo$m#   
:n|<#;  n|ve  :z+{2|vmaaonSi)d` _nn(d1{d{c|v.          ]kdmms=>Iv=|lnwZ!`  ?[   
.1+<X;  3|ve  :2|ve|voonvnS>Ie<dX13ak>{SXs=n.           4WP4k;<<vsuw2!`         
 vaaX; .nsvo  )c<oc|3m#ZmI2><XSd#c|1e|iaao|v.          _)Qswpc=vomY^            
 {dWp(  nmp2  dqm21q2o="vn2vudXZ!{ivv%3mXo>v:       ._|||3mBmo%Z"`              
 =v$SowwommXwwSmX()3Q2oaZm3zWmoouGmEvQv~)Sm{>     .=||||=)Qr]Ze                 
.X2SomqqmQWmgwmXX( {dQmqmUn+3WQgqmBmnAouXdWon` ._||||++=+imom#'                 
 )u####ZZZZZZ###X( -{X##Zsn;~3Z##XXXoZdGZ###p_=|||++++<vnn$mWe                  
  X?"^- .    -~"Y'   -~~ {v>  -""YXm#mZ3d!"|||||=+|+<unv" )#.                   
                         :n(       -"{Sd'=||i|==+|sun}^   -m:                   
                          {z        _#Z|ii|====iao1o(      X;                   
                          =o       .jZ||>==+<vu21oZP       ];    _;<i,_______us,
                           v.    _=v#(+=<adS2nouZSd`       )(   _2 3vn22121211v;
                           +; ._|iid+==wX1Isi%|lno'  ._    .(  .d( 3viillIlll|i`
                            |=|ii|||=<dnlvXZZZc|nSisuS(    _i,_d1=_XzSSXX1|IXo%.
                         ._|iii|=+|iumSmZX!~^!1%onvnun`  _dS111nIdY111124v|v]qo.
                       .=iii|==+|voX*Zmm1e    2{XZd#ve  _UqwZmgpvnZXXwoi]nwi:~~ 
                    ._|iii|++|iuS2"`:XUDv`  _i2{+33E|  .ZqSoX1XCvBsoXX1>]nmv.   
                  _=iii||+|<voS*~   )ei|v.<dS11vaoIl%  ]21vosvXlvSlvvon=]nXl.   
                _|ili||||iuS2!`     :1||{dSwXS%|iXi|c  ]1+|Iliiina|||iIn]1|v.   
             .=illi||||soSe^        .v||)odS??1||vi|i .di|3XX#Si3dGoa%|{]o|{.   
           .=ili||||vuX2!-          _wc|ine. :o%|vs|s_j2%|)e""X|vv*YSX|<voi{:   
         _<vIl|||ivoXe^           _wmX{oqo2nuZSoudvsISnvn%iIss2%n%n=aCcino|{=   
       _|iI||||iaoX}~           .aZ!` -XXWmwwwmUoXdmmmm1nXmqonqevqonnwooZnou1.  
     .||ii|||vuSe"`            :>~     -?X#ZZZX2{o#XXXXv;?X#UAX1vXZUXS2!oXXXv.  
    =l||||<uoX}~                         -""""- :Y""~]Xq; -"!!^nv>!!?"`-Y""!!   
   =l||iaoX2"`                                                 )o;              
 .=iiau2*"`                                                    :2=              
 =+|""--                                                        v>              
                                                                <(              
                                                                 s              
                                                                 <.             
                       -  S Y S T E M   R E P O R T -            -;             
                                                                  :             
EOF
echo '                                   v'"$VERSION"''
echo ''
echo '________________________________________________________________________________'
echo ''
echo '            Collecting information on this computer and MegaGlest.'
echo ''
echo '                              Please stand by...'
echo '________________________________________________________________________________'
echo ''
echo ''
echo '--------------------------------------------------------------------------------' >> $REPORT_LOCATION
echo '                       MEGAGLEST SYSTEM REPORT '"$VERSION" >> $REPORT_LOCATION
echo '                      '"`date -Ru`" >> $REPORT_LOCATION
echo '--------------------------------------------------------------------------------' >> $REPORT_LOCATION

echo ' →  Operating system'
echo '' >> $REPORT_LOCATION
echo '' >> $REPORT_LOCATION
echo '***** Operating system *********************************************************' >> $REPORT_LOCATION
echo '' >> $REPORT_LOCATION
if [ `which lsb_release`'x' = 'x' ]
then # no lsb_release in path
	lsb=0
	release='unknown release'
	if [ -e "/etc/os-release" ]; then
		distribution="$(cat "/etc/os-release" | grep '^ID=' | awk -F '=' '{print $2}' \
			    | awk '{print toupper(substr($0,1,1))substr($0,2)}')"
		codename="$(cat "/etc/os-release" | grep '^PRETTY_NAME=' | awk -F '"' '{print $2}')"
	elif [ -e /etc/debian_version ]; then distribution='Debian'; codename="$(cat /etc/debian_version)"
	elif [ -e /etc/SuSE-release ]; then distribution='SuSE'; codename="$(cat /etc/SuSE-release)"
	elif [ -e /etc/redhat-release ]; then
		if [ -e /etc/fedora-release ]; then distribution='Fedora'; codename="$(cat /etc/fedora-release)"
		else distribution='Redhat'; codename="$(cat /etc/redhat-release)"; fi
	elif [ -e /etc/fedora-release ]; then distribution='Fedora'; codename="$(cat /etc/fedora-release)"
	elif [ -e /etc/mandrake-release ]; then distribution='Mandrake'; codename="$(cat /etc/mandrake-release)"
	else distribution='unknown distribution'; codename='unknown codename'; fi
else
	lsb=1
	distribution=`lsb_release -i | awk -F':' '{ gsub(/^[ \t]*/,"",$2); print $2 }'`
	release=`lsb_release -r | awk -F':' '{ gsub(/^[  \t]*/,"",$2); print $2 }'`
	codename=`lsb_release -c | awk -F':' '{ gsub(/^[ \t]*/,"",$2); print $2 }'`
fi
architecture=`uname -m`
echo '* Distribution: '"$distribution" >> $REPORT_LOCATION
echo '* Release:      '"$release" >> $REPORT_LOCATION
echo '* Codename:     '"$codename" >> $REPORT_LOCATION
echo '* Architecture: '"$architecture" >> $REPORT_LOCATION
echo '* LSB support:  '"$lsb" >> $REPORT_LOCATION
echo '' >> $REPORT_LOCATION

echo '>>> uname -a' >> $REPORT_LOCATION
uname -a >> $REPORT_LOCATION 2>&1
sleep 1
echo '' >> $REPORT_LOCATION

echo '>>> cat /etc/issue' >> $REPORT_LOCATION
cat /etc/issue >> $REPORT_LOCATION 2>&1
sleep 1

echo ' →  MegaGlest version'
echo '' >> $REPORT_LOCATION
echo '' >> $REPORT_LOCATION
echo '***** MegaGlest version ********************************************************' >> $REPORT_LOCATION
echo '' >> $REPORT_LOCATION

if [ "$ERROR_RUNNING_MEGAGLEST"'x' = '0x' -o  "$ERROR_RUNNING_MEGAGLEST"'x' = 'x' ]
then # Only run this if MegaGlest didn't already fail last time it was run
	echo '    (I will now try to run MegaGlest, but it should quit automatically.)'
	echo '' >> $REPORT_LOCATION
	echo '>>> ./start_megaglest --use-language=en --version' >> $REPORT_LOCATION
	$INSTALLATION_LOCATION/start_megaglest --use-language=en --version >> $REPORT_LOCATION 2>&1
	if [ "$?"'x' = '0x' ]
	then # all cool
		ERROR_RUNNING_MEGAGLEST=0
	else # an error occurred
		ERROR_RUNNING_MEGAGLEST=1
	fi
	sleep 1
else
	echo 'WARNING: A previous run of MegaGlest failed. Skipping test.' >&2
	echo '>>> SKIPPED: ./start_megaglest --use-language=en --version' >> $REPORT_LOCATION
fi

echo ' →  CPU'
echo '' >> $REPORT_LOCATION
echo '' >> $REPORT_LOCATION
echo '***** CPU **********************************************************************' >> $REPORT_LOCATION
echo '' >> $REPORT_LOCATION
echo '>>> cat /proc/cpuinfo' >> $REPORT_LOCATION
cat /proc/cpuinfo >> $REPORT_LOCATION
sleep 1

echo ' →  Memory'
echo '' >> $REPORT_LOCATION
echo '' >> $REPORT_LOCATION
echo '***** Memory *******************************************************************' >> $REPORT_LOCATION
echo '' >> $REPORT_LOCATION
echo '>>> free -mt' >> $REPORT_LOCATION
free -mt >> $REPORT_LOCATION
sleep 1

echo ' →  MegaGlest configuration'
echo '' >> $REPORT_LOCATION
echo '' >> $REPORT_LOCATION
echo '***** MegaGlest configuration **************************************************' >> $REPORT_LOCATION
echo '' >> $REPORT_LOCATION

# Currently commented out due to http://glest.org/glest_board/?topic=8482
#if [ "$ERROR_RUNNING_MEGAGLEST"'x' = '0x' -o  "$ERROR_RUNNING_MEGAGLEST"'x' = 'x' ]
#then # Only run this if MegaGlest didn't already fail last time it was run
	echo '    (I will now try to run MegaGlest, but it should quit automatically.)'
	echo '' >> $REPORT_LOCATION
	echo '>>> ./start_megaglest --use-language=en --show-ini-settings' >> $REPORT_LOCATION
	$INSTALLATION_LOCATION/start_megaglest --use-language=en --show-ini-settings >> $REPORT_LOCATION 2>&1
	if [ "$?"'x' = '0x' ]
	then # all cool
		ERROR_RUNNING_MEGAGLEST=0
	else # an error occurred
		ERROR_RUNNING_MEGAGLEST=1
	fi
	sleep 1
#else
#	echo 'WARNING: A previous run of MegaGlest failed. Skipping test.' >&2
#	echo '>>> SKIPPED: ./start_megaglest --use-language=en --show-ini-settings' >> $REPORT_LOCATION
#fi

echo ' →  Graphics'
echo '' >> $REPORT_LOCATION
echo '' >> $REPORT_LOCATION
echo '***** Graphics *****************************************************************' >> $REPORT_LOCATION
echo '' >> $REPORT_LOCATION

if [ "`which lspci`"'x' = 'x' ]
then # not available in search path
	echo 'WARNING: "lspci" utility is not available.' >&2
	echo '         Consider installing it to provide more useful information on your system.' >&2
	echo '' >&2
	echo '>>> SKIPPED: lspci -knnv | grep -EA12 '"'"'(VGA|Display)'"'" >> $REPORT_LOCATION
else # it's available
	echo ">>> lspci -knnv | grep -EA12 '(VGA|Display)'" >> $REPORT_LOCATION
	lspci -knnv | grep -EA12 '(VGA|Display)' >> $REPORT_LOCATION 2>&1
fi
sleep 1
echo '' >> $REPORT_LOCATION

if [ "`which xrandr`"'x' = 'x' ]
then # not available in search path
	echo 'WARNING: "xrandr" utility is not available.' >&2
	echo '         Consider installing it to provide more useful information on your system.' >&2
	echo '' >&2
	echo '>>> SKIPPED: xrandr' >> $REPORT_LOCATION
else # it's available
	echo ">>> xrandr" >> $REPORT_LOCATION
	xrandr >> $REPORT_LOCATION 2>&1
fi
sleep 1
echo '' >> $REPORT_LOCATION

# Currently commented out due to http://glest.org/glest_board/?topic=8482
#if [ "$ERROR_RUNNING_MEGAGLEST"'x' = '0x' -o  "$ERROR_RUNNING_MEGAGLEST"'x' = 'x' ]
#then # Only run this if MegaGlest didn't already fail last time it was run
	echo '    (I will now try to run MegaGlest, but it should quit automatically.)'
	echo '' >> $REPORT_LOCATION
	echo '>>> ./start_megaglest --use-language=en --opengl-info' >> $REPORT_LOCATION
	$INSTALLATION_LOCATION/start_megaglest --use-language=en --opengl-info >> $REPORT_LOCATION 2>&1
	if [ "$?"'x' = '0x' ]
	then # all cool
		ERROR_RUNNING_MEGAGLEST=0
	else # an error occurred
		ERROR_RUNNING_MEGAGLEST=1
	fi
	sleep 1
#else
#	echo 'WARNING: A previous run of MegaGlest failed. Skipping test.' >&2
#	echo '>>> SKIPPED: ./start_megaglest --use-language=en --opengl-info' >> $REPORT_LOCATION
#fi	

if [ "`which glxinfo`"'x' = 'x' ]
then # not available in search path
	echo 'WARNING: "glxinfo" utility is not available.' >&2
	echo '         Consider installing it to provide more useful information on your system.' >&2
	echo '' >&2
	echo '>>> SKIPPED: glxinfo | grep -E '"'"'^(name|display|server|client|GLX|OpenGL)'"'" >> $REPORT_LOCATION
else
	echo ">>> glxinfo | grep -E '^(name|display|server|client|GLX|OpenGL)'" >> $REPORT_LOCATION
	glxinfo | grep -E '^(name|display|server|client|GLX|OpenGL)' >> $REPORT_LOCATION 2>&1
fi
sleep 1
echo '' >> $REPORT_LOCATION

echo '' >> $REPORT_LOCATION
echo '--------------------------------------------------------------------------------' >> $REPORT_LOCATION
echo '' >> $REPORT_LOCATION
echo '' >> $REPORT_LOCATION
echo '' >> $REPORT_LOCATION

echo ''
echo ' Processing complete.'
echo '________________________________________________________________________________'
sleep 1
echo ''
echo ' Please find your report in this file:'
echo '   '"$REPORT_LOCATION"
echo ''
echo ' Please post this report to a pastebin such as (one of)'
echo '   http://paste.megaglest.org'
echo '   http://pastebin.com'
echo ''
echo ' After posting it there you will be taken to a new Internet address. Please'
echo ' take note of this new location/URL/Internet address and make it available to'
echo ' the MegaGlest developers. Unless you were instructed to do otherwise, please'
echo ' post both the Internet address of where you uploaded to and a verbose'
echo ' description of the issues you are experiencing at'
echo '   http://forums.megaglest.org'
echo ''
echo ' Thank you for making it easy for us to assist you,'
echo ''
echo '   -- The MegaGlest development team'

if [ "$PAUSE"'x' = '1x' -o "$PAUSE"'x' = 'truex' ]
then
	echo '________________________________________________________________________________'
	echo ''
	echo '           Please read all of the above, then press return to exit.'
	read input >/dev/null
fi