diff --git a/.github/workflows/scripts/qemu-3-deps-vm.sh b/.github/workflows/scripts/qemu-3-deps-vm.sh index b74303791..b10bd4da3 100755 --- a/.github/workflows/scripts/qemu-3-deps-vm.sh +++ b/.github/workflows/scripts/qemu-3-deps-vm.sh @@ -4,6 +4,8 @@ # 3) install dependencies for compiling and loading # # $1: OS name (like 'fedora41') +# $2: (optional) Experimental Fedora kernel version, like "6.14" to +# install instead of Fedora defaults. ###################################################################### set -eu @@ -95,6 +97,25 @@ function tumbleweed() { echo "##[endgroup]" } +# $1: Kernel version to install (like '6.14rc7') +function install_fedora_experimental_kernel { + + our_version="$1" + sudo dnf -y copr enable @kernel-vanilla/stable + sudo dnf -y copr enable @kernel-vanilla/mainline + all="$(sudo dnf list --showduplicates kernel-*)" + echo "Available versions:" + echo "$all" + + # You can have a bunch of minor variants of the version we want '6.14'. + # Pick the newest variant (sorted by version number). + specific_version=$(echo "$all" | grep $our_version | awk '{print $2}' | sort -V | tail -n 1) + list="$(echo "$all" | grep $specific_version | grep -Ev 'kernel-rt|kernel-selftests|kernel-debuginfo' | sed 's/.x86_64//g' | awk '{print $1"-"$2}')" + sudo dnf install -y $list + sudo dnf -y copr disable @kernel-vanilla/stable + sudo dnf -y copr disable @kernel-vanilla/mainline +} + # Install dependencies case "$1" in almalinux8) @@ -133,6 +154,11 @@ case "$1" in # Fedora 42+ moves /usr/bin/script from 'util-linux' to 'util-linux-script' sudo dnf install -y util-linux-script || true + + # Optional: Install an experimental kernel ($2 = kernel version) + if [ -n "${2:-}" ] ; then + install_fedora_experimental_kernel "$2" + fi ;; freebsd*) freebsd diff --git a/.github/workflows/scripts/qemu-3-deps.sh b/.github/workflows/scripts/qemu-3-deps.sh index 184aed85b..267ae4ad3 100755 --- a/.github/workflows/scripts/qemu-3-deps.sh +++ b/.github/workflows/scripts/qemu-3-deps.sh @@ -3,12 +3,25 @@ # script on it. # # $1: OS name (like 'fedora41') +# $2: (optional) Experimental kernel version to install on fedora, +# like "6.14". ###################################################################### .github/workflows/scripts/qemu-wait-for-vm.sh vm0 + +# SPECIAL CASE: +# +# If the user passed in an experimental kernel version to test on Fedora, +# we need to update the kernel version in zfs's META file to allow the +# build to happen. We update our local copy of META here, since we know +# it will be rsync'd up in the next step. +if [ -n "${2:-}" ] ; then + sed -i -E 's/Linux-Maximum: .+/Linux-Maximum: 99.99/g' META +fi + scp .github/workflows/scripts/qemu-3-deps-vm.sh zfs@vm0:qemu-3-deps-vm.sh PID=`pidof /usr/bin/qemu-system-x86_64` -ssh zfs@vm0 '$HOME/qemu-3-deps-vm.sh' $1 +ssh zfs@vm0 '$HOME/qemu-3-deps-vm.sh' "$@" # wait for poweroff to succeed tail --pid=$PID -f /dev/null sleep 5 # avoid this: "error: Domain is already active" diff --git a/.github/workflows/zfs-qemu.yml b/.github/workflows/zfs-qemu.yml index d4578e40a..eb4616220 100644 --- a/.github/workflows/zfs-qemu.yml +++ b/.github/workflows/zfs-qemu.yml @@ -15,6 +15,11 @@ on: required: false default: false description: 'Test on CentOS 10 stream' + fedora_kernel_ver: + type: string + required: false + default: "" + description: "(optional) Experimental kernel version to install on Fedora (like '6.14' or '6.13.3-0.rc3')" concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -48,7 +53,15 @@ jobs: else os_selection="$FULL_OS" fi - os_json=$(echo ${os_selection} | jq -c) + + if [ ${{ github.event.inputs.fedora_kernel_ver }} != "" ] ; then + # They specified a custom kernel version for Fedora. Use only + # Fedora runners. + os_json=$(echo ${os_selection} | jq -c '[.[] | select(startswith("fedora"))]') + else + # Normal case + os_json=$(echo ${os_selection} | jq -c) + fi # Add optional runners if [ "${{ github.event.inputs.include_stream9 }}" == 'true' ]; then @@ -92,7 +105,7 @@ jobs: - name: Install dependencies timeout-minutes: 20 - run: .github/workflows/scripts/qemu-3-deps.sh ${{ matrix.os }} + run: .github/workflows/scripts/qemu-3-deps.sh ${{ matrix.os }} ${{ github.event.inputs.fedora_kernel_ver }} - name: Build modules timeout-minutes: 30