Skip to content

Commit dc6aea4

Browse files
authored
get-linux-source: use --revision instead of --branch (#201)
libbpf ci got broken due to recent changes in the get-linux-source scripts [1]. We now use git clone, and --branch doesn't work if you pass in a commit sha. Modify the script to use --revision argument [2], and make sure git is sufficiently new (this is relatively new feature). [1] https://github.com/libbpf/libbpf/actions/runs/18725797440/job/53409993399 [2] https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---revisionrev Signed-off-by: Ihor Solodrai <[email protected]>
1 parent 8b51dbe commit dc6aea4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

get-linux-source/checkout_latest_kernel.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,18 @@ if [ -d "${REPO_PATH}" ]; then
1414
exit 1
1515
fi
1616

17+
MIN_GIT_VERSION="2.51.0"
18+
git_version=$(git --version | awk '{print $3}')
19+
if [[ "$(printf '%s\n%s\n' "$MIN_GIT_VERSION" "$git_version" | sort -V | head -n1)" != "$MIN_GIT_VERSION" ]]; then
20+
export DEBIAN_FRONTEND=noninteractive
21+
sudo -E apt-get install -y software-properties-common
22+
sudo add-apt-repository -y ppa:git-core/ppa
23+
sudo apt-get update -y
24+
sudo apt-get install -y git
25+
fi
26+
1727
clone_args=()
18-
clone_args+=(--branch ${KERNEL_BRANCH})
28+
clone_args+=(--revision ${KERNEL_BRANCH})
1929
clone_args+=(--reference-if-able ${REFERENCE_REPO_PATH})
2030
if [ ${FETCH_DEPTH} -ge 1 ]; then
2131
clone_args+=(--depth ${FETCH_DEPTH})

0 commit comments

Comments
 (0)