Skip to content

Commit cbb8cdb

Browse files
committed
Clean scripts
1 parent 61485b5 commit cbb8cdb

File tree

8 files changed

+44
-12
lines changed

8 files changed

+44
-12
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# scrutiny-demos
2-
Some demonstration projects that uses scrutiny
2+
3+
A collection of demonstration project to showcase the Scrutiny Debugger framework

nsec2024/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ FetchContent_Declare(
1818
scrutiny-embedded
1919

2020
GIT_REPOSITORY https://github.com/scrutinydebugger/scrutiny-embedded.git
21-
GIT_TAG nsec_demo
21+
GIT_TAG nsec2024_demo
2222
)
2323
FetchContent_MakeAvailable(scrutiny-embedded)
2424

nsec2024/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ RUN apt-get update && apt-get install -y \
1717
&& rm -rf /var/lib/apt/lists/*
1818

1919
#RUN pip3 install scrutinydebugger
20-
RUN git clone -b nsec2024_demo https://github.com/scrutinydebugger/scrutiny-python /tmp/scrutiny-python && pip3 install -e /tmp/scrutiny-python
20+
RUN git clone --depth 1 -b nsec2024_demo https://github.com/scrutinydebugger/scrutiny-python /tmp/scrutiny-python && pip3 install -e /tmp/scrutiny-python

nsec2024/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# NorthSec 2024 Demo
2+
3+
This project is a Arduino project used to demonstrate the Scrutiny framework during the 2024 edition of NorthSec
4+
5+
6+
https://nsec.io/session/2024-scrutiny-debugger-debug-test-and-configure-embedded-softwares-through-instrumentation.html
7+
8+
9+
## Building the Arduino app
10+
11+
Calling the following script should be enough, assuming you have docker configured
12+
13+
```bash
14+
export ARDUINO_PORT=/dev/ttyACM0 # Change serial port
15+
./scripts/build_in_docker
16+
./scripts/flash
17+
```
18+
19+
## Running the server
20+
21+
```bash
22+
# pip install scrutinydebugger # For latest release
23+
# scrutiny-python repo has a tag "nsec2024_demo" that points on the version used.
24+
git clone --depth 1 -b nsec2024_demo https://github.com/scrutinydebugger/scrutiny-python /tmp/scrutiny-python && pip3 install -e /tmp/scrutiny-python
25+
scrutiny launch-server --config scrutiny_server_config.json # Make sure to adjust the serial port name in that configuration
26+
```
27+
28+

nsec2024/build.sh renamed to nsec2024/scripts/build.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22
set -euo pipefail
33

44
SCRIPT_DIR=$(realpath "$(dirname ${BASH_SOURCE[0]})")
5-
cd "$SCRIPT_DIR"
5+
ROOT_DIR=$SCRIPT_DIR/..
6+
cd "$ROOT_DIR"
67

7-
source common.sh
8+
source $SCRIPT_DIR/common.sh
89

910
[ -z ${ARDUINO_PATH:+x} ] && fatal "ARDUINO_PATH must be set"
1011

1112
info "ARDUINO_PATH=$ARDUINO_PATH"
1213
mkdir -p build
1314
cmake -G Ninja \
1415
-DARDUINO_PATH=$ARDUINO_PATH \
15-
-DCMAKE_TOOLCHAIN_FILE="$SCRIPT_DIR/cmake/toolchain/mega2526.toolchain.cmake" \
16+
-DCMAKE_TOOLCHAIN_FILE="$ROOT_DIR/cmake/toolchain/mega2526.toolchain.cmake" \
1617
-S . -B build
1718

1819
ninja -C build

nsec2024/build_in_docker.sh renamed to nsec2024/scripts/build_in_docker.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
set -euo pipefail
33

44
SCRIPT_DIR=$(realpath "$(dirname ${BASH_SOURCE[0]})")
5-
cd $SCRIPT_DIR
6-
WORKDIR=$SCRIPT_DIR # Having Workdir = script dir makes the compile_commands.json paths match the host system. Easier for vscode integration
5+
ROOT_DIR=$SCRIPT_DIR/..
6+
cd $ROOT_DIR
7+
WORKDIR=$ROOT_DIR # Having Workdir = script dir makes the compile_commands.json paths match the host system. Easier for vscode integration
78
IMAGE_NAME=scrutiny_nsec2024_demo
89
CACHE_OPT=
910
while getopts "f" o; do
@@ -15,8 +16,8 @@ done
1516

1617
docker build . -t $IMAGE_NAME $CACHE_OPT
1718
docker run \
18-
--volume $SCRIPT_DIR:$WORKDIR \
19+
--volume $ROOT_DIR:$WORKDIR \
1920
-e ARDUINO_PATH=/usr/share/arduino \
2021
-u $(id -u):$(id -g) \
2122
$IMAGE_NAME \
22-
bash -c $WORKDIR/build.sh
23+
bash -c $WORKDIR/scripts/build.sh
File renamed without changes.

nsec2024/flash.sh renamed to nsec2024/scripts/flash.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#/bin/bash
22
SCRIPT_DIR=$(realpath "$(dirname ${BASH_SOURCE[0]})")
3-
cd "$SCRIPT_DIR"
3+
ROOT_DIR=$SCRIPT_DIR/..
4+
cd "$ROOT_DIR"
45

5-
source common.sh
6+
source $SCRIPT_DIR/common.sh
67
BINNAME=scrutiny-nsec2024.hex
78
BINPATH=./build/$BINNAME
89
DEFAULT_PORT=/dev/ttyACM0

0 commit comments

Comments
 (0)