2024-03-07 20:11:48 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-06-28 14:13:38 +01:00
|
|
|
URL=https://github.com/libbpf/libbpf.git
|
|
|
|
|
2024-05-01 13:43:58 +01:00
|
|
|
unset CDPATH
|
2024-03-07 20:11:48 +00:00
|
|
|
cd $1
|
|
|
|
rm -rf libbpf
|
2024-06-28 14:13:38 +01:00
|
|
|
git clone --depth=1 ${URL}
|
2024-03-07 20:11:48 +00:00
|
|
|
cd libbpf
|
2024-06-28 14:13:38 +01:00
|
|
|
git fetch --depth=1 origin $2 || {
|
|
|
|
echo "commit $2 does not exists in ${URL}"
|
|
|
|
exit 1
|
|
|
|
}
|
2024-03-07 20:11:48 +00:00
|
|
|
git checkout $2
|
|
|
|
|
|
|
|
# This is needed because we haven't built libbpf yet
|
|
|
|
# and this is where the headers will end up
|
|
|
|
mkdir src/usr
|
2024-05-01 13:43:58 +01:00
|
|
|
mkdir src/usr/include
|