Bug#985005: unblock: dkms/2.8.4-3
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
Please unblock package dkms
I've just added a patch to dkms that exports the compiler used by the
kernel headers (i.e. some gcc-X) as CC for usage by non-Kbuild module
build systems which would otherwise attempt to use CC=gcc. That usually
fails due to gcc not being available (the kernel headers only depend on
gcc-X) unless build-essential is installed.
This fixes three RC bugs in -dkms packages (which I've now downgraded to
important, assuming the improved dkms reaches bullseye):
#945506, #946497, #984862
I've tested this by rechecking all *-dkms packages in my local piuparts
instance which attempts to build the module for linux-headers-amd64.
There were no regressions, but three more modules building sucessfully.
unblock dkms/2.8.4-3
diff --git a/debian/changelog b/debian/changelog
index 1743dcc..dfa7594 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+dkms (2.8.4-3) unstable; urgency=medium
+
+ [ Gianfranco Costamagna ]
+ * Team upload.
+
+ [ Andreas Beckmann ]
+ * Export the CC variable from .kernelvariables in the kernel source to allow
+ module build systems use the kernel's compiler also outside of Kbuild.
+ (Closes: #984929)
+
+ -- Andreas Beckmann <anbe@debian.org> Wed, 10 Mar 2021 12:11:42 +0100
+
dkms (2.8.4-2) unstable; urgency=medium
[ Gianfranco Costamagna ]
diff --git a/debian/patches/export-CC.patch b/debian/patches/export-CC.patch
new file mode 100644
index 0000000..1ae7e70
--- /dev/null
+++ b/debian/patches/export-CC.patch
@@ -0,0 +1,20 @@
+Description: export CC pointing to the kernel's compiler
+ export the CC variable from .kernelvariables in the kernel source to allow
+ module build systems use the kernel's compiler also outside of Kbuild
+Author: Andreas Beckmann <anbe@debian.org>
+
+--- dkms-2.8.4.orig/dkms
++++ dkms-2.8.4/dkms
+@@ -1166,6 +1166,12 @@ prepare_kernel()
+ esac
+ }
+
++ 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
++
+ [[ $no_prepare_kernel ]] && return
+
+ if [[ (! ( $(VER $1) < $(VER 2.6.5) ) || -d /etc/SuSEconfig) && \
diff --git a/debian/patches/series b/debian/patches/series
index f3c2a3b..aa7de72 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
do-not-load-modules.patch
+export-CC.patch
Reply to: