-
Notifications
You must be signed in to change notification settings - Fork 28
/
exec.pre
67 lines (65 loc) · 2.66 KB
/
exec.pre
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
#!/bin/bash
# exec.pre
# KD4Z
# Version: 3.15
# Runs after git pulls and before build is started
# working directory is ~/md380tools-vm
# copy existing build as default snapshot and rotate 2-9
# .previous will be #1 for backward compat
if [ -f ~/user.bin ]; then
cp ~/user.bin ~/archive/user.bin
fi
if [ -f ~/firmware-GPS.bin ]; then
cp ~/firmware-GPS.bin ~/archive/firmware-GPS.bin
fi
if [ -f ~/firmware-noGPS.bin ]; then
cp ~/firmware-noGPS.bin ~/archive/firmware-noGPS.bin
fi
if [ -f ~/firmware-GPS.bin ]; then
cp ~/firmware-OLD.bin ~/archive/firmware-OLD.bin
fi
if [ ! -f ~/md380tools-vm/glv.mike ] || [ ! -f ~/md380tools-vm/glv.wolf ] ; then
if [ ! -f ~/advanced.disable ]; then
if [ -f ~/md380tools-vm/root/displayEnhanced.c ]; then
cp ~/md380tools-vm/root/displayEnhanced.c ~/md380tools/applet/src/display.c
fi
else
cp ~/md380tools-vm/root/display.c ~/md380tools/applet/src
fi
fi
if [ -f ./rotatebins ]; then
./rotatebins
fi
sed -i -e 's/--dirty //g' ~/md380tools/applet/Makefile
sed -i -e 's/-s /-k -s /g' ~/md380tools/curl.mak
# not needed as "booooo" tone removed upstream in PR #830
#if [ -f ~/beep.disable ]; then
# sed -i -e 's/bp_beep(3)/bp_beep(3);break;case 15:return 0/g' ~/md380tools/applet/src/beep.c
#fi
sed -i -e 's/# Add ID/\nfile.close()\nsys.exit(0)\n# Add ID/g' ~/md380tools/db/get_special_IDs.py
sed -i -e 's/getattr(device, "manufacturer")/#/g' ~/md380tools/md380_tool.py
if [ -f ~/volumebar.enable ]; then
sed -i -e 's/patcher.nopout((0x0801FED2/# patcher.nopout((0x0801FED2/g' ~/md380tools/patches/d13.020/patch.py
# need correct address for the md-390 as this isn't really needed until corrected
sed -i -e 's/patcher.nopout((0x0801FED2/# patcher.nopout((0x0801FED2/g' ~/md380tools/patches/s13.020/patch.py
fi
sed -i -e 's/#if(1)/#if(0)/g' ~/md380tools/applet/src/irq_handlers.c
if [ -f ~/pttlastheard.disable ]; then
sed -i -e 's:#define __PTT_LASTHEARD:#undef __PTT_LASTHEARD:g' ~/md380tools/applet/src/display.c
fi
if [ -f ~/pttcountup.enable ]; then
sed -i -e 's:#define __PTT_LASTHEARD_DOWN:#undef __PTT_LASTHEARD_DOWN:g' ~/md380tools/applet/src/display.c
fi
if [ -f ~/legacyrxscreen.enable ]; then
sed -i -e 's:#define __RX_SCREEN_OPTION:#undef __RX_SCREEN_OPTION:g' ~/md380tools/applet/src/display.c
fi
if [ -f ~/blackfontrxscreen.enable ]; then
sed -i -e 's:#define __RX_SCREEN_OPTION_WHITE:#undef __RX_SCREEN_OPTION_WHITE:g' ~/md380tools/applet/src/display.c
fi
sed -i -e 's:countdown = 130:countdown = 175:g' ~/md380tools/applet/src/irq_handlers.c
# local hook if desired for extra pre build processing
if [ -f ~/exec.pre.local ]; then
echo -e "${WHITE}Executing ~/exec.pre.local${NC}"
chmod +x ~/exec.pre.local
~/exec.pre.local
fi