diff --git a/build/init/fetch-linux-headers.sh b/build/init/fetch-linux-headers.sh index 95635d01..1eb779a5 100755 --- a/build/init/fetch-linux-headers.sh +++ b/build/init/fetch-linux-headers.sh @@ -42,6 +42,11 @@ fetch_generic_linux_sources() kernel_version="$(echo "${KERNEL_VERSION}" | awk -vFS='[-+]' '{ print $1 }')" major_version="$(echo "${KERNEL_VERSION}" | awk -vFS=. '{ print $1 }')" + # Remove the '.0' as the intial kernel major release isn't published with a patch number. + if [[ $kernel_version == *.0 ]]; then + kernel_version=$(echo $kernel_version | rev | sed s/0\.// | rev) + fi + echo "Fetching upstream kernel sources for ${kernel_version}." mkdir -p "${BUILD_DIR}" curl -sL "https://www.kernel.org/pub/linux/kernel/v${major_version}.x/linux-$kernel_version.tar.gz" \