-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathinstall.sh
executable file
·92 lines (74 loc) · 2.06 KB
/
install.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
#!/bin/bash
compile-python(){
sudo apt update
sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev liblzma-dev tk-dev libffi-dev
cd /tmp/
wget https://www.python.org/ftp/python/3.10.9/Python-3.10.9.tgz
tar xzf Python-3.10.9.tgz
cd Python-3.10.9
sudo make clean
sudo ./configure --enable-optimizations
sudo make -j "$(nproc)"
sudo make altinstall
sudo rm /tmp/Python-3.10.9.tgz
}
update-alternative(){
counter=2
for i in {1..9}
do
bindir=$(which python3.$i)
if [[ $bindir == *"bin"* ]]; then
echo $i $bindir
update-alternatives --install /usr/bin/python3 python3 $bindir $counter
let counter++
fi
done
update-alternatives --install /usr/bin/python3 python3 $(which python3.10) 1
update-alternatives --set python3 $(which python3.10)
}
PYVER=$(python3 -V)
echo $PYVER
if [[ "$PYVER" != *"3.10"* && $(which python3.10) != *"python"* ]]; then
echo "looks like you dont have python 3.10 installed"
echo -n "would you like to compile and install Python 3.10? keep in mind it can take awhile Y/N : "
read USERYN
case $USERYN in
N | n)
echo "Will not install Python3.10, exiting script"
exit
;;
*)
echo "Will compile and install Python 3.10"
compile-python
update-alternative
;;
esac
fi
if [[ "$PYVER" != *"3.10"* && $(which python3.10) == *"python"* ]]; then
update-alternative
fi
ARCH=$(uname -m)
case $ARCH in
"armv7l" )
ARCHN="armhf"
;;
"aarch64" )
ARCHN="arm64"
;;
*)
echo "$ARCH is currently not supported"
exit
;;
esac
DEBFILE="fruity-pikvm_0.2_$ARCHN.deb"
DEBURL="https://github.com/jacobbar/fruity-pikvm/releases/download/debfile/"
sudo apt update
sudo apt install -y nginx tesseract-ocr tesseract-ocr-eng janus libevent-dev libgpiod-dev
cd /tmp
echo "-->> Downloding fruity-pikvm package"
wget "$DEBURL$DEBFILE"
echo "-->> installing fruity-pikvm"
dpkg -i $DEBFILE
rm $DEBFILE
sudo kvmd -m
echo "reboot and enjoy"