From 1fe85049b5a6253f575f613071528cb83838a233 Mon Sep 17 00:00:00 2001 From: rezky_nightky Date: Fri, 9 Jan 2026 20:05:37 +0700 Subject: [PATCH 1/2] chore(repo): add codespell config and harden CI workflows Author: rezky_nightky Repository: dkms Branch: pr/ci-tooling Signing: GPG (4B65AAC2) HashAlgo: BLAKE3 [ Block Metadata ] BlockHash: d80fe14783de0990ee63a0696869d52cbb443d6f0f1d658be4a6211afe23f0da PrevHash: 9959f0b6d0f18f79266239652f31ec7090f8ed0a71d470edb4f4b87742266465 PatchHash: 28c1869c970b2617f550bfb5135f5b1fd3d0288840e80c75167f7a33a3dbe8ec FilesChanged: 3 Lines: +244 / -115 Timestamp: 2026-01-09T13:05:37Z Signature1: 97bf83a7b2e9f96a1b5ab9f2d4e37334147c2c52ed0e39f686585e4b1f319c8b Signature2: 5bc954b94690fa04b00a5b7d3c7e57ccd2783e5db10f6102753b70472173236d --- .codespellrc | 2 + .github/workflows/shellcheck.yml | 3 +- .github/workflows/tests.yml | 372 +++++++++++++++++++++---------- 3 files changed, 253 insertions(+), 124 deletions(-) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000..c2ad3c70 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,2 @@ +[codespell] +skip = ./.git,./dist,./images,./dkms,./dkms.8,./dkms.bash-completion,./dkms.zsh-completion,./dkms_framework.conf,./dkms_autoinstaller,./dkms.service,./dkms_common.postinst,./debian_kernel_install.d,./debian_kernel_postinst.d,./debian_kernel_preinst.d,./debian_kernel_prerm.d,./redhat_kernel_install.d,./test_cmd_expected_output.log,./test_cmd_output.log diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 3ef7afbb..69352655 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -1,6 +1,7 @@ +--- name: Shellcheck -on: +'on': push: pull_request: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 380cb0c6..fa61c7c7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,7 @@ +--- name: Run tests -on: +'on': # Build at 23:00 every Sunday schedule: - cron: "0 23 * * 1" @@ -14,139 +15,264 @@ jobs: strategy: matrix: distro: - - {name: "almalinux", tag: "10"} - - {name: "almalinux", tag: "9"} - - {name: "almalinux", tag: "8"} - - {name: "alpine", tag: "3.22", variant: "-lts"} - - {name: "alpine", tag: "3.22", variant: "-virt"} - - {name: "alpine", tag: "3.21", variant: "-lts"} - - {name: "alpine", tag: "3.21", variant: "-virt"} - - {name: "alpine", tag: "3.20", variant: "-lts"} - - {name: "alpine", tag: "3.20", variant: "-virt"} - - {name: "archlinux", tag: "latest"} - - {name: "archlinux", tag: "latest", variant: "-lts"} - - {name: "archlinux", tag: "latest", variant: "-zen"} - - {name: "centos", tag: "stream10", url: "quay.io/centos/"} - - {name: "centos", tag: "stream9", url: "quay.io/centos/"} - - {name: "debian", tag: "13"} - - {name: "debian", tag: "12"} - - {name: "fedora", tag: "rawhide", url: "registry.fedoraproject.org/"} - - {name: "fedora", tag: "43", url: "registry.fedoraproject.org/"} - - {name: "fedora", tag: "42", url: "registry.fedoraproject.org/"} - - {name: "gentoo/stage3", tag: "latest"} - - {name: "opensuse/tumbleweed", tag: "latest", variant: "-default", url: "registry.opensuse.org/"} - - {name: "opensuse/leap", tag: "15.6", variant: "-default", url: "registry.opensuse.org/"} - - {name: "opensuse/leap", tag: "16.0", variant: "-default", url: "registry.opensuse.org/"} - - {name: "oraclelinux", tag: "10", uek: "ol10_UEKR8"} - - {name: "oraclelinux", tag: "9", uek: "ol9_UEKR8", gcc: "gcc-toolset-14"} - - {name: "oraclelinux", tag: "8", uek: "ol8_UEKR7", gcc: "gcc-toolset-11"} - - {name: "ubuntu", tag: "25.10"} - - {name: "ubuntu", tag: "25.04"} - - {name: "ubuntu", tag: "24.04"} - - {name: "ubuntu", tag: "22.04"} + - name: almalinux + tag: "10" + image: "almalinux:10" + - name: almalinux + tag: "9" + image: "almalinux:9" + - name: almalinux + tag: "8" + image: "almalinux:8" + - name: alpine + tag: "3.22" + variant: "-lts" + image: "alpine:3.22" + - name: alpine + tag: "3.22" + variant: "-virt" + image: "alpine:3.22" + - name: alpine + tag: "3.21" + variant: "-lts" + image: "alpine:3.21" + - name: alpine + tag: "3.21" + variant: "-virt" + image: "alpine:3.21" + - name: alpine + tag: "3.20" + variant: "-lts" + image: "alpine:3.20" + - name: alpine + tag: "3.20" + variant: "-virt" + image: "alpine:3.20" + - name: archlinux + tag: "latest" + variant: "" + image: "archlinux:latest" + - name: archlinux + tag: "latest" + variant: "-lts" + image: "archlinux:latest" + - name: archlinux + tag: "latest" + variant: "-zen" + image: "archlinux:latest" + - name: centos + tag: "stream10" + image: "quay.io/centos/centos:stream10" + - name: centos + tag: "stream9" + image: "quay.io/centos/centos:stream9" + - name: debian + tag: "13" + image: "debian:13" + - name: debian + tag: "12" + image: "debian:12" + - name: fedora + tag: "rawhide" + image: "registry.fedoraproject.org/fedora:rawhide" + - name: fedora + tag: "43" + image: "registry.fedoraproject.org/fedora:43" + - name: fedora + tag: "42" + image: "registry.fedoraproject.org/fedora:42" + - name: gentoo/stage3 + tag: "latest" + image: "gentoo/stage3:latest" + - name: opensuse/tumbleweed + tag: "latest" + variant: "-default" + image: "registry.opensuse.org/opensuse/tumbleweed:latest" + - name: opensuse/leap + tag: "15.6" + variant: "-default" + image: "registry.opensuse.org/opensuse/leap:15.6" + - name: opensuse/leap + tag: "16.0" + variant: "-default" + image: "registry.opensuse.org/opensuse/leap:16.0" + - name: oraclelinux + tag: "10" + uek: "ol10_UEKR8" + image: "oraclelinux:10" + - name: oraclelinux + tag: "9" + uek: "ol9_UEKR8" + gcc: "gcc-toolset-14" + image: "oraclelinux:9" + - name: oraclelinux + tag: "8" + uek: "ol8_UEKR7" + gcc: "gcc-toolset-11" + image: "oraclelinux:8" + - name: ubuntu + tag: "25.10" + image: "ubuntu:25.10" + - name: ubuntu + tag: "25.04" + image: "ubuntu:25.04" + - name: ubuntu + tag: "24.04" + image: "ubuntu:24.04" + - name: ubuntu + tag: "22.04" + image: "ubuntu:22.04" runs-on: ubuntu-24.04 container: - image: ${{ matrix.distro.url }}${{ matrix.distro.name }}:${{ matrix.distro.tag }} + image: ${{ matrix.distro.image }} steps: - - name: Checkout - if: matrix.distro.name == 'opensuse/leap' && matrix.distro.tag == '15.6' - # openSUSE Leap 15.6 does not have tar in the base image - run: | - zypper --non-interactive install tar gzip - - uses: actions/checkout@v6 - - - name: Install dependencies for Red Hat based distributions - if: matrix.distro.name == 'almalinux' || matrix.distro.name == 'centos' || matrix.distro.name == 'fedora' - # Relax crypto policies to allow RSA signatures - run: | - dnf install -y gawk diffutils elfutils-libelf gcc kernel kernel-devel make openssl patch crypto-policies-scripts - update-crypto-policies --set LEGACY - make install-redhat - - - name: Install dependencies for Oracle Linux - if: matrix.distro.name == 'oraclelinux' - # Relax crypto policies to allow RSA signatures - run: | - dnf config-manager --set-enabled ${{ matrix.distro.uek }} - dnf install -y gawk diffutils elfutils-libelf gcc kernel-uek kernel-uek-devel make openssl patch crypto-policies-scripts - update-crypto-policies --set LEGACY - make install-redhat - if [ -n "${{ matrix.distro.gcc }}" ]; then - echo "build_environment=\"/opt/rh/${{ matrix.distro.gcc }}/enable\"" >> /etc/dkms/framework.conf.d/uek.conf - fi - - - name: Install Alpine dependencies - if: matrix.distro.name == 'alpine' - run: | - apk --no-cache --update add bash gcc linux-headers linux${{ matrix.distro.variant }} linux${{ matrix.distro.variant }}-dev make openssl coreutils patch - make install - - - name: Install Arch Linux dependencies - if: matrix.distro.name == 'archlinux' - run: | - pacman -Syu --noconfirm diffutils gcc make linux${{ matrix.distro.variant }} linux${{ matrix.distro.variant }}-headers openssl patch - make install - - - name: Install Debian dependencies - if: matrix.distro.name == 'debian' - run: | - export DEBIAN_FRONTEND=noninteractive - apt-get update -q - apt-get install -qy make linux-headers-amd64 linux-image-amd64 openssl xz-utils patch - make install-debian - - - name: Install Gentoo Linux dependencies - if: matrix.distro.name == 'gentoo/stage3' - run: | - echo -e "MAKEOPTS=\"-j$(nproc) -l$(nproc)\"\nACCEPT_LICENSE=\"*\"" >> /etc/portage/make.conf - wget --progress=dot:mega -O - https://github.com/gentoo-mirror/gentoo/archive/master.tar.gz | tar -xz && mv gentoo-master /var/db/repos/gentoo - FEATURES="getbinpkg binpkg-ignore-signature parallel-fetch parallel-install pkgdir-index-trusted" USE="-initramfs" emerge --quiet --noreplace -j$(nproc) -l$(nproc) --autounmask-continue --with-bdeps=n '>=sys-kernel/gentoo-kernel-bin-6.6.0' - make install - - - name: Install openSUSE leap dependencies - if: contains(matrix.distro.name, 'opensuse') - run: | - zypper --non-interactive install diffutils elfutils gcc kernel${{ matrix.distro.variant }} kernel${{ matrix.distro.variant }}-devel make openssl patch zstd - make install - - - name: Install Ubuntu dependencies - if: matrix.distro.name == 'ubuntu' - run: | - export DEBIAN_FRONTEND=noninteractive - apt-get update -q - apt-get install -qy gcc make linux-headers-generic linux-image-generic openssl shim-signed patch - make install-debian - - - name: Run tests - run: | - for moddir in /usr/lib/modules/ /lib/modules/; do - if [ -e "$moddir" ]; then - kernels=$(find "$moddir" -maxdepth 1 -type d -exec basename {} \;) - break + - name: Checkout + if: >- + matrix.distro.name == 'opensuse/leap' && + matrix.distro.tag == '15.6' + # openSUSE Leap 15.6 does not have tar in the base image + run: | + zypper --non-interactive install tar gzip + - uses: actions/checkout@v6 + + - name: Install dependencies for Red Hat based distributions + if: >- + matrix.distro.name == 'almalinux' || + matrix.distro.name == 'centos' || + matrix.distro.name == 'fedora' + # Relax crypto policies to allow RSA signatures + run: | + dnf install -y \ + gawk diffutils elfutils-libelf gcc \ + kernel kernel-devel make \ + openssl patch crypto-policies-scripts + update-crypto-policies --set LEGACY + make install-redhat + + - name: Install dependencies for Oracle Linux + if: matrix.distro.name == 'oraclelinux' + # Relax crypto policies to allow RSA signatures + run: | + uek='${{ matrix.distro.uek }}' + dnf config-manager --set-enabled "${uek}" + dnf install -y \ + gawk diffutils elfutils-libelf gcc \ + kernel-uek kernel-uek-devel make \ + openssl patch crypto-policies-scripts + update-crypto-policies --set LEGACY + make install-redhat + if [ -n "${{ matrix.distro.gcc }}" ]; then + build_environment="/opt/rh/${{ matrix.distro.gcc }}/enable" + echo "build_environment=\"${build_environment}\"" \ + >> /etc/dkms/framework.conf.d/uek.conf + fi + + - name: Install Alpine dependencies + if: matrix.distro.name == 'alpine' + run: | + variant='${{ matrix.distro.variant }}' + apk --no-cache --update add \ + bash gcc linux-headers \ + "linux${variant}" "linux${variant}-dev" \ + make openssl coreutils patch + make install + + - name: Install Arch Linux dependencies + if: matrix.distro.name == 'archlinux' + run: | + variant='${{ matrix.distro.variant }}' + pacman -Syu --noconfirm \ + diffutils gcc make \ + "linux${variant}" "linux${variant}-headers" \ + openssl patch + make install + + - name: Install Debian dependencies + if: matrix.distro.name == 'debian' + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update -q + apt-get install -qy \ + make \ + linux-headers-amd64 linux-image-amd64 \ + openssl xz-utils patch + make install-debian + + - name: Install Gentoo Linux dependencies + if: matrix.distro.name == 'gentoo/stage3' + run: | + nproc_val="$(nproc)" + echo "MAKEOPTS=\"-j${nproc_val} -l${nproc_val}\"" \ + >> /etc/portage/make.conf + echo "ACCEPT_LICENSE=\"*\"" >> /etc/portage/make.conf + + gentoo_repo_url='https://github.com/gentoo-mirror/gentoo/archive/'\ + 'master.tar.gz' + wget --progress=dot:mega -O - "${gentoo_repo_url}" | tar -xz + mv gentoo-master /var/db/repos/gentoo + + FEATURES='getbinpkg binpkg-ignore-signature parallel-fetch' \ + USE='-initramfs' \ + emerge --quiet --noreplace \ + -j"${nproc_val}" -l"${nproc_val}" \ + --autounmask-continue --with-bdeps=n \ + '>=sys-kernel/gentoo-kernel-bin-6.6.0' + make install + + - name: Install openSUSE leap dependencies + if: contains(matrix.distro.name, 'opensuse') + run: | + variant='${{ matrix.distro.variant }}' + zypper --non-interactive install \ + diffutils elfutils gcc \ + "kernel${variant}" "kernel${variant}-devel" \ + make openssl patch zstd + make install + + - name: Install Ubuntu dependencies + if: matrix.distro.name == 'ubuntu' + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update -q + apt-get install -qy \ + gcc make \ + linux-headers-generic linux-image-generic \ + openssl shim-signed patch + make install-debian + + - name: Run tests + run: | + for moddir in /usr/lib/modules/ /lib/modules/; do + if [ -e "${moddir}" ]; then + kernels="$( + find "${moddir}" -maxdepth 1 -type d \ + -exec basename {} \; + )" + break fi - done + done - # There should be two entries - "modules" and the kernel we installed - if [ $(echo "${kernels}" | wc -l) -ne 2 ]; then + # There should be two entries - "modules" and the kernel we installed + if [ "$(printf '%s\n' "${kernels}" | wc -l)" -ne 2 ]; then echo >&2 "Error: invalid number of kernels installed" - fi + fi - KERNEL_VER=$(echo "${kernels}" | tail -n1) - if [ -z "${KERNEL_VER}" ] ; then + KERNEL_VER="$(printf '%s\n' "${kernels}" | tail -n 1)" + if [ -z "${KERNEL_VER}" ] ; then echo >&2 "Error: no kernel package found" exit 1 - fi + fi - echo "Found kernel ${KERNEL_VER}" - export KERNEL_VER + echo "Found kernel ${KERNEL_VER}" + export KERNEL_VER - echo "Module search paths" - for depmod in /etc/depmod.d/ /usr/lib/depmod.d/ /lib/depmod.d/; do - [ -e "$depmod" ] && grep -r ^search "$depmod" || true - done + echo "Module search paths" + for depmod in /etc/depmod.d/ /usr/lib/depmod.d/ /lib/depmod.d/; do + [ -e "${depmod}" ] && grep -r ^search "${depmod}" || true + done - # Run all tests - ./run_test.sh + # Run all tests + ./run_test.sh - make uninstall + make uninstall From e4dce5ad0d86999184d21af345f8b0c0d82da707 Mon Sep 17 00:00:00 2001 From: rezky_nightky Date: Sat, 10 Jan 2026 01:35:02 +0700 Subject: [PATCH 2/2] ci: restore workflows to upstream style Author: rezky_nightky Repository: dkms Branch: pr/ci-tooling Signing: GPG (4B65AAC2) HashAlgo: BLAKE3 [ Block Metadata ] BlockHash: 720b7d737e205ae56df9366ba97c7208cd46a9e9d9b18d4d6f245ca59b23e775 PrevHash: a1afbf1c5f14c341956276b162e43ac622a813cfbdd0e3090e4a56ecb99e007f PatchHash: 524e0098616e26f585f9ea05b1bb45625246e7d3100a9c3b1767befe6f92b3bd FilesChanged: 2 Lines: +115 / -242 Timestamp: 2026-01-09T18:35:03Z Signature1: 44d195d95c491db0a14ab9211500e79d910c1071bd771be53e2c7e5df8b554fe Signature2: 1b1de9d7c55302cb9b52d8fe36e60a745497ccdca1aae14ae8138142974f9634 --- .github/workflows/shellcheck.yml | 3 +- .github/workflows/tests.yml | 372 ++++++++++--------------------- 2 files changed, 124 insertions(+), 251 deletions(-) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 69352655..3ef7afbb 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -1,7 +1,6 @@ ---- name: Shellcheck -'on': +on: push: pull_request: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fa61c7c7..380cb0c6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,7 +1,6 @@ ---- name: Run tests -'on': +on: # Build at 23:00 every Sunday schedule: - cron: "0 23 * * 1" @@ -15,264 +14,139 @@ jobs: strategy: matrix: distro: - - name: almalinux - tag: "10" - image: "almalinux:10" - - name: almalinux - tag: "9" - image: "almalinux:9" - - name: almalinux - tag: "8" - image: "almalinux:8" - - name: alpine - tag: "3.22" - variant: "-lts" - image: "alpine:3.22" - - name: alpine - tag: "3.22" - variant: "-virt" - image: "alpine:3.22" - - name: alpine - tag: "3.21" - variant: "-lts" - image: "alpine:3.21" - - name: alpine - tag: "3.21" - variant: "-virt" - image: "alpine:3.21" - - name: alpine - tag: "3.20" - variant: "-lts" - image: "alpine:3.20" - - name: alpine - tag: "3.20" - variant: "-virt" - image: "alpine:3.20" - - name: archlinux - tag: "latest" - variant: "" - image: "archlinux:latest" - - name: archlinux - tag: "latest" - variant: "-lts" - image: "archlinux:latest" - - name: archlinux - tag: "latest" - variant: "-zen" - image: "archlinux:latest" - - name: centos - tag: "stream10" - image: "quay.io/centos/centos:stream10" - - name: centos - tag: "stream9" - image: "quay.io/centos/centos:stream9" - - name: debian - tag: "13" - image: "debian:13" - - name: debian - tag: "12" - image: "debian:12" - - name: fedora - tag: "rawhide" - image: "registry.fedoraproject.org/fedora:rawhide" - - name: fedora - tag: "43" - image: "registry.fedoraproject.org/fedora:43" - - name: fedora - tag: "42" - image: "registry.fedoraproject.org/fedora:42" - - name: gentoo/stage3 - tag: "latest" - image: "gentoo/stage3:latest" - - name: opensuse/tumbleweed - tag: "latest" - variant: "-default" - image: "registry.opensuse.org/opensuse/tumbleweed:latest" - - name: opensuse/leap - tag: "15.6" - variant: "-default" - image: "registry.opensuse.org/opensuse/leap:15.6" - - name: opensuse/leap - tag: "16.0" - variant: "-default" - image: "registry.opensuse.org/opensuse/leap:16.0" - - name: oraclelinux - tag: "10" - uek: "ol10_UEKR8" - image: "oraclelinux:10" - - name: oraclelinux - tag: "9" - uek: "ol9_UEKR8" - gcc: "gcc-toolset-14" - image: "oraclelinux:9" - - name: oraclelinux - tag: "8" - uek: "ol8_UEKR7" - gcc: "gcc-toolset-11" - image: "oraclelinux:8" - - name: ubuntu - tag: "25.10" - image: "ubuntu:25.10" - - name: ubuntu - tag: "25.04" - image: "ubuntu:25.04" - - name: ubuntu - tag: "24.04" - image: "ubuntu:24.04" - - name: ubuntu - tag: "22.04" - image: "ubuntu:22.04" + - {name: "almalinux", tag: "10"} + - {name: "almalinux", tag: "9"} + - {name: "almalinux", tag: "8"} + - {name: "alpine", tag: "3.22", variant: "-lts"} + - {name: "alpine", tag: "3.22", variant: "-virt"} + - {name: "alpine", tag: "3.21", variant: "-lts"} + - {name: "alpine", tag: "3.21", variant: "-virt"} + - {name: "alpine", tag: "3.20", variant: "-lts"} + - {name: "alpine", tag: "3.20", variant: "-virt"} + - {name: "archlinux", tag: "latest"} + - {name: "archlinux", tag: "latest", variant: "-lts"} + - {name: "archlinux", tag: "latest", variant: "-zen"} + - {name: "centos", tag: "stream10", url: "quay.io/centos/"} + - {name: "centos", tag: "stream9", url: "quay.io/centos/"} + - {name: "debian", tag: "13"} + - {name: "debian", tag: "12"} + - {name: "fedora", tag: "rawhide", url: "registry.fedoraproject.org/"} + - {name: "fedora", tag: "43", url: "registry.fedoraproject.org/"} + - {name: "fedora", tag: "42", url: "registry.fedoraproject.org/"} + - {name: "gentoo/stage3", tag: "latest"} + - {name: "opensuse/tumbleweed", tag: "latest", variant: "-default", url: "registry.opensuse.org/"} + - {name: "opensuse/leap", tag: "15.6", variant: "-default", url: "registry.opensuse.org/"} + - {name: "opensuse/leap", tag: "16.0", variant: "-default", url: "registry.opensuse.org/"} + - {name: "oraclelinux", tag: "10", uek: "ol10_UEKR8"} + - {name: "oraclelinux", tag: "9", uek: "ol9_UEKR8", gcc: "gcc-toolset-14"} + - {name: "oraclelinux", tag: "8", uek: "ol8_UEKR7", gcc: "gcc-toolset-11"} + - {name: "ubuntu", tag: "25.10"} + - {name: "ubuntu", tag: "25.04"} + - {name: "ubuntu", tag: "24.04"} + - {name: "ubuntu", tag: "22.04"} runs-on: ubuntu-24.04 container: - image: ${{ matrix.distro.image }} + image: ${{ matrix.distro.url }}${{ matrix.distro.name }}:${{ matrix.distro.tag }} steps: - - name: Checkout - if: >- - matrix.distro.name == 'opensuse/leap' && - matrix.distro.tag == '15.6' - # openSUSE Leap 15.6 does not have tar in the base image - run: | - zypper --non-interactive install tar gzip - - uses: actions/checkout@v6 - - - name: Install dependencies for Red Hat based distributions - if: >- - matrix.distro.name == 'almalinux' || - matrix.distro.name == 'centos' || - matrix.distro.name == 'fedora' - # Relax crypto policies to allow RSA signatures - run: | - dnf install -y \ - gawk diffutils elfutils-libelf gcc \ - kernel kernel-devel make \ - openssl patch crypto-policies-scripts - update-crypto-policies --set LEGACY - make install-redhat - - - name: Install dependencies for Oracle Linux - if: matrix.distro.name == 'oraclelinux' - # Relax crypto policies to allow RSA signatures - run: | - uek='${{ matrix.distro.uek }}' - dnf config-manager --set-enabled "${uek}" - dnf install -y \ - gawk diffutils elfutils-libelf gcc \ - kernel-uek kernel-uek-devel make \ - openssl patch crypto-policies-scripts - update-crypto-policies --set LEGACY - make install-redhat - if [ -n "${{ matrix.distro.gcc }}" ]; then - build_environment="/opt/rh/${{ matrix.distro.gcc }}/enable" - echo "build_environment=\"${build_environment}\"" \ - >> /etc/dkms/framework.conf.d/uek.conf - fi - - - name: Install Alpine dependencies - if: matrix.distro.name == 'alpine' - run: | - variant='${{ matrix.distro.variant }}' - apk --no-cache --update add \ - bash gcc linux-headers \ - "linux${variant}" "linux${variant}-dev" \ - make openssl coreutils patch - make install - - - name: Install Arch Linux dependencies - if: matrix.distro.name == 'archlinux' - run: | - variant='${{ matrix.distro.variant }}' - pacman -Syu --noconfirm \ - diffutils gcc make \ - "linux${variant}" "linux${variant}-headers" \ - openssl patch - make install - - - name: Install Debian dependencies - if: matrix.distro.name == 'debian' - run: | - export DEBIAN_FRONTEND=noninteractive - apt-get update -q - apt-get install -qy \ - make \ - linux-headers-amd64 linux-image-amd64 \ - openssl xz-utils patch - make install-debian - - - name: Install Gentoo Linux dependencies - if: matrix.distro.name == 'gentoo/stage3' - run: | - nproc_val="$(nproc)" - echo "MAKEOPTS=\"-j${nproc_val} -l${nproc_val}\"" \ - >> /etc/portage/make.conf - echo "ACCEPT_LICENSE=\"*\"" >> /etc/portage/make.conf - - gentoo_repo_url='https://github.com/gentoo-mirror/gentoo/archive/'\ - 'master.tar.gz' - wget --progress=dot:mega -O - "${gentoo_repo_url}" | tar -xz - mv gentoo-master /var/db/repos/gentoo - - FEATURES='getbinpkg binpkg-ignore-signature parallel-fetch' \ - USE='-initramfs' \ - emerge --quiet --noreplace \ - -j"${nproc_val}" -l"${nproc_val}" \ - --autounmask-continue --with-bdeps=n \ - '>=sys-kernel/gentoo-kernel-bin-6.6.0' - make install - - - name: Install openSUSE leap dependencies - if: contains(matrix.distro.name, 'opensuse') - run: | - variant='${{ matrix.distro.variant }}' - zypper --non-interactive install \ - diffutils elfutils gcc \ - "kernel${variant}" "kernel${variant}-devel" \ - make openssl patch zstd - make install - - - name: Install Ubuntu dependencies - if: matrix.distro.name == 'ubuntu' - run: | - export DEBIAN_FRONTEND=noninteractive - apt-get update -q - apt-get install -qy \ - gcc make \ - linux-headers-generic linux-image-generic \ - openssl shim-signed patch - make install-debian - - - name: Run tests - run: | - for moddir in /usr/lib/modules/ /lib/modules/; do - if [ -e "${moddir}" ]; then - kernels="$( - find "${moddir}" -maxdepth 1 -type d \ - -exec basename {} \; - )" - break + - name: Checkout + if: matrix.distro.name == 'opensuse/leap' && matrix.distro.tag == '15.6' + # openSUSE Leap 15.6 does not have tar in the base image + run: | + zypper --non-interactive install tar gzip + - uses: actions/checkout@v6 + + - name: Install dependencies for Red Hat based distributions + if: matrix.distro.name == 'almalinux' || matrix.distro.name == 'centos' || matrix.distro.name == 'fedora' + # Relax crypto policies to allow RSA signatures + run: | + dnf install -y gawk diffutils elfutils-libelf gcc kernel kernel-devel make openssl patch crypto-policies-scripts + update-crypto-policies --set LEGACY + make install-redhat + + - name: Install dependencies for Oracle Linux + if: matrix.distro.name == 'oraclelinux' + # Relax crypto policies to allow RSA signatures + run: | + dnf config-manager --set-enabled ${{ matrix.distro.uek }} + dnf install -y gawk diffutils elfutils-libelf gcc kernel-uek kernel-uek-devel make openssl patch crypto-policies-scripts + update-crypto-policies --set LEGACY + make install-redhat + if [ -n "${{ matrix.distro.gcc }}" ]; then + echo "build_environment=\"/opt/rh/${{ matrix.distro.gcc }}/enable\"" >> /etc/dkms/framework.conf.d/uek.conf + fi + + - name: Install Alpine dependencies + if: matrix.distro.name == 'alpine' + run: | + apk --no-cache --update add bash gcc linux-headers linux${{ matrix.distro.variant }} linux${{ matrix.distro.variant }}-dev make openssl coreutils patch + make install + + - name: Install Arch Linux dependencies + if: matrix.distro.name == 'archlinux' + run: | + pacman -Syu --noconfirm diffutils gcc make linux${{ matrix.distro.variant }} linux${{ matrix.distro.variant }}-headers openssl patch + make install + + - name: Install Debian dependencies + if: matrix.distro.name == 'debian' + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update -q + apt-get install -qy make linux-headers-amd64 linux-image-amd64 openssl xz-utils patch + make install-debian + + - name: Install Gentoo Linux dependencies + if: matrix.distro.name == 'gentoo/stage3' + run: | + echo -e "MAKEOPTS=\"-j$(nproc) -l$(nproc)\"\nACCEPT_LICENSE=\"*\"" >> /etc/portage/make.conf + wget --progress=dot:mega -O - https://github.com/gentoo-mirror/gentoo/archive/master.tar.gz | tar -xz && mv gentoo-master /var/db/repos/gentoo + FEATURES="getbinpkg binpkg-ignore-signature parallel-fetch parallel-install pkgdir-index-trusted" USE="-initramfs" emerge --quiet --noreplace -j$(nproc) -l$(nproc) --autounmask-continue --with-bdeps=n '>=sys-kernel/gentoo-kernel-bin-6.6.0' + make install + + - name: Install openSUSE leap dependencies + if: contains(matrix.distro.name, 'opensuse') + run: | + zypper --non-interactive install diffutils elfutils gcc kernel${{ matrix.distro.variant }} kernel${{ matrix.distro.variant }}-devel make openssl patch zstd + make install + + - name: Install Ubuntu dependencies + if: matrix.distro.name == 'ubuntu' + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update -q + apt-get install -qy gcc make linux-headers-generic linux-image-generic openssl shim-signed patch + make install-debian + + - name: Run tests + run: | + for moddir in /usr/lib/modules/ /lib/modules/; do + if [ -e "$moddir" ]; then + kernels=$(find "$moddir" -maxdepth 1 -type d -exec basename {} \;) + break fi - done + done - # There should be two entries - "modules" and the kernel we installed - if [ "$(printf '%s\n' "${kernels}" | wc -l)" -ne 2 ]; then + # There should be two entries - "modules" and the kernel we installed + if [ $(echo "${kernels}" | wc -l) -ne 2 ]; then echo >&2 "Error: invalid number of kernels installed" - fi + fi - KERNEL_VER="$(printf '%s\n' "${kernels}" | tail -n 1)" - if [ -z "${KERNEL_VER}" ] ; then + KERNEL_VER=$(echo "${kernels}" | tail -n1) + if [ -z "${KERNEL_VER}" ] ; then echo >&2 "Error: no kernel package found" exit 1 - fi + fi - echo "Found kernel ${KERNEL_VER}" - export KERNEL_VER + echo "Found kernel ${KERNEL_VER}" + export KERNEL_VER - echo "Module search paths" - for depmod in /etc/depmod.d/ /usr/lib/depmod.d/ /lib/depmod.d/; do - [ -e "${depmod}" ] && grep -r ^search "${depmod}" || true - done + echo "Module search paths" + for depmod in /etc/depmod.d/ /usr/lib/depmod.d/ /lib/depmod.d/; do + [ -e "$depmod" ] && grep -r ^search "$depmod" || true + done - # Run all tests - ./run_test.sh + # Run all tests + ./run_test.sh - make uninstall + make uninstall