-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_twig_release.sh
More file actions
executable file
·78 lines (58 loc) · 2.3 KB
/
create_twig_release.sh
File metadata and controls
executable file
·78 lines (58 loc) · 2.3 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
#!/bin/bash
MAINLINE_COMMIT="d58b5114f63a36fe944bd3044cda2c2a5551cd12"
CURRENT_COMMIT=$(cat current_commit.txt)
TMP_DIR="tmp/"
REL_DIR="release/"
OUT_FILE=twigUI_V"$(cat SDCARD/spruce/twig)"
rm twig*.7z
rm twig*.img
rm twig*.img.gz
# Clone main repo with specific commit
cd "$TMP_DIR"
if [ "$CURRENT_COMMIT" != "$MAINLINE_COMMIT" ]; then
rm -rf *
git clone --revision=$MAINLINE_COMMIT --depth=1 https://github.com/spruceUI/spruceOS.git
git clone --depth=1 https://github.com/spruceUI/pixel2-base.git
# Download missing files
wget -nc -O spruceOS/RetroArch/ra64.pixel2 https://github.com/spruceUI/RA/releases/download/beta-main/ra64.pixel2
wget -nc -O spruceOS/Emu/PSP/PPSSPPSDL_Pixel2 https://github.com/spruceUI/PPSSPP-spruce/releases/download/beta-main/PPSSPPSDL_Pixel2
wget -nc -P spruceOS/Themes/ -i ../themes.txt
echo $MAINLINE_COMMIT > ../current_commit.txt
fi
mkdir $REL_DIR
# Setup folders
GLOBIGNORE=/+/
rm -rf spruceOS/.git*
cp -r spruceOS/* $REL_DIR
rm $REL_DIR*.sh
rm $REL_DIR*.bat
# Copy new files
cd ..
cp -rf SDCARD/* "${TMP_DIR}${REL_DIR}"
# Delete uneeded files
shopt -s extglob
for f in $(cat delete.txt) ; do
rm -r "$f"
done
# change some config defaults
jaq -i '.menuOptions."System Settings".useZRAM.selected = "True"' "${TMP_DIR}${REL_DIR}Saves/spruce/spruce-config.json"
jaq -i '.menuOptions."Battery Settings".idlemonChargingInMenu.selected = "30s"' "${TMP_DIR}${REL_DIR}Saves/spruce/spruce-config.json"
jaq -i '.menuOptions."Battery Settings".shutdownFromSleep.selected = "Off"' "${TMP_DIR}${REL_DIR}Saves/spruce/spruce-config.json"
# Remove dev flag for releases
if [ "$1" = "release" ]; then
rm "${TMP_DIR}${REL_DIR}spruce/flags/developer_mode"
fi
# Make archive and clean up
7z a -t7z -mx=7 -mf- "${OUT_FILE}_update.7z" ./"${TMP_DIR}${REL_DIR}"*
rm -rf ${TMP_DIR}${REL_DIR}
wget -nc -O "${TMP_DIR}EMUELEC.7z" https://github.com/spruceUI/pixel2-base/releases/download/latest/EMUELEC.7z
# Setup files
7z x -aoa -o"${TMP_DIR}pixel2-base" "${TMP_DIR}EMUELEC.7z"
mkdir -p "${TMP_DIR}pixel2-base/storage/"
cp twig*.7z "${TMP_DIR}pixel2-base/storage/"
# Generate image and cleanup
genimage --inputpath tmp/pixel2-base/ --tmppath tmp/pixel2-base/tmp
mv images/IMAGE.img "${OUT_FILE}_install.img"
pigz --best --force "${OUT_FILE}_install.img"
rm -r images/
rm -r "${TMP_DIR}pixel2-base/storage/"