X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=grml-hwinfo;h=158e75074ffd2be83f97c1873ebb15d368f4ef0c;hb=8acdf3ae629dfb71920b933ab2e2e632a50398a5;hp=8f428aa3ef4bea6f2fc2055ba58ec478c7c359c3;hpb=685c3ecaf595dc780d941507162516d7f9fc94b7;p=grml-hwinfo.git diff --git a/grml-hwinfo b/grml-hwinfo index 8f428aa..158e750 100755 --- a/grml-hwinfo +++ b/grml-hwinfo @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Mon Jun 11 12:05:32 CEST 2007 [mika] +# Latest change: Mon Aug 27 18:32:27 CEST 2007 [mika] ################################################################################ # Notice: Some ideas have been taken from # http://club.black.co.at/david/hwdb/infodump @@ -12,16 +12,16 @@ ################################################################################ # variables -UNAME=$(uname -r) -PN=$(basename $0) +UNAME="$(uname -r)" +PN="$(basename $0)" VERSION='0.3' -if [ -z "$INFOFILE" ]; then - INFOFILE='info.tar.bz2' -fi + +[ -n "$INFOFILE" ] || INFOFILE='info.tar.bz2' + if [ "$(id -u)" != 0 ] ; then NOTROOT=1 - echo "Notice: you are running $PN without root permissions! Not all information could be collected!" + echo "Notice: you are running $PN without root permissions. Not all information will be collected." echo fi @@ -94,7 +94,7 @@ mkdir info || exit -1 [ -r /proc/bus/pnp ] && lspnp > lspnp [ -r /proc/bus/usb ] && lsusb > lsusb cat /proc/partitions > partitions - [ -r /proc/ide/ide?/hd?/geometry ] && grep . /proc/ide/ide?/hd?/geometry /dev/null | sed -e 's#/proc/ide/ide./##' > proc_ide + find /proc/ide/ -name geometry -exec grep . {} \; > proc_ide 2>/dev/null df -h > df 2>/dev/null for i in free lsmod mount lsdev ; do exectest $i && $i > $i @@ -114,6 +114,7 @@ mkdir info || exit -1 # hwinfo exectest discover && discover -v --type-summary --enable-bus all > discover 2> discover.2 exectest hwinfo && hwinfo log=hwinfo + exectest x86info && x86info > x86info 2>x86info.2 # net stuff exectest ifconfig && ifconfig -v -a > ifconfig @@ -130,9 +131,9 @@ mkdir info || exit -1 # powermanagement exectest laptop-detect && laptop-detect 1>/dev/null 2>/dev/null && echo "0" > laptop_detected - exectest acpi_available && acpi_available && cat /proc/acpi/info > acpi_info - exectest acpi && acpi > acpi 2> acpi.error && acpi -v > acpi.version - [ -r /proc/apm/ ] && apm > acpi + exectest acpi_available && acpi_available && cat /proc/acpi/info > acpi_info + exectest acpi && acpi > acpi 2> acpi.error && acpi -v > acpi.version + [ -r /proc/apm/ ] && apm > apm # kernel stuff if [ -r /proc/config.gz ] ; then @@ -170,6 +171,13 @@ else exectest sfdisk && sfdisk -d > sfdisk 2>sfdisk.error exectest ddcprobe && ddcprobe > ddcprobe exectest dmidecode && dmidecode > dmidecode + + exectest dconf && dconf -o dconf + + if [ -x /usr/share/doc/lm-sensors/examples/eeprom/decode-dimms.pl ] ; then + /usr/share/doc/lm-sensors/examples/eeprom/decode-dimms.pl > decode-dimms 2>decode-dimms.error + fi + for disk in $disklist; do exectest smartctl && smartctl -i /dev/$disk >> smartctl exectest hdparm && hdparm -iv /dev/$disk >> hdparm @@ -181,7 +189,16 @@ fi ) # finally create the tarball -tar jcf $INFOFILE info/ && rm -Rf info/ +if [ -f "$INFOFILE" ] ; then + DATE="$(date +%Y%m%d_%H%M%S)" + NEW_INFOFILE="info_$DATE.tar.bz2" + echo + echo "Warning: $INFOFILE exists already, using $NEW_INFOFILE instead.">&2 + tar jcf $NEW_INFOFILE info/ && rm -Rf info/ + INFOFILE="$NEW_INFOFILE" # adjust variable for final info message +else + tar jcf $INFOFILE info/ && rm -Rf info/ +fi echo [ -r "$INFOFILE" ] && echo "$INFOFILE ($(ls -ahl $INFOFILE | awk '{print $5}')) has been generated."