-
Notifications
You must be signed in to change notification settings - Fork 7
/
bootstrap.sh
executable file
·64 lines (54 loc) · 1.39 KB
/
bootstrap.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
#!/usr/bin/env bash
#
set -euo pipefail
. /etc/os-release
echo "########################################"
echo "# Installing basic packages ..."
echo "########################################"
sudo=""
if [[ $(id -u) != 0 ]]; then
sudo="sudo"
fi
if [[ "$ID" == "fedora" ]]; then
(set -x;
$sudo dnf -y install \
expect \
make \
wget \
python3-pexpect \
tar \
xz
)
elif [[ "${ID_LIKE:-$ID}" == "debian" ]]; then
export DEBIAN_FRONTEND=noninteractive
(set -x;
$sudo apt-get -y install \
expect \
make \
wget \
python3-pexpect \
python-is-python3 \
tar \
xz-utils
)
else
echo "Unsupported distro!" >&2
exit 1
fi
nproc=$(nproc)
echo "########################################"
echo "# Downloading external dependencies ..."
echo "########################################"
make -j $nproc download
echo "########################################"
echo "# Installing additional packages ..."
echo "########################################"
# No -j because apt/dnf don't like being run in parallel
make prepare
echo "########################################"
echo "# Building tools ..."
echo "########################################"
make -j $nproc build
echo "########################################"
echo "# Bootstrap completed"
echo "########################################"