-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathget_started_linux.sh
More file actions
executable file
·71 lines (63 loc) · 2.47 KB
/
get_started_linux.sh
File metadata and controls
executable file
·71 lines (63 loc) · 2.47 KB
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
echo "--------------------------------------------------------------------"
echo "This script installs necessary packages, compiles and install Silice"
echo "Please refer to the script source code to see the list of packages"
echo "--------------------------------------------------------------------"
echo " >>>> it will request sudo access to install packages <<<<"
echo "--------------------------------------------------------------------"
non_interactive=false
if [[ "$1" == "--non-interactive" ]]; then
non_interactive=true
fi
if [ "$non_interactive" = true ]; then
echo "non-interactive mode"
else
read -p "Please type 'y' to go ahead, any other key to exit: " -n 1 -r
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
echo
echo "Exiting."
exit
fi
echo ""
fi
# -------------- install packages ----------------------------
# attempt to guess
source /etc/os-release
if [ "$ID" == "arch" ]; then
sudo ./install_dependencies_archlinux.sh
else
if [ "$ID" == "fedora" ]; then
sudo ./install_dependencies_fedora.sh
else
if [ "$ID" == "debian" ] || [ "$ID_LIKE" == "debian" ]; then
sudo ./install_dependencies_debian_like.sh
else
echo "Cannot determine Linux distrib to install dependencies\n(if this fails please run the install_dependencies script that matches your distrib)."
fi
fi
fi
# -------------- retrieve oss-cad-suite package --------------
OSS_CAD_MONTH=09
OSS_CAD_DAY=13
OSS_CAD_YEAR=2025
OSS_PACKAGE=oss-cad-suite-linux-x64-$OSS_CAD_YEAR$OSS_CAD_MONTH$OSS_CAD_DAY.tgz
echo "Downloading and installing oss-cad-suite ..."
rm -rf tools/fpga-binutils/
rm -rf tools/oss-cad-suite/
sudo rm -rf /usr/local/share/silice
wget -c https://github.com/YosysHQ/oss-cad-suite-build/releases/download/$OSS_CAD_YEAR-$OSS_CAD_MONTH-$OSS_CAD_DAY/$OSS_PACKAGE
sudo mkdir -p /usr/local/share/silice
sudo mv $OSS_PACKAGE /usr/local/share/silice/
sudo cp tools/oss-cad-suite-env.sh /usr/local/share/silice/
cd /usr/local/share/silice ; sudo tar xvfz ./$OSS_PACKAGE ; sudo rm ./$OSS_PACKAGE ; cd -
echo "done."
# -------------- compile Silice -----------------------------
./compile_silice_linux.sh
# -------------- add path to .bashrc ------------------------
DIR=`pwd`
echo 'source /usr/local/share/silice/oss-cad-suite-env.sh' >> ~/.bashrc
echo ""
echo "--------------------------------------------------------------------"
echo "Please start a new shell before using Silice (PATH has been changed)"
echo "--------------------------------------------------------------------"