From 0cc9b20c15460213e488bf5e70963b941482f628 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Tue, 14 Jan 2025 16:06:02 -0600 Subject: Add source. --- sdk/bin/diag | 171 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100755 sdk/bin/diag (limited to 'sdk/bin/diag') diff --git a/sdk/bin/diag b/sdk/bin/diag new file mode 100755 index 0000000..aa56844 --- /dev/null +++ b/sdk/bin/diag @@ -0,0 +1,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 + -- cgit v1.2.3-54-g00ecf