forked from Creeeeger/9820_kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_all_models.sh
More file actions
executable file
·96 lines (82 loc) · 1.93 KB
/
build_all_models.sh
File metadata and controls
executable file
·96 lines (82 loc) · 1.93 KB
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
#!/bin/bash
set -euo pipefail
usage() {
cat << EOF
Usage: $(basename "$0") [options]
Options:
-k, --ksu [y/N] Forward to build.sh
-r, --recovery [y/N] Forward to build.sh
-g, --gpu-max [value] Forward to build.sh
EOF
}
KSU_OPTION=""
RECOVERY_OPTION=""
GPU_MAX=""
while [[ $# -gt 0 ]]; do
case "$1" in
--ksu|-k)
KSU_OPTION="$2"
shift 2
;;
--recovery|-r)
RECOVERY_OPTION="$2"
shift 2
;;
--gpu-max|-g)
GPU_MAX="$2"
shift 2
;;
--help|-h)
usage
exit 0
;;
*)
usage
exit 1
;;
esac
done
pushd "$(dirname "$0")" > /dev/null
MODELS=(
beyond0lte
beyond0lteks
beyond1lte
beyond1lteks
beyond2lte
beyond2lteks
beyondx
beyondxks
d1
d1xks
d2s
d2x
d2xks
)
ARTIFACT_ROOT="build/out/all-models"
mkdir -p "$ARTIFACT_ROOT"
for model in "${MODELS[@]}"; do
echo "==============================================="
echo "Building model: $model"
echo "==============================================="
args=(--model "$model")
if [[ -n "$KSU_OPTION" ]]; then
args+=(--ksu "$KSU_OPTION")
fi
if [[ -n "$RECOVERY_OPTION" ]]; then
args+=(--recovery "$RECOVERY_OPTION")
fi
if [[ -n "$GPU_MAX" ]]; then
args+=(--gpu-max "$GPU_MAX")
fi
./build.sh "${args[@]}"
model_out_dir="build/out/$model/zip"
latest_zip="$(ls -1t "$model_out_dir"/*.zip 2>/dev/null | head -n 1 || true)"
if [[ -z "$latest_zip" ]]; then
echo "No zip artifact found for $model in $model_out_dir"
exit 1
fi
cp -f "$latest_zip" "$ARTIFACT_ROOT/$(basename "$latest_zip")"
echo "Saved artifact: $ARTIFACT_ROOT/$(basename "$latest_zip")"
done
popd > /dev/null
echo "All model builds finished. Artifacts are in $ARTIFACT_ROOT"