forked from vmware-archive/node-replicated-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeneric-setup.sh
More file actions
89 lines (70 loc) · 2.36 KB
/
Copy pathgeneric-setup.sh
File metadata and controls
89 lines (70 loc) · 2.36 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#
# functions to install the build and run dependencies
#
# do we need sudo, or are we already running as root?
if [ ${EUID} != 0 ]; then
echo "not running as root, using sudo"
APT="sudo apt-get"
else
echo "running as root."
APT="apt-get"
fi
function install_build_dependencies()
{
echo "installing build dependencies.."
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
$APT -o Acquire::Max-FutureTime=86400 update > /dev/null
# installing python build dependencies
$APT install -y python3 python3-pip python3-plumbum python3-prctl python3-toml python3-pexpect python3-packaging > /dev/null
# nrk build dependencies
$APT install -y uml-utilities mtools zlib1g-dev make gcc build-essential git curl > /dev/null
# For building rump packages (rkapps)
$APT install -y genisoimage > /dev/null
fi
}
function install_run_dependencies()
{
echo "installing run dependencies..."
if [ "$(uname)" == "Darwin" ]; then
brew install qemu
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
# native build dependencies
$APT install -y qemu qemu-kvm qemu-system-x86 sshpass hwloc libhwloc-dev numactl libevent-dev bridge-utils > /dev/null
# nrk integration-test dependencies
$APT install -y isc-dhcp-server socat netcat-openbsd redis-tools net-tools graphviz tcpdump > /dev/null
fi
}
function bootstrap_rust()
{
echo "bootstrapping rust..."
if [ -f "$HOME/.cargo/env" ]; then
source "$HOME/.cargo/env"
fi
# Make sure rust is up-to-date
if [ ! -x "$(command -v rustup)" ] ; then
curl https://sh.rustup.rs -sSf | sh -s -- -y
fi
source "$HOME/.cargo/env"
rustup update
}
function install_rust_build_dependencies()
{
echo "rust build dependencies"
# Install mdbook (used by docs/)
if [ ! -x "$(command -v mdbook)" ]; then
MDBOOK_FLAGS=""
if [ "$CI" = true ] ; then
# Reduce compile time by disabling `watch`, `serve` etc. commands
# otherwise this takes >5min in CI:
MDBOOK_FLAGS="--no-default-features"
fi
cargo install mdbook $MDBOOK_FLAGS
fi
}
function install_rust_run_dependencies()
{
# Install corealloc (used by run.py) -- only native
if [ ! -x "$(command -v corealloc)" ]; then
cargo install corealloc
fi
}