From 923d2942c237721802f36dd0a0822cda7fe02237 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sat, 14 Nov 2020 00:44:18 +0100 Subject: [PATCH] py scripts --- client/Makefile | 1 + .../02b_run_test_py.sh | 6 +----- .../02b_run_test_py_grabber.sh | 6 +----- pm3 | 13 ++++++++++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/client/Makefile b/client/Makefile index 8012a71f5..a71c09c32 100644 --- a/client/Makefile +++ b/client/Makefile @@ -684,6 +684,7 @@ endif ifneq (,$(INSTALLSHARE)) $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLSHARERELPATH) $(Q)$(CP) $(INSTALLSHARE) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLSHARERELPATH) + $(Q)$(CP) src/pm3.py $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLSHARERELPATH)/pyscripts endif @true diff --git a/client/experimental_client_with_swig/02b_run_test_py.sh b/client/experimental_client_with_swig/02b_run_test_py.sh index a962c7b22..e613a6adf 100755 --- a/client/experimental_client_with_swig/02b_run_test_py.sh +++ b/client/experimental_client_with_swig/02b_run_test_py.sh @@ -1,7 +1,3 @@ #!/bin/bash -#/usr/local/lib/python3/dist-packages/pm3.py -#/usr/lib/python3/dist-packages/pm3.py - -# need access to pm3.py -PYTHONPATH=../src ../../pm3 -c "script run testembedded.py" +../../pm3 -c "script run testembedded.py" diff --git a/client/experimental_client_with_swig/02b_run_test_py_grabber.sh b/client/experimental_client_with_swig/02b_run_test_py_grabber.sh index 06dc31717..8aed5b8bb 100755 --- a/client/experimental_client_with_swig/02b_run_test_py_grabber.sh +++ b/client/experimental_client_with_swig/02b_run_test_py_grabber.sh @@ -1,7 +1,3 @@ #!/bin/bash -#/usr/local/lib/python3/dist-packages/pm3.py -#/usr/lib/python3/dist-packages/pm3.py - -# need access to pm3.py -PYTHONPATH=../src ../../pm3 -c "script run testembedded_grab.py" -i +../../pm3 -c "script run testembedded_grab.py" -i diff --git a/pm3 b/pm3 index b6ebbc52e..27e992b11 100755 --- a/pm3 +++ b/pm3 @@ -11,6 +11,7 @@ FINDBTRFCOMM=true FINDBTDIRECT=true PM3PATH=$(dirname "$0") +EVALENV="" FULLIMAGE="fullimage.elf" BOOTIMAGE="bootrom.elf" # try pm3 dirs in current repo workdir @@ -23,17 +24,23 @@ if [ -d "$PM3PATH/client/" ]; then echo >&2 "[!!] In devel workdir but no executable found, did you compile it?" exit 1 fi + # Devel mode: point to workdir pm3.py module + EVALENV+=" PYTHONPATH=$PM3PATH/client/src" # try install dir elif [ -x "$PM3PATH/proxmark3" ]; then CLIENT="$PM3PATH/proxmark3" + EVALENV+=" PYTHONPATH=$PM3PATH/../share/proxmark3/pyscripts/" + # or /usr/[local/]lib/python3/dist-packages/pm3.py ? else -# hope it's installed somehow, still not sure where fw images are... +# hope it's installed somehow, still not sure where fw images and pm3.py are... CLIENT="proxmark3" fi -EVALENV="" # LeakSanitizer suppressions if [ -e .lsan_suppressions ]; then - EVALENV="export LSAN_OPTIONS=suppressions=.lsan_suppressions" + EVALENV+=" LSAN_OPTIONS=suppressions=.lsan_suppressions" +fi +if [ "$EVALENV" != "" ]; then + EVALENV="export $EVALENV" fi PM3LIST=() SHOWLIST=false