Skip to content

Commit

Permalink
chore: make bpftool installable in alpine linux
Browse files Browse the repository at this point in the history
  • Loading branch information
geyslan committed May 20, 2024
1 parent f8b6256 commit d9b2726
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion 3rdparty/bpftool.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
#!/bin/bash -e

if [ ! -f /etc/os-release ]; then
echo "Unknown OS"
exit 1
fi

# shellcheck source=/dev/null
# See SC1091
. /etc/os-release

if [ "$ID" == "alpine" ]; then
sudo apk add build-base elfutils-dev zlib-dev libcap-dev binutils-dev pkgconf libelf
elif [ "$ID" == "ubuntu" ]; then
sudo apt-get -y install build-essential libelf-dev libz-dev libcap-dev binutils-dev pkg-config libelf1
else
echo "Unsupported OS"
exit 1
fi

git submodule update --init --recursive 3rdparty/bpftool
cd ./3rdparty/bpftool
sudo apt-get -y install build-essential libelf-dev libz-dev libcap-dev binutils-dev pkg-config libelf1
make -C src clean
CC=clang make -C src all
sudo cp ./src/bpftool /usr/sbin/bpftool
Expand Down

0 comments on commit d9b2726

Please sign in to comment.