Nicholas Chin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/85796?usp=email )
Change subject: util/findusb_debug: Check for lsusb and lspci ......................................................................
util/findusb_debug: Check for lsusb and lspci
Add a check to make sure lsusb and lspci are installed, as the script relies on them to function properly. Previously, if lsusb was not installed, the script proceeded as if nothing was wrong, but never found any devices plugged into the debug port. If lspci was not found, the script exited saying that no EHCI debug capable controller was found. The "command not found" messages that normally would have been shown in these situations was not being shown, as stderr is redirected to /dev/null to hide error messages that don't matter as per the comment near the top of the script.
Change-Id: Ib56a20aab9552aa6321c2fb9ad0d2ca7d6cd00c7 Signed-off-by: Nicholas Chin nic.c3.14@gmail.com --- M util/find_usbdebug/find_usbdebug.sh 1 file changed, 13 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/96/85796/1
diff --git a/util/find_usbdebug/find_usbdebug.sh b/util/find_usbdebug/find_usbdebug.sh index de370b1..cd269ab 100755 --- a/util/find_usbdebug/find_usbdebug.sh +++ b/util/find_usbdebug/find_usbdebug.sh @@ -27,6 +27,19 @@ echo "Must be run as root. Exiting." exit 1 fi + +if ! command -v lsusb; then + echo "lsusb not found. Please install "usbutils" from your +Distribution's package manager. Exiting." + exit 1 +fi + +if ! command -v lspci; then + echo "lspci not found. Please install "pciutils" from your +Distribution's package manager. Exiting." + exit 1 +fi + dmesgfile=$1
find_devs_in_tree () {