From 6d1beb07c186ebdd14dea5ce8a133543527c8978 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Mon, 18 May 2020 01:16:29 +0200 Subject: [PATCH] pm3: attempt to detect BT dongle when udevadm is not available --- pm3 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/pm3 b/pm3 index 7d2c5e5f7..31ed0695b 100755 --- a/pm3 +++ b/pm3 @@ -54,10 +54,19 @@ function get_pm3_list_Linux { if $FINDBTDONGLE; then # check if the HC-06-USB white dongle is present (still, that doesn't tell us if it's paired with a Proxmark3...) for DEV in $(find /dev/ttyUSB* 2>/dev/null); do - if udevadm info -q property -n "$DEV" | grep -q "ID_MODEL=CP2104_USB_to_UART_Bridge_Controller"; then - PM3LIST+=("$DEV") - if [ ${#PM3LIST[*]} -ge "$N" ]; then - return + if which udevadm >/dev/null; then + if udevadm info -q property -n "$DEV" | grep -q "ID_MODEL=CP2104_USB_to_UART_Bridge_Controller"; then + PM3LIST+=("$DEV") + if [ ${#PM3LIST[*]} -ge "$N" ]; then + return + fi + fi + else + if grep -q "DRIVER=cp210x" "/sys/class/tty/${DEV#/dev/}/../../uevent" 2>/dev/null; then + PM3LIST+=("$DEV") + if [ ${#PM3LIST[*]} -ge "$N" ]; then + return + fi fi fi done