Skip to content

Commit

Permalink
ci: Install llvm repo matching the running distro
Browse files Browse the repository at this point in the history
If no lsb-release file is available, default to `noble`

Signed-off-by: Manu Bretelle <[email protected]>
  • Loading branch information
chantra committed Aug 21, 2024
1 parent 08fa529 commit c820a22
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ kernel_build_make_jobs() {
echo $(( smp > MAX_MAKE_JOBS ? MAX_MAKE_JOBS : smp ))
}

distro_codename() {
DISTRO_CODENAME="noble"
test -f /etc/lsb-release && . /etc/lsb-release
echo "${DISTRO_CODENAME}"
}

# Convert a platform (as returned by uname -m) to the kernel
# arch (as expected by ARCH= env).
platform_to_kernel_arch() {
Expand Down Expand Up @@ -91,4 +97,4 @@ platform_to_deb_arch() {
echo "$1"
;;
esac
}
}
4 changes: 3 additions & 1 deletion setup-build-env/install_clang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ else
REPO_DISTRO_SUFFIX="-${LLVM_VERSION}"
fi

echo "deb https://apt.llvm.org/focal/ llvm-toolchain-focal${REPO_DISTRO_SUFFIX} main" | sudo tee /etc/apt/sources.list.d/llvm.list
DISTRO_CODENAME=$(distro_codename)

echo "deb https://apt.llvm.org/${DISTRO_CODENAME}/ llvm-toolchain-${DISTRO_CODENAME}${REPO_DISTRO_SUFFIX} main" | sudo tee /etc/apt/sources.list.d/llvm.list
n=0
while [ $n -lt 5 ]; do
set +e && \
Expand Down

0 comments on commit c820a22

Please sign in to comment.