forked from od-contrib/commander
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package-opk.sh
executable file
·47 lines (40 loc) · 902 Bytes
/
package-opk.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
#!/usr/bin/env bash
set -euo pipefail
source ./targets.sh
usage() {
echo "Usage: package-opk.sh <target> [build dir] [output OPK path]"
usage_target
}
if ! check_target "$@"; then
usage
exit 64
fi
declare -r TARGET="${1}"
declare -r BUILD_DIR="${2:-"build-${TARGET}"}"
declare -r OUT="${3:-"$BUILD_DIR/commander-${TARGET}.opk"}"
main() {
local ext="$TARGET"
if [[ $TARGET == rg350 ]]; then
ext=gcw0
fi
local -a files=(
"opkg/default.$ext.desktop"
"opkg/readme.$ext.txt"
opkg/commander.png
res/*.png
res/*.ttf
"$BUILD_DIR/commander"
)
if [[ $TARGET == rs90 ]]; then
# rg99 uses the same binary as the rs90 but a different config
files+=(
opkg/default.rg99.desktop
opkg/commander.rg99.cfg
opkg/readme.retrofw.txt
)
fi
set -x
mksquashfs "${files[@]}" "$OUT" \
-all-root -no-xattrs -noappend -no-exports
}
main