diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b10f85c6..d5f590f2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,6 +25,7 @@ jobs: - {name: "centos", tag: "7"} - {name: "almalinux", tag: "9"} - {name: "almalinux", tag: "8"} + - {name: "debian", tag: "12"} - {name: "debian", tag: "11"} - {name: "debian", tag: "10"} - {name: "ubuntu", tag: "22.04"} @@ -61,7 +62,7 @@ jobs: if: matrix.distro.name == 'debian' run: | apt-get update -q - apt-get install -qy gcc make linux-headers-amd64 linux-image-amd64 openssl + apt-get install -qy make linux-headers-amd64 linux-image-amd64 openssl - name: Install Ubuntu dependencies if: matrix.distro.name == 'ubuntu' diff --git a/dkms.in b/dkms.in index 7846662a..ef94ad19 100644 --- a/dkms.in +++ b/dkms.in @@ -287,6 +287,9 @@ setup_kernels_arches() fi fi fi + if [[ ! $arch ]]; then + die 12 $"Could not determine architecture." + fi fi # If only one arch is specified, make it so for all the kernels @@ -1061,7 +1064,19 @@ prepare_build() $"Check $build_dir for more information." done + if [ -f "$kernel_source_dir/.kernelvariables" ]; then + export CC=$(echo -e "show-%:\n\t@echo \$(\$*)\ninclude $kernel_source_dir/.kernelvariables" | make -f - show-CC) + else + unset CC + fi + if [[ -e "${kernel_config}" ]]; then + local cc=$(sed -n 's|^CONFIG_CC_VERSION_TEXT="\([^ ]*\) .*"|\1|p' "${kernel_config}") + if command -v "$cc" >/dev/null; then + export CC="$cc" + export KERNEL_CC="$cc" + fi + if grep -q 'CONFIG_CC_IS_CLANG=y' "${kernel_config}"; then local cc=clang if command -v "$cc" >/dev/null; then @@ -1094,12 +1109,6 @@ actual_build() echo $"" echo $"Building module:" - if [ -f "$kernel_source_dir/.kernelvariables" ]; then - export CC=$(echo -e "show-%:\n\t@echo \$(\$*)\ninclude $kernel_source_dir/.kernelvariables" | make -f - show-CC) - else - unset CC - fi - invoke_command "$clean" "Cleaning build area" background echo $"DKMS make.log for $module-$module_version for kernel $kernelver ($arch)" >> "$build_log" date >> "$build_log" diff --git a/run_test.sh b/run_test.sh index 2f47b069..aed425c4 100755 --- a/run_test.sh +++ b/run_test.sh @@ -678,7 +678,7 @@ echo "Running dkms autoinstall for a kernel without headers installed (expected run_with_expected_error 11 dkms autoinstall -k "${KERNEL_VER}-noheaders" << EOF Error! Your kernel headers for kernel ${KERNEL_VER}-noheaders cannot be found at /lib/modules/${KERNEL_VER}-noheaders/build or /lib/modules/${KERNEL_VER}-noheaders/source. Please install the linux-headers-${KERNEL_VER}-noheaders package or use the --kernelsourcedir option to tell DKMS where it's located. -dkms autoinstall on ${KERNEL_VER}-noheaders/x86_64 failed for dkms_test(1) +dkms autoinstall on ${KERNEL_VER}-noheaders/${KERNEL_ARCH} failed for dkms_test(1) Error! One or more modules failed to install during autoinstall. Refer to previous errors for more information. EOF