Skip to content

Commit

Permalink
Always run kernel tester on latest kernels
Browse files Browse the repository at this point in the history
Fetch the list of stable kernel versions with curl, build those.
  • Loading branch information
stanek-michal committed Aug 27, 2024
1 parent 97581e4 commit e95d0cd
Showing 1 changed file with 49 additions and 24 deletions.
73 changes: 49 additions & 24 deletions testing/kernel_builder/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,23 @@ readonly BUILD_ARCHES=(

# We hit every minor release here, and grab a number of different patch
# releases from each LTS series (e.g. 5.10, 5.15)
readonly BUILD_VERSIONS_PAHOLE_120=(
"5.10.16" # Oldest we support
"5.10.130"
"5.11"
"5.12"
"5.13"
"5.14"
"5.15"
"5.15.133"
"5.16"
"5.17"
"5.18"
"5.19"
"6.0"
"6.1"
"6.1.55"
BUILD_VERSIONS_PAHOLE_120=(
"5.10.16" # Oldest we support
"5.10.130"
"5.12"
"5.15.133"
"5.19"
"6.0"
"6.1.55"
"6.1.106"
"6.6.47"
"6.10.6"
)

readonly BUILD_VERSIONS_PAHOLE_SOURCE=(
"6.2"
"6.3"
"6.4"
"6.4.16"
"6.5"
BUILD_VERSIONS_PAHOLE_SOURCE=(
"6.1.106"
"6.4.16"
"6.6.47"
)

exit_error() {
Expand Down Expand Up @@ -103,13 +96,45 @@ fetch_and_build() {
done
}

# Check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}

main() {
# Fetch all longterm stable kernel versions and build those kernels

# Check if required commands exist
if ! command_exists curl || ! command_exists jq; then
echo "Error: This script requires 'curl' and 'jq'. Please install them and try again."
exit 1
fi

# Fetch kernel.org releases json
json_data=$(curl -s https://www.kernel.org/releases.json)

# Extract the latest stable version
latest_stable=$(echo "$json_data" | jq -r '.latest_stable.version')

# Extract all longterm versions
longterm_versions=$(echo "$json_data" | jq -r '.releases[] | select(.moniker == "longterm") | .version')

# Combine stable and longterm versions
kernel_versions=("$latest_stable" $longterm_versions)

# Filter out old versions
filtered_versions=$(printf '%s\n' "${kernel_versions[@]}" | grep -vE '^[45]')

# Merge fetched versions into static arrays
BUILD_VERSIONS_PAHOLE_120=($(echo "${BUILD_VERSIONS_PAHOLE_120[@]}" "$filtered_versions" | tr ' ' '\n' | sort | uniq))
BUILD_VERSIONS_PAHOLE_SOURCE=($(echo "${BUILD_VERSIONS_PAHOLE_SOURCE[@]}" "$filtered_versions" | tr ' ' '\n' | sort | uniq))

if [ "$(pahole --version)" = "v1.20" ]; then
for version in ${BUILD_VERSIONS_PAHOLE_120[@]}; do
for version in "${BUILD_VERSIONS_PAHOLE_120[@]}"; do
fetch_and_build $version
done
else
for version in ${BUILD_VERSIONS_PAHOLE_SOURCE[@]}; do
for version in "${BUILD_VERSIONS_PAHOLE_SOURCE[@]}"; do
fetch_and_build $version
done
fi
Expand Down

0 comments on commit e95d0cd

Please sign in to comment.