aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/dkms.mkconf
diff options
context:
space:
mode:
authorAntonio Russo <[email protected]>2018-05-26 13:56:24 -0400
committerBrian Behlendorf <[email protected]>2018-05-26 10:56:24 -0700
commit3e5300e0ed3c4b49e3b0dab7daded1e3bfaaded7 (patch)
treeaf6f462360255e47acbb8f731e9ef0af63357f52 /scripts/dkms.mkconf
parent561ba8d1b1bb1f74c0182fb95161adfec99e27a1 (diff)
Support Debian DKMS builds
scripts/dkms.mkconf calls configure with `--with-linux=${kernel_source_dir}`, but Debian puts it kernel source at `/lib/modules/<version>/source`. This patch adds the same logic to the DKMS file produced by `scripts/dkms.mkconf` that Debian has shipped in its official ZFS packaging: at DKMS build time, it checks if the system is a Debian system, and adjusts the path accordingly. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Antonio Russo <[email protected]> Closes #7358 Closes #7540 Closes #7554
Diffstat (limited to 'scripts/dkms.mkconf')
-rwxr-xr-xscripts/dkms.mkconf17
1 files changed, 16 insertions, 1 deletions
diff --git a/scripts/dkms.mkconf b/scripts/dkms.mkconf
index 35da3b69c..fbbdc5cdb 100755
--- a/scripts/dkms.mkconf
+++ b/scripts/dkms.mkconf
@@ -25,7 +25,22 @@ PACKAGE_CONFIG="${pkgcfg}"
PRE_BUILD="configure
--prefix=/usr
--with-config=kernel
- --with-linux=\${kernel_source_dir}
+ --with-linux=\$(
+ case \`lsb_release -is\` in
+ (Debian|Devuan)
+ if [[ -e \${kernel_source_dir/%build/source} ]]
+ then
+ echo \${kernel_source_dir/%build/source}
+ else
+ # A kpkg exception for Proxmox 2.0
+ echo \${kernel_source_dir}
+ fi
+ ;;
+ (*)
+ echo \${kernel_source_dir}
+ ;;
+ esac
+ )
--with-linux-obj=\${kernel_source_dir}
--with-spl=\${source_tree}/spl-\${PACKAGE_VERSION}
--with-spl-obj=\${dkms_tree}/spl/\${PACKAGE_VERSION}/\${kernelver}/\${arch}