]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Support Debian DKMS builds
authorAntonio Russo <antonio.e.russo@gmail.com>
Sat, 26 May 2018 17:56:24 +0000 (13:56 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 26 May 2018 17:56:24 +0000 (10:56 -0700)
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 <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Antonio Russo <antonio.e.russo@gmail.com>
Closes #7358
Closes #7540
Closes #7554

scripts/dkms.mkconf

index 35da3b69c8089a58cf62c324f9e2c9ab44511a46..fbbdc5cdb1b3756c2f5dd309e4af10aa8d6abbc5 100755 (executable)
@@ -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}