-
Notifications
You must be signed in to change notification settings - Fork 1
/
build5D3.sh
executable file
·91 lines (69 loc) · 1.48 KB
/
build5D3.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
platform=platform/5D3.
name=crop_rec_4k_mlv_snd_isogain_1x3_presets_ultrafast_fsq_
# building 5D3 code with zip
function BuildCode
{
cd ${platform}$1
# rebuild if no second argument
if [ -z "$2" ]
then
make clean
fi
make -j8 zip
# back to root folder
cd ../..
}
# build required modules
function BuildModules
{
cd modules
# rebuild if no second argument
if [ -z "$2" ]
then
make clean
fi
make
# back to root folder
cd ..
}
# copy modules and LUA scripts in zip folder
function CopyToZip
{
# copy modules to 5D3 zip folders
find . -name \*.mo -exec cp {} ${platform}$1/zip/ML/modules/ \;
# copy LUA scripts to 5D3 zip folders
cp -r scripts/ ${platform}$1/zip/ML/
}
# package zip content with modules and LUA scripts
function Package
{
# copy modules to 5D3 zip folders
CopyToZip $1
# zip file name
file=$( date '+'${name}'%Y%b%d.5D3'$1'.zip' )
# create 5D3 zip with date
cd ${platform}$1/zip/
zip -r $file .
# move zip to root folder
mv $file ../../../
# back to root folder
cd ../../..
}
# main excution
if [ -z "$1" ]
# no argument: full rebuild
then
BuildCode "113"
BuildCode "123"
BuildModules
rm *.zip
Package "113"
Package "123"
# argument: fast build
else
BuildCode $1 fast
BuildModules fast
CopyToZip $1
# use powershell outside WSL to copy zip content to SD card:
# > ./copy5D3.ps1 "E:/"
fi