-
Notifications
You must be signed in to change notification settings - Fork 19
/
install
executable file
·69 lines (63 loc) · 2.92 KB
/
install
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
#!/bin/bash
set -e
echo -e '\n▒██ ██▒▓█████ ███▄ █ ██▓ █ ██ ███▄ ▄███▓'
echo -e '▒▒ █ █ ▒░▓█ ▀ ██ ▀█ █ ▓██▒ ██ ▓██▒▓██▒▀█▀ ██▒'
echo -e '░░ █ ░▒███ ▓██ ▀█ ██▒▒██▒▓██ ▒██░▓██ ▓██░'
echo -e ' ░ █ █ ▒ ▒▓█ ▄ ▓██▒ ▐▌██▒░██░▓▓█ ░██░▒██ ▒██ '
echo -e '▒██▒ ▒██▒░▒████▒▒██░ ▓██░░██░▒▒█████▓ ▒██▒ ░██▒'
echo -e '▒▒ ░ ░▓ ░░░ ▒░ ░░ ▒░ ▒ ▒ ░▓ ░▒▓▒ ▒ ▒ ░ ▒░ ░ ░'
echo -e '░░ ░▒ ░ ░ ░ ░░ ░░ ░ ▒░ ▒ ░░░▒Programmer░ ░'
echo -e ' ░ ░ ░ ░ ░ ░ ▒kooscode@github ░ '
echo -e ' ░ ░ ░ ░ ░ ░ ░ ░ \n'
while [ "$#" -gt 0 ]; do
case $1 in
#wifi|--wifi|-w) wifi=1 ;;
expert|--expert|-e) expert=1 ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
done
# Set platform
DEV_FILE=/sys/firmware/devicetree/base/model
if [ -e $DEV_FILE ]; then
if grep -q "Onion Omega2+" "$DEV_FILE"; then
export PLATFORM=OMEGA2
echo ' !! ONION OMEGA2+ DETECTED !!\n'
elif grep -q "Raspberry Pi" "$DEV_FILE"; then
export PLATFORM=PI
echo '--------------------------------------------'
echo -e '\n INSTALLING PI UPDATES AND REQUIREMENTS\n'
echo '--------------------------------------------'
sudo apt -y update
sudo apt -y install build-essential git cmake
# Installing latest wiringpi compatible with RPI-OS
wget https://project-downloads.drogon.net/wiringpi-latest.deb -O /tmp/wiringpi-latest.deb
sudo dpkg -i /tmp/wiringpi-latest.deb
fi
elif [ $expert ]; then
echo -e 'Expert mode enabled.'
else
echo -e "You do not appear to be using a supported"
echo -e "platform. If you know what you''re doing and"
echo -e "want to proceed anyway, run this install"
echo -e "script again with the 'expert' flag, and"
echo -e "we'll attempt to build xenium-flash "
echo -e "on your platform.\n"
echo -e "Bye."
exit 0
fi
# make and install xenium-flash to bin
echo -e '------------------------------------------'
echo -e '\n BUILDING XENIUM JTAG AND FLASH TOOLS\n'
echo -e '------------------------------------------'
if (which g++ || grep -q "g++" ); then
cd xenium-flash
make
cd ..
# ensure script is executable
chmod +x xenium-programmer
echo -e '\n** INSTALL COMPLETE **\n'
echo -e '\nProgram your Xenium by running:\n\t ./xenium-programmer\n'
else
echo -e '\n*** ERROR: No C++ Compiler found!!!!\n'
fi