forked from egzumer/uv-k5-firmware-custom
-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathcompile-with-docker.sh
executable file
·113 lines (106 loc) · 3.22 KB
/
compile-with-docker.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/sh
#export DOCKER_DEFAULT_PLATFORM=linux/amd64
IMAGE_NAME="uvk5"
rm "${PWD}/compiled-firmware/*"
docker build -t $IMAGE_NAME .
custom() {
echo "Custom compilation..."
docker run --rm -v "${PWD}/compiled-firmware/:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "rm ./compiled-firmware/*; cd /app && make -s \
EDITION_STRING=Custom \
TARGET=f4hwn.custom \
&& cp f4hwn.custom* compiled-firmware/"
}
standard() {
echo "Standard compilation..."
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "rm ./compiled-firmware/*; cd /app && make -s \
ENABLE_SPECTRUM=0 \
ENABLE_FMRADIO=0 \
ENABLE_AIRCOPY=0 \
ENABLE_NOAA=0 \
EDITION_STRING=Standard \
TARGET=f4hwn.standard \
&& cp f4hwn.standard* compiled-firmware/"
}
bandscope() {
echo "Bandscope compilation..."
docker run --rm -v "${PWD}/compiled-firmware/:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "rm ./compiled-firmware/*; cd /app && make -s \
ENABLE_SPECTRUM=1 \
ENABLE_FMRADIO=0 \
ENABLE_AIRCOPY=1 \
ENABLE_NOAA=0 \
ENABLE_FEAT_F4HWN_RESCUE_OPS=0 \
EDITION_STRING=Bandscope \
TARGET=f4hwn.bandscope \
&& cp f4hwn.bandscope* compiled-firmware/"
}
broadcast() {
echo "Broadcast compilation..."
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "cd /app && make -s \
ENABLE_SPECTRUM=0 \
ENABLE_FMRADIO=1 \
ENABLE_AIRCOPY=1 \
ENABLE_NOAA=0 \
EDITION_STRING=Broadcast \
ENABLE_FEAT_F4HWN_RESCUE_OPS=0 \
TARGET=f4hwn.broadcast \
&& cp f4hwn.broadcast* compiled-firmware/"
}
voxless() {
echo "Voxless compilation..."
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "cd /app && make -s \
ENABLE_SPECTRUM=1 \
ENABLE_FMRADIO=1 \
ENABLE_VOX=0 \
ENABLE_AIRCOPY=0 \
ENABLE_AUDIO_BAR=0 \
ENABLE_FEAT_F4HWN_SPECTRUM=0 \
ENABLE_NOAA=0 \
ENABLE_FEAT_F4HWN_RESTORE_SCAN=0 \
ENABLE_FEAT_F4HWN_CHARGING_C=0 \
ENABLE_FEAT_F4HWN_NARROWER=0 \
ENABLE_FEAT_F4HWN_RESCUE_OPS=0 \
EDITION_STRING=Voxless \
TARGET=f4hwn.voxless \
&& cp f4hwn.voxless* compiled-firmware/"
}
rescueops() {
echo "RescueOps compilation..."
docker run --rm -v "${PWD}/compiled-firmware:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "cd /app && make -s \
ENABLE_SPECTRUM=0 \
ENABLE_FMRADIO=0 \
ENABLE_AIRCOPY=1 \
ENABLE_NOAA=1 \
ENABLE_FEAT_F4HWN_RESCUE_OPS=1 \
EDITION_STRING=RescueOps \
TARGET=f4hwn.rescueops \
&& cp f4hwn.rescueops* compiled-firmware/"
}
case "$1" in
custom)
custom
;;
standard)
standard
;;
bandscope)
bandscope
;;
broadcast)
broadcast
;;
voxless)
voxless
;;
rescueops)
rescueops
;;
all)
bandscope
broadcast
rescueops
;;
*)
echo "Usage: $0 {custom|bandscope|broadcast|voxless|standard|all}"
exit 1
;;
esac