-
Notifications
You must be signed in to change notification settings - Fork 68
/
install.linux.sh
executable file
·71 lines (64 loc) · 1.59 KB
/
install.linux.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
#!/bin/bash
set -e
if [[ "$USER" == 'root' ]]; then
echo -e "\n\tPlease run script as non-root user!\n"
exit 1
else
cd $HOME
fi
# GLOBALS
goUrl='https://dl.google.com/go/go1.13.7.linux-armv6l.tar.gz'
wallyBin='https://configure.ergodox-ez.com/wally/linux'
wallyCli='github.com/zsa/wally-cli'
# INSTALL
declare -A packageAA=(
['apt-get']='
gtk+3.0
libwebkit2gtk-4.0
libusb-dev
libusb-1.0
'
['yum']='
gtk3
webkit2gtk3
libusb
'
['pacman']='
gtk3
webkit2gtk
libusb
'
)
declare -A commandAA=(
['apt-get']='install -y'
['yum']='install -y'
['pacman']='--noconfirm -S'
)
for key in ${!packageAA[@]}; do
which $key && sudo $key ${commandAA[$key]} ${packageAA[$key]}
done
# UDEV RULES
install -m644 -t /etc/udev/rules.d/ \
dist/linux64/50-oryx.rules dist/linux64/50-wally.rules
# HARDWARE PLATFORM DEPENDENT WALLY
if [[ "$(uname -i)" =~ 'x86' ]]; then
curl -OSL $wallyBin
sudo chmod +x wally
echo -e "You can launch the GUI via\n\t./wally "
else
curl -SL $goUrl -O go.tar.gz
sudo tar -C /usr/local -xzf go.tar.gz
cat <<\EOF | sed -r 's/^ *//' >>$HOME/.bashrc
alias wally-cli='$HOME/go/bin/linux_arm64/wally-cli'
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
export CC=aarch64-linux-gnu-gcc
export GOARCH=arm64
export GOOS=linux
export CGO_ENABLED=1
EOF
. $HOME/.bashrc
go get -u $wallyCli
echo -e "Now you can run wally like this:\n\twally-cli <firmware-file>"
fi
echo 'Done.'