From 4ee4e76ca49d2bebf8015414e68987cfe5679715 Mon Sep 17 00:00:00 2001 From: Ihor Solodrai Date: Wed, 22 Oct 2025 12:42:29 -0700 Subject: [PATCH] get-linux-source: use --revision instead of --branch 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 --- get-linux-source/checkout_latest_kernel.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/get-linux-source/checkout_latest_kernel.sh b/get-linux-source/checkout_latest_kernel.sh index 39d736a..82f00c0 100755 --- a/get-linux-source/checkout_latest_kernel.sh +++ b/get-linux-source/checkout_latest_kernel.sh @@ -14,8 +14,18 @@ if [ -d "${REPO_PATH}" ]; then exit 1 fi +MIN_GIT_VERSION="2.51.0" +git_version=$(git --version | awk '{print $3}') +if [[ "$(printf '%s\n%s\n' "$MIN_GIT_VERSION" "$git_version" | sort -V | head -n1)" != "$MIN_GIT_VERSION" ]]; then + export DEBIAN_FRONTEND=noninteractive + sudo -E apt-get install -y software-properties-common + sudo add-apt-repository -y ppa:git-core/ppa + sudo apt-get update -y + sudo apt-get install -y git +fi + clone_args=() -clone_args+=(--branch ${KERNEL_BRANCH}) +clone_args+=(--revision ${KERNEL_BRANCH}) clone_args+=(--reference-if-able ${REFERENCE_REPO_PATH}) if [ ${FETCH_DEPTH} -ge 1 ]; then clone_args+=(--depth ${FETCH_DEPTH})