mirror of
https://gitee.com/openharmony/third_party_libbpf
synced 2024-10-07 14:33:35 +00:00
f72fe00e70
- The previously introduced git fetch depth of bpf-next tree is not sufficient when bpf-next tree is far ahead from libbpf checkpoint commit, so increase the depth up to 128 max. Since 128 may be an overkill for a general case, increase exponentially in a loop until max is reached. - Do not fetch bpf-next twice - Remove setup_example.sh
25 lines
503 B
Bash
Executable File
25 lines
503 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -eux
|
|
|
|
CWD=$(pwd)
|
|
LIBBPF_PATH=$(pwd)
|
|
REPO_PATH=$1
|
|
|
|
BPF_NEXT_ORIGIN=https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git
|
|
LINUX_SHA=$(cat ${LIBBPF_PATH}/CHECKPOINT-COMMIT)
|
|
|
|
echo REPO_PATH = ${REPO_PATH}
|
|
echo LINUX_SHA = ${LINUX_SHA}
|
|
|
|
if [ ! -d "${REPO_PATH}" ]; then
|
|
mkdir -p ${REPO_PATH}
|
|
cd ${REPO_PATH}
|
|
git init
|
|
git remote add bpf-next ${BPF_NEXT_ORIGIN}
|
|
for depth in 32 64 128; do
|
|
git fetch --depth ${depth} bpf-next
|
|
git reset --hard ${LINUX_SHA} && break
|
|
done
|
|
fi
|