#!/bin/bash # Copyright 2007, 2008 Robert ("Bob") Igo of StormLogic, LLC and mythic.tv. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # This script will grab USB and PCI data and dump it to a file for the # user to post. output_file=/tmp/fingerprint.txt maintainer="Human" thread="" Usage() { echo "USAGE:" echo `basename $0` " [-a]" echo "-a: advanced mode" echo echo "EXAMPLE: $0" exit 3 } while getopts "a" FLAG ; do case "$FLAG" in a) ADVANCED_MODE=1;; *) Usage;; esac done check_for_root() { if [ `whoami` != "root" ]; then echo -n `basename $0` echo " must be run as root. Exiting."; exit; fi } poll_PCI() { echo \ "##### # lspci -vv #####" >> $output_file lspci -vv >> $output_file echo "" >> $output_file echo \ "##### # lspci -mn #####" >> $output_file lspci -mn >> $output_file echo "" >> $output_file } poll_USB() { echo \ "##### # /proc/bus/usb/devices #####" >> $output_file cat /proc/bus/usb/devices >> $output_file } instruct() { echo "Your hardware fingerprint is in $output_file" echo -n "Please PM it to $maintainer" if [ "$thread" != "" ]; then echo " or post it to" echo -n "$thread" fi echo "." echo "It should be accompanied by a list of changes that you made to the baseline installation in order to improve MythTV on your hardware." echo "If you feel up to the task, feel free to prune out any entries that are for very low-level devices like memory controllers, USB subsystems, etc. before sending the fingerprint." } main() { check_for_root > $output_file poll_PCI poll_USB instruct } main