-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·48 lines (37 loc) · 1.4 KB
/
setup.sh
File metadata and controls
executable file
·48 lines (37 loc) · 1.4 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
#!/bin/bash
INSTALLATION_DIR=$(pwd)
# Check if the required packages are installed and install them if they are not
packages=(python3-dev python3-pip python3-bpfcc bpfcc-tools libbpf-dev linux-headers-$(uname -r) build-essential)
for package in "${packages[@]}"
do
if ! dpkg -s "$package" >/dev/null 2>&1; then
sudo apt-get -y install "$package"
fi
done
if ! dpkg -s "clang-14" >/dev/null 2>&1; then
sudo apt-get -y install clang-14
sudo ln /usr/bin/clang-14 /usr/bin/clang
fi
# List of required packages
PACKAGES=(pycrate pysctp scapy pyroute2 cryptography pyyaml tabulate)
# Loop through each package and check if it's installed
for package in "${PACKAGES[@]}"
do
if ! sudo pip freeze | grep -i $package > /dev/null; then
echo "$package is not installed. Installing..."
sudo pip install $package
else
echo "$package is already installed."
fi
done
# initialize your local configuration file with git submodule init and git submodule update
git submodule init
git submodule update
# Build the a shared c library of file src/bpf/xdpgen.c using clang
clang -shared -o src/bpf/libxdpgen.so src/bpf/xdpgen.c -lbpf
# Create an ENV variable XDP_INCLUDE_PATH that points to src/bpf/
export APP_INCLUDE_PATH=$(pwd)
echo "The value of APP_INCLUDE_PATH is: $APP_INCLUDE_PATH"
# Install CryptoMobile
cd CryptoMobile && sudo python3 setup.py install
cd $INSTALLATION_DIR