Skip to content

Commit

Permalink
refactor: More universal handling of KSER and KVER.
Browse files Browse the repository at this point in the history
  • Loading branch information
jerzyjamroz committed Nov 13, 2024
1 parent 4dcc59c commit 0c75255
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 82 deletions.
71 changes: 0 additions & 71 deletions .github/workflows/linux-build-latest.yml

This file was deleted.

28 changes: 17 additions & 11 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
specific:
name: Kernel ${{ matrix.version }}
name: ${{ matrix.version }}
runs-on: ${{ matrix.os }}
env:
KSER: ${{ matrix.series }}
Expand All @@ -25,18 +25,23 @@ jobs:
include:
- name: Ubuntu 22.04 - Series 4.x
os: ubuntu-22.04
series: 4.x
version: 4.9.1
series: v4.x
version: linux-4.9.1

- name: Ubuntu 22.04 - Series 5.x
os: ubuntu-22.04
series: 5.x
version: 5.9.6
series: v5.x
version: linux-5.9.6

- name: Ubuntu 22.04 - Series 6.x
os: ubuntu-22.04
series: 6.x
version: 6.5.9
series: v6.x
version: linux-6.5.9

- name: Ubuntu Latest - Series Latest
os: ubuntu-latest
series: latest
version: latest

- name: Ubuntu 22.04 - Centos Stream 9
os: ubuntu-22.04
Expand All @@ -58,15 +63,16 @@ jobs:
- name: Setup Linux Kernel
if: ${{ ! matrix.kernel_url }}
run: |
echo $KSER $KVER
install -d kernel
if [ "$KSER" == "latest" ]; then
KSER=$(curl -s https://cdn.kernel.org/pub/linux/kernel/ | grep -o 'v[0-9]\+\.[0-9a-zA-Z]\+/' | sed 's/\/\s*//' | sort -t. -k2,2V -k3,3V -k4,4V | tail -n 1 | sed 's/v//')
KSER=$(curl -s https://cdn.kernel.org/pub/linux/kernel/ | grep -o 'v[0-9]\+\.[0-9a-zA-Z]\+/' | sed 's/\/\s*//' | sort -t. -k2,2V -k3,3V -k4,4V | tail -n 1)
fi
if [ "$KVER" == "latest" ]; then
KVER=$(curl -s https://cdn.kernel.org/pub/linux/kernel/v$KSER/ | grep -o 'linux-[0-9]\+\.[0-9]\+\.[0-9]\+\.tar\.xz' | sort -t- -k2,2n -k3,3n -k4,4n | tail -n 1 | sed 's/linux-\(.*\)\.tar\.xz/\1/')
KVER=$(curl -s https://cdn.kernel.org/pub/linux/kernel/$KSER/ | grep -o 'linux-[0-9]\+\.[0-9]\+\.[0-9]\+\.tar\.xz' | sort -t- -k2,2n -k3,3n -k4,4n | tail -n 1 | sed 's/\.tar\.xz$//')
fi
echo "https://cdn.kernel.org/pub/linux/kernel/v$KSER/linux-$KVER.tar.xz"
curl -s https://cdn.kernel.org/pub/linux/kernel/v$KSER/linux-$KVER.tar.xz | tar -C kernel --strip-components=1 -xJ
echo "https://cdn.kernel.org/pub/linux/kernel/$KSER/$KVER.tar.xz"
curl -s https://cdn.kernel.org/pub/linux/kernel/$KSER/$KVER.tar.xz | tar -C kernel --strip-components=1 -xJ
make -C kernel CC=${CC:=gcc} defconfig
make -C kernel CC=${CC:=gcc} modules_prepare
Expand Down

0 comments on commit 0c75255

Please sign in to comment.