Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make bpftool installable in alpine linux #117

Merged
merged 1 commit into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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