Skip to content
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
12 changes: 11 additions & 1 deletion get-linux-source/checkout_latest_kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
Loading