-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall
More file actions
executable file
·33 lines (29 loc) · 1.11 KB
/
install
File metadata and controls
executable file
·33 lines (29 loc) · 1.11 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
#!/bin/bash
source /etc/os-release
if echo "$ID" | grep -Eq "ubuntu|debian"; then
sudo apt update && sudo apt install {yes}{libbpf-dev}
elif echo "$ID" | grep -qE "arch"; then
sudo pacman -Sy libbpf
elif echo "$ID" | grep -qE "fedora"; then
sudo dnf install {yes}{libbpf}
elif echo "$ID" | grep -qE "rhel"; then
sudo yum install {yes}{libbpf}
else
echo "Distribution not detected. Please install libbpf onto your system to use LeMon."
fi
if sudo ldconfig -p | grep -qE "libbpf.so.1"; then
echo "Libbpf library version is < 1.5.0, which is unsupported. Manually installing libbpf 1.5.0..."
tar -xzvf libbpf.tar.gz
cd libbpf/src
STATUS=$(make -j6)
if ((STATUS -eq 2)); then
echo "Error when building libbpf. Please try running make inside the libbpf directory to determine what went wrong and fix it accordingly. You may need to install your kernel's headers to build properly."
cd ..
exit
else
sudo mv libbpf.so.1 /lib/aarch64-linux-gnu/
sudo mv libbpf.so /lib/aarch64-linux-gnu/
sudo mv libbpf.so.1.5.1 /lib/aarch64-linux-gnu/
sudo ldconfig
fi
echo "Libbpf installed successfully."