From c73ad5b4dab9be0daa6badd1a990ff9786f5c9ab Mon Sep 17 00:00:00 2001 From: 57ca2b96b7444cb986b2d6cf51d25ffd86c57743 Date: Mon, 23 Oct 2017 18:15:02 -0400 Subject: [PATCH 1/2] Some basic BASH scripts to help update the proxmark firmware and to start the application. Both scripts perform simple checks to autodetect the proxmark device. --- proxmark3.sh | 12 ++++++++++++ update.sh | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100755 proxmark3.sh create mode 100755 update.sh diff --git a/proxmark3.sh b/proxmark3.sh new file mode 100755 index 000000000..6f648cabf --- /dev/null +++ b/proxmark3.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +function wait4proxmark { + echo "Waiting for Proxmark to appear..." + while [ ! -e /dev/ttyACM? ]; do + sleep .1 + done +} + +# start proxmark with first detected interface +wait4promark +client/proxmark3 /dev/ttyACM? diff --git a/update.sh b/update.sh new file mode 100755 index 000000000..3ffd43e80 --- /dev/null +++ b/update.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +function wait4proxmark { + echo "Waiting for Proxmark to appear..." + while [ ! -e /dev/ttyACM? ]; do + sleep .1 + done +} + +# flash bootroom +wait4proxmark +client/flasher /dev/ttyACM? -b bootrom/obj/bootrom.elf + +# flash system image +wait4proxmark +client/flasher /dev/ttyACM? armsrc/obj/fullimage.elf From 15aa741bdc5043dcf5bfbe6a73055478e8bf6bc5 Mon Sep 17 00:00:00 2001 From: 57ca2b96b7444cb986b2d6cf51d25ffd86c57743 Date: Mon, 23 Oct 2017 19:25:58 -0400 Subject: [PATCH 2/2] Enhanced BASH scripts to detect either pm3-x or ttyACMx style devices. --- proxmark3.sh | 10 ++++++---- update.sh | 13 +++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/proxmark3.sh b/proxmark3.sh index 6f648cabf..44c5c7e2c 100755 --- a/proxmark3.sh +++ b/proxmark3.sh @@ -1,12 +1,14 @@ #!/bin/bash function wait4proxmark { - echo "Waiting for Proxmark to appear..." - while [ ! -e /dev/ttyACM? ]; do + echo >&2 "Waiting for Proxmark to appear..." + while [ ! -c /dev/ttyACM? -a ! -L /dev/pm3-? ]; do sleep .1 done + local PM3=`ls -1 /dev/pm3-? /dev/ttyACM? 2>/dev/null | head -1` + echo >&2 -e "Found proxmark on ${PM3}\n" + echo $PM3 } # start proxmark with first detected interface -wait4promark -client/proxmark3 /dev/ttyACM? +client/proxmark3 $(wait4proxmark) diff --git a/update.sh b/update.sh index 3ffd43e80..b62d39417 100755 --- a/update.sh +++ b/update.sh @@ -1,16 +1,17 @@ #!/bin/bash function wait4proxmark { - echo "Waiting for Proxmark to appear..." - while [ ! -e /dev/ttyACM? ]; do + echo >&2 "Waiting for Proxmark to appear..." + while [ ! -c /dev/ttyACM? -a ! -L /dev/pm3-? ]; do sleep .1 done + local PM3=`ls -1 /dev/pm3-? /dev/ttyACM? 2>/dev/null | head -1` + echo >&2 -e "Found proxmark on ${PM3}\n" + echo $PM3 } # flash bootroom -wait4proxmark -client/flasher /dev/ttyACM? -b bootrom/obj/bootrom.elf +client/flasher $(wait4proxmark) -b bootrom/obj/bootrom.elf # flash system image -wait4proxmark -client/flasher /dev/ttyACM? armsrc/obj/fullimage.elf +client/flasher $(wait4proxmark) armsrc/obj/fullimage.elf