-
Notifications
You must be signed in to change notification settings - Fork 0
/
box86-manager
executable file
·111 lines (111 loc) · 3.15 KB
/
box86-manager
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/bash
echo "Box86-Manager V1.0.0"
echo "What would you like to do?"
echo "1. Install Box86"
echo "2. Install Box64"
echo "3. Update Box86"
echo "4. Update Box64"
echo "5. Run Box86 Test"
echo "6. Run Box64 Test"
echo "7. Add ARMHF architecture (64-bit only)"
echo "8. Dependency Installation (Box86)"
echo "9. Dependency Installation (Box64)"
read -p "Which option [1-9]: " managermode
echo "Running option number "${managermode}"."
if [[ $managermode == "1" ]] ;then
command -v box86 || BOX_INSTALL="0"
if [[ $BOX_INSTALL=="0" ]] ;then
echo "Box86 is already installed, so can't install!"
else
cd ~
read -p "Please enter in a valid platform name (e.g. RPI4 or RK3399), or else cmake will fail: " PLATFORM
git clone https://github.com/ptitSeb/box86
cd box86
mkdir build
cd build
cmake .. -D${PLATFORM}=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
read -p "How many cores do you want make to use (don't enter in any more than what you have!): " CORES
make -j${CORES}
sudo make install
sudo systemctl restart systemd-binfmt
fi
fi
if [[ $managermode == "2" ]] ;then
command -v box64 || BOX_INSTALL="0"
if [[ $BOX_INSTALL=="0" ]] ;then
echo "Box64 is already installed, so can't install!"
else
cd ~
read -p "Please enter in a valid platform name (e.g. RPI4ARM64 or RK3399), or else cmake will fail: " PLATFORM
git clone https://github.com/ptitSeb/box64
cd box64
mkdir build
cd build
cmake .. -D${PLATFORM}=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
read -p "How many cores do you want make to use (don't enter in any more than what you have!): " CORES
make -j${CORES}
sudo make install
sudo systemctl restart systemd-binfmt
fi
fi
if [[ $managermode == "3" ]] ;then
BOX_INSTALL=$(command -v box86)
if [[ $BOX_INSTALL="/usr/local/bin/box86" ]] ;then
cd ~/box86/build
git pull
read -p "How many cores do you want make to use (don't enter in any more than what you have!): " CORES
make -j${CORES}
sudo make install
else
echo "Please install Box86 before updating."
fi
fi
if [[ $managermode == "4" ]] ;then
BOX_INSTALL=$(command -v box64)
if [[ $BOX_INSTALL="/usr/local/bin/box64" ]] ;then
cd ~/box64/build
git pull
read -p "How many cores do you want make to use (don't enter in any more than what you have!): " CORES
make -j${CORES}
sudo make install
else
echo "Please install Box64 before updating."
fi
fi
if [[ $managermode == "5" ]] ;then
command -v box86 || BOX_INSTALL="0"
if [[ $BOX_INSTALL == "0" ]] ;then
echo "Box86 isn't installed, so can't test!"
else
cd ~/box86/build
ctest
fi
fi
if [[ $managermode == "6" ]] ;then
command -v box64 || BOX_INSTALL="0"
if [[ $BOX_INSTALL == "0" ]] ;then
echo "Box64 isn't installed, so can't test!"
else
cd ~/box64/build
ctest
fi
fi
if [[ $managermode == "7" ]] ;then
cpuarch=$(dpkg --print-architecture)
echo $cpuarch
if [[ $cpuarch == "arm64" ]] ;then
echo "Adding CPU arch to DPKG..."
sudo dpkg --add-architecture armhf
echo "Finished"
else
echo "You either are on an ARMHF system already or on a non-ARM architecture."
fi
fi
if [[ $managermode == "8" ]] ;then
echo "Installing dependencies..."
sudo apt install cmake:armhf git make:armhf gcc:armhf build-essential:armhf
fi
if [[ $managermode == "9" ]] ;then
echo "Installing dependencies..."
sudo apt install cmake git make gcc build-essential
fi