forked from lakka-switch/Lakka-LibreELEC
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpkg_all.sh
executable file
·108 lines (104 loc) · 2.73 KB
/
pkg_all.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
#!/bin/bash
usage() {
echo ""
echo "$0 <build|clean> <package>"
echo ""
echo "Builds/cleans a package for all projects/devices/systems of Lakka"
echo ""
}
[ $# -lt 2 -o $# -gt 2 ] && { usage ; echo -e "Error: no or incorrect number of parameters!\n" ; exit 1 ; }
case $1 in
clean)
action=$1
script="./scripts/clean"
;;
build)
action=$1
script="./scripts/build"
;;
*)
usage
echo -e "Error: action '$1' not valid!\n"
exit 2
;;
esac
# existing targets in format PROJECT|ARCH|DEVICE|SYSTEM|BOARD|OUTPUT
targets="\
Generic|i386||||image \
Generic|x86_64||||image \
RPi|arm||||noobs \
RPi2|arm||||noobs \
Allwinner|arm||Bananapi||image \
Allwinner|arm||Cubieboard2||image \
Allwinner|arm||Cubietruck||image \
Allwinner|arm||orangepi_2||image \
Allwinner|arm||orangepi_lite||image \
Allwinner|arm||orangepi_one||image \
Allwinner|arm||orangepi_pc||image \
Allwinner|arm||orangepi_plus||image \
Allwinner|arm||orangepi_plus2e||image \
Allwinner|arm||nanopi_m1_plus||image \
imx6|arm||cuboxi||image \
imx6|arm||udoo||image \
OdroidC1|arm||||image \
Odroid_C2|arm||||image \
OdroidXU3|arm||||image \
WeTek_Core|arm||||image \
WeTek_Hub|arm||||image \
WeTek_Play|arm||||image \
WeTek_Play_2|arm||||image \
Gamegirl|arm||||image \
S8X2|arm||S82||image \
S8X2|arm||M8||image \
S8X2|arm||T8||image \
S8X2|arm||MXIII-1G||image \
S8X2|arm||MXIII-PLUS||image \
S8X2|arm||X8H-PLUS||image \
S805|arm||MXQ||image \
S805|arm||HD18Q||image \
S805|arm||M201C||image \
S805|arm||M201D||image \
S805|arm||MK808B-Plus||image \
S905|arm||||image \
S912|arm||||image \
Rockchip|arm|TinkerBoard|||image \
Rockchip|arm|RK3328||ROCK64|image \
Rockchip|arm|RK3328||ROC-RK3328-CC|image \
Rockchip|arm|MiQi|||image \
Rockchip|arm|RK3399||ROCKPro64|image \
Rockchip|arm|RK3399||ROCK960|image \
Slice|arm||||image \
Slice3|arm||||image \
"
package=$2
declare -i failed=0
failed_targets=""
skipped_targets=""
distro="Lakka"
for T in $targets ; do
IFS='|' read -r -a build <<< "$T"
project=${build[0]}
arch=${build[1]}
device=${build[2]}
system=${build[3]}
board=${build[4]}
target=${build[5]}
target_name=${board:-${device:-${project}}}.${arch}
if [ ! -d build.${distro}-${target_name}-* ] ; then
skipped_targets="${skipped_targets}${target_name}\n"
else
PROJECT=$project DEVICE=$device BOARD=$board ARCH=$arch $script $package
if [ $? -gt 0 ] ; then
failed+=1
failed_targets="${failed_targets}${target_name}\n"
fi
fi
done
[ -n "$skipped_targets" ] && { echo -e "Following targets were skipped - could not find existing build folder:\n$skipped_targets\n\n" ; }
if [ $failed -gt 0 ] ; then
echo -e "\nFailed to ${action} package '$package' on following targets:\n${failed_targets}" >&2
exit 127
else
echo "Done."
exit 0
fi