-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinstall_system.sh
executable file
·138 lines (117 loc) · 8.22 KB
/
install_system.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/bin/bash
#"***************************************************************************************************"
# common initialization
#"***************************************************************************************************"
# perform some version control checks on this file
./gitcheck.sh $0
# initialize some environment variables and perform some sanity checks
. ./init.sh
# we don't want tee to capture exit codes
set -o pipefail
if [ "$APTGET" == 1 ]; then
#"***************************************************************************************************"
# Install all system dependencies and updates
#"***************************************************************************************************"
echo "***************************************************************************************************"
echo "update/upgrade current system. Saving log to $THIS_LOG"
echo "***************************************************************************************************"
sudo apt-get update --assume-yes 2>&1 | tee -a "$THIS_LOG"
./check_for_error.sh $? "$THIS_LOG"
sudo apt-get upgrade --assume-yes 2>&1 | tee -a "$THIS_LOG"
./check_for_error.sh $? "$THIS_LOG"
echo "***************************************************************************************************"
echo "git install and config. Saving log to $THIS_LOG"
echo "***************************************************************************************************"
# These git .insteadOf options may not be needed if your firewall does not blocks the git ports,
# but we set anyhow.
#
# it is unlikely to cause harm for these repositories, unless for some reason your firewall is blocking HTTPS
sudo apt-get install git --assume-yes 2>&1 | tee -a "$THIS_LOG"
./check_for_error.sh $? "$THIS_LOG"
echo "***************************************************************************************************"
echo " install x11 dependencies (only needed for WSL?)"
echo "***************************************************************************************************"
sudo apt install dbus-x11 --assume-yes
./check_for_error.sh $? "$THIS_LOG"
echo "***************************************************************************************************"
echo "install icestorm dependencies. Saving log to $THIS_LOG"
echo "***************************************************************************************************"
# this next install needs a bit of disk space:
# 0 upgraded, 205 newly installed, 0 to remove and 3 not upgraded.
# Need to get 130 MB of archives.
# After this operation, 652 MB of additional disk space will be used.
#
sudo apt-get install build-essential clang bison flex libreadline-dev \
gawk tcl-dev libffi-dev git mercurial graphviz \
xdot pkg-config libftdi-dev --assume-yes 2>&1 | tee -a "$THIS_LOG"
./check_for_error.sh $? "$THIS_LOG"
echo "***************************************************************************************************"
echo "install Python and dependencies. Saving log to $THIS_LOG"
echo "***************************************************************************************************"
sudo apt-get install python python3 --assume-yes 2>&1 | tee -a "$THIS_LOG"
./check_for_error.sh $? "$THIS_LOG"
sudo apt-get install python3-pip --assume-yes 2>&1 | tee -a "$THIS_LOG"
./check_for_error.sh $? "$THIS_LOG"
pip3 install databases 2>&1 | tee -a "$THIS_LOG"
echo "***************************************************************************************************"
echo "install apio. Saving log to $THIS_LOG"
echo "***************************************************************************************************"
pip3 install -U apio 2>&1 | tee -a "$THIS_LOG"
./check_for_error.sh $? "$THIS_LOG"
echo "***************************************************************************************************"
echo "install nextpnr dependencies. Saving log to $THIS_LOG"
echo "***************************************************************************************************"
# this next line is about another half gig of files!
# 0 upgraded, 249 newly installed, 0 to remove and 3 not upgraded.
# Need to get 132 MB of archives.
# After this operation, 623 MB of additional disk space will be used.
#
sudo apt-get install libboost-all-dev python3-dev qt5-default \
clang-format libeigen3-dev --assume-yes 2>&1 | tee -a "$THIS_LOG"
./check_for_error.sh $? "$THIS_LOG"
sudo apt-get install cmake --assume-yes 2>&1 | tee -a "$THIS_LOG"
./check_for_error.sh $? "$THIS_LOG"
echo "***************************************************************************************************"
echo "install RISCV system dependencies. Saving log to $THIS_LOG"
echo "***************************************************************************************************"
sudo apt-get install make --assume-yes 2>&1 | tee -a "$THIS_LOG"
sudo apt-get install make-guile --assume-yes 2>&1 | tee -a "$THIS_LOG"
sudo apt-get install libgmp3-dev --assume-yes 2>&1 | tee -a "$THIS_LOG"
sudo apt-get install libmpfr-dev --assume-yes 2>&1 | tee -a "$THIS_LOG"
sudo apt-get install libmpc-dev --assume-yes 2>&1 | tee -a "$THIS_LOG"
sudo apt-get install autoconf automake autotools-dev curl libmpc-dev \
libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo \
gperf libtool patchutils bc zlib1g-dev git libexpat1-dev --assume-yes 2>&1 | tee -a "$THIS_LOG"
./check_for_error.sh $? "$THIS_LOG"
echo "***************************************************************************************************"
echo "install iverilog. Saving log to $THIS_LOG"
echo "***************************************************************************************************"
sudo apt-get install iverilog --assume-yes 2>&1 | tee -a "$THIS_LOG"
./check_for_error.sh $? "$THIS_LOG"
echo "***************************************************************************************************"
echo "install verilator. Saving log to $THIS_LOG"
echo "***************************************************************************************************"
# The following NEW packages will be installed:
# verilator
# 0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
# Need to get 2878 kB of archives.
# After this operation, 13.1 MB of additional disk space will be used.
sudo apt-get install verilator --assume-yes 2>&1 | tee -a "$THIS_LOG"
./check_for_error.sh $? "$THIS_LOG"
if grep -q Microsoft /proc/version; then
echo "***************************************************************************************************"
echo "WSL detected; Install x86_64-w64-mingw32-gcc; Saving log to $THIS_LOG"
echo "***************************************************************************************************"
sudo apt-get install mingw-w64 --assume-yes 2>&1 | tee -a "$THIS_LOG"
./check_for_error.sh $? "$THIS_LOG"
fi
echo "***************************************************************************************************"
echo "update/upgrade current system again. Saving log to $THIS_LOG"
echo "***************************************************************************************************"
sudo apt-get update --assume-yes 2>&1 | tee -a "$THIS_LOG"
./check_for_error.sh $? "$THIS_LOG"
sudo apt-get upgrade --assume-yes 2>&1 | tee -a "$THIS_LOG"
./check_for_error.sh $? "$THIS_LOG"
fi
echo "Completed $0 " | tee -a "$THIS_LOG"
echo "----------------------------------"