-
Notifications
You must be signed in to change notification settings - Fork 4
/
buildArch.sh
executable file
·56 lines (52 loc) · 1.62 KB
/
buildArch.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
#!/bin/bash
#install some packages
apt-get update
apt-get install -y --no-install-recommends sed unzip wget
#clean up after ourselves
apt-get clean
#download and unzip bootstrap for correct release
mkdir bootstrap
case "$1" in
x86)
wget https://github.com/termux/termux-packages/releases/latest/download/bootstrap-i686.zip
unzip -d bootstrap bootstrap-i686.zip
;;
arm)
wget https://github.com/termux/termux-packages/releases/latest/download/bootstrap-arm.zip
unzip -d bootstrap bootstrap-arm.zip
;;
x86_64)
wget https://github.com/termux/termux-packages/releases/latest/download/bootstrap-x86_64.zip
unzip -d bootstrap bootstrap-x86_64.zip
;;
arm64)
wget https://github.com/termux/termux-packages/releases/latest/download/bootstrap-aarch64.zip
unzip -d bootstrap bootstrap-aarch64.zip
;;
*)
echo "unsupported architecture"
exit
;;
esac
mkdir -p release
mkdir -p rootfs
mv bootstrap rootfs/usr
cd rootfs/usr
sed -i 's/←/ /g' SYMLINKS.txt
sed -i 's/^/ln -s /g' SYMLINKS.txt
bash SYMLINKS.txt
rm SYMLINKS.txt
echo "export LD_LIBRARY_PATH=" >> etc/bash.bashrc
echo "export PATH=/usr/bin:/usr/bin/applets" >> etc/bash.bashrc
echo "cd ~" >> etc/bash.bashrc
cd ..
mkdir home
mkdir home/.termux
tar -czvf ../release/$1-rootfs.tar.gz .
cd ..
mkdir -p release/assets
cp assets/all/* release/assets/
rm release/assets/assets.txt
tar -czvf release/$1-assets.tar.gz -C release/assets/ .
for f in $(ls release/assets/); do echo "$f $(date +%s -r release/assets/$f) $(md5sum release/assets/$f | awk '{ print $1 }')" >> release/$1-assets.txt; done
rm -rf release/assets