-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
ambianic-debug.sh
executable file
·43 lines (34 loc) · 799 Bytes
/
ambianic-debug.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
set -ex
MY_PATH=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/$(basename "${BASH_SOURCE[0]}")
MY_DIR=$(dirname "${MY_PATH}")
# test if coral usb stick is available
USB_DIR=/dev/bus/usb
VIDEO_0=/dev/video0
if [ -d "$USB_DIR" ]; then
USB_ARG="--device $USB_DIR"
else
USB_ARG=""
fi
VC_SHARED_LIB=""
if grep -s -q "Raspberry Pi" /proc/cpuinfo;
then
VC_SHARED_LIB="-v /opt/vc:/opt/vc"
fi
if [ -e "$VIDEO_0" ]; then
VIDEO_ARG="--device $VIDEO_0"
else
VIDEO_ARG=""
fi
# check if there is an image update
docker pull ambianic/ambianic-edge:dev
# run dev image
docker run -it --rm \
--name ambianic-edge-dev \
--mount type=bind,source="$MY_DIR",target=/workspace \
$VC_SHARED_LIB \
--privileged \
--net=host \
$VIDEO_ARG \
$USB_ARG \
ambianic/ambianic-edge:dev