Elyes Haouas has submitted this change. ( https://review.coreboot.org/c/coreboot/+/85796?usp=email )
Change subject: util/find_usbdebug: Check for lsusb and lspci ......................................................................
util/find_usbdebug: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/85796 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Riku Viitanen riku.viitanen@protonmail.com Reviewed-by: Elyes Haouas ehaouas@noos.fr Reviewed-by: Felix Singer service+coreboot-gerrit@felixsinger.de --- M util/find_usbdebug/find_usbdebug.sh 1 file changed, 13 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Felix Singer: Looks good to me, approved Elyes Haouas: Looks good to me, approved Riku Viitanen: Looks good to me, approved
diff --git a/util/find_usbdebug/find_usbdebug.sh b/util/find_usbdebug/find_usbdebug.sh index de370b1..7c893c9 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 () {