Bug#830670: mkbmdeb lacks support for Provides:

2016-10-09 Thread Adel Belhouane
Package: dkms
Version: 2.2.1.0+git20160527-1
Followup-For: Bug #830670

Well I wasn't thorough and forgot a similar change in
/etc/dkms/template-dkms-mkbmdeb/debian/rules and the resulting module
was empty

here are the updated patches for version 2.2.1.0+git20160527-1, sorry.

diff -urN dkms-2.2.1.0+git20160527.orig/debian/patches/0004-mkbmdeb-support-for-lean-binary-package-with-only-th.patch dkms-2.2.1.0+git20160527/debian/patches/0004-mkbmdeb-support-for-lean-binary-package-with-only-th.patch
--- dkms-2.2.1.0+git20160527.orig/debian/patches/0004-mkbmdeb-support-for-lean-binary-package-with-only-th.patch	2016-08-23 08:24:29.0 +0200
+++ dkms-2.2.1.0+git20160527/debian/patches/0004-mkbmdeb-support-for-lean-binary-package-with-only-th.patch	2016-10-09 07:40:52.278505224 +0200
@@ -87,7 +87,7 @@
 +	die 7 $"There was a problem creating your ${create_type}."
 +	echo $""
 +	echo $"DKMS: mk${create_type} completed."
-+	invoke_command "mv '$temp_dir/${debian_package}-dkms-bin_${module_version}_${debian_build_arch}.deb' '$deb_basedir'" "Moving built files to $deb_basedir"
++	invoke_command "mv '$temp_dir/${debian_package}-modules-${kernelver}_${module_version}_${debian_build_arch}.deb' '$deb_basedir'" "Moving built files to $deb_basedir"
  ;;
  esac
  popd > /dev/null 2>&1
@@ -187,7 +187,7 @@
 ===
 --- /dev/null
 +++ dkms/template-dkms-mkbmdeb/debian/control
-@@ -0,0 +1,13 @@
+@@ -0,0 +1,14 @@
 +Source: DEBIAN_PACKAGE-dkms-bin
 +Section: misc
 +Priority: optional
@@ -195,9 +195,10 @@
 +Build-Depends: debhelper (>= 7), dkms
 +Standards-Version: 3.8.1
 +
-+Package: DEBIAN_PACKAGE-dkms-bin
++Package: DEBIAN_PACKAGE-modules-KERNEL_VERSION
 +Architecture: DEBIAN_BUILD_ARCH
 +Depends: ${misc:Depends}, linux-image-KERNEL_VERSION
++Provides: DEBIAN_PACKAGE-modules
 +Description: DEBIAN_PACKAGE binary drivers for linux-image-KERNEL_VERSION
 + This package contains DEBIAN_PACKAGE drivers for the KERNEL_VERSION Linux kernel,
 + built from DEBIAN_PACKAGE-dkms for the DEBIAN_BUILD_ARCH architecture.
@@ -212,7 +213,7 @@
 ===
 --- /dev/null
 +++ dkms/template-dkms-mkbmdeb/debian/rules
-@@ -0,0 +1,57 @@
+@@ -0,0 +1,58 @@
 +#!/usr/bin/make -f
 +# -*- makefile -*-
 +
@@ -222,6 +223,7 @@
 +DEB_NAME=DEBIAN_PACKAGE
 +NAME=MODULE_NAME
 +VERSION=MODULE_VERSION
++KVER=KERNEL_VERSION
 +
 +configure: configure-stamp
 +configure-stamp:
@@ -248,7 +250,7 @@
 +	dh_testroot
 +	dh_prep
 +	dh_installdirs
-+	$(MAKE) DESTDIR=$(CURDIR)/debian/$(DEB_NAME)-dkms-bin NAME=$(NAME) VERSION=$(VERSION) install
++	$(MAKE) DESTDIR=$(CURDIR)/debian/$(DEB_NAME)-modules-$(KVER) NAME=$(NAME) VERSION=$(VERSION) install
 +
 +binary-arch: build install
 +
diff -urN /etc/dkms.orig/template-dkms-mkbmdeb/debian/control /etc/dkms/template-dkms-mkbmdeb/debian/control
--- /etc/dkms.orig/template-dkms-mkbmdeb/debian/control	2016-10-09 05:14:35.480762368 +0200
+++ /etc/dkms/template-dkms-mkbmdeb/debian/control	2016-10-09 07:35:06.156543566 +0200
@@ -5,9 +5,10 @@
 Build-Depends: debhelper (>= 7), dkms
 Standards-Version: 3.8.1
 
-Package: DEBIAN_PACKAGE-dkms-bin
+Package: DEBIAN_PACKAGE-modules-KERNEL_VERSION
 Architecture: DEBIAN_BUILD_ARCH
 Depends: ${misc:Depends}, linux-image-KERNEL_VERSION
+Provides: DEBIAN_PACKAGE-modules
 Description: DEBIAN_PACKAGE binary drivers for linux-image-KERNEL_VERSION
  This package contains DEBIAN_PACKAGE drivers for the KERNEL_VERSION Linux kernel,
  built from DEBIAN_PACKAGE-dkms for the DEBIAN_BUILD_ARCH architecture.
diff -urN /etc/dkms.orig/template-dkms-mkbmdeb/debian/rules /etc/dkms/template-dkms-mkbmdeb/debian/rules
--- /etc/dkms.orig/template-dkms-mkbmdeb/debian/rules	2016-07-06 01:12:45.0 +0200
+++ /etc/dkms/template-dkms-mkbmdeb/debian/rules	2016-10-09 07:35:53.644812707 +0200
@@ -7,6 +7,7 @@
 DEB_NAME=DEBIAN_PACKAGE
 NAME=MODULE_NAME
 VERSION=MODULE_VERSION
+KVER=KERNEL_VERSION
 
 configure: configure-stamp
 configure-stamp:
@@ -33,7 +34,7 @@
 	dh_testroot
 	dh_prep
 	dh_installdirs
-	$(MAKE) DESTDIR=$(CURDIR)/debian/$(DEB_NAME)-dkms-bin NAME=$(NAME) VERSION=$(VERSION) install
+	$(MAKE) DESTDIR=$(CURDIR)/debian/$(DEB_NAME)-modules-$(KVER) NAME=$(NAME) VERSION=$(VERSION) install
 
 binary-arch: build install
 
--- /usr/sbin/dkms.orig	2016-08-23 08:24:38.0 +0200
+++ /usr/sbin/dkms	2016-08-23 08:24:38.0 +0200
@@ -3119,7 +3119,7 @@
 	die 7 $"There was a problem creating your ${create_type}."
 	echo $""
 	echo $"DKMS: mk${create_type} completed."
-	invoke_command "mv '$temp_dir/${debian_package}-dkms-bin_${module_version}_${debian_build_arch}.deb' '$deb_basedir'" "Moving built files to $deb_basedir"
+	invoke_command "mv '$temp_dir/${debian_package}-modules-${kernelver}_${module_version}_${debian_build_arch}.deb' '$deb_basedir'" "Moving built files to $deb_basedir"
 ;;
 esac
 popd > /dev/null 2>&1


Bug#830670: mkbmdeb lacks support for Provides:

2016-10-08 Thread Adel Belhouane
Package: dkms
Version: 2.2.1.0+git20160527-1
Followup-For: Bug #830670

Hello,

I found an other problem with the current usage of dkms mkbmdeb: I
can't install the same package for more than one kernel because
the package's name doesn't depend on the kernel version.

Since there's also this bug, I'm killing two birds with one stone.

With this small patch:
- the built package is renamed from DEBIAN_PACKAGE-dkms-bin to
  DEBIAN_PACKAGE-modules-KERNEL_VERSION allowing concurrently
  installed versions.
- it provides package DEBIAN_PACKAGE-modules hopefully closing
  this bug.

Here's the diff to the debian patch file (dkms-source.diff), but since
it's all text, I provide a second diff to patch the installed dkms
package if an user wants to try it: patch -d / -p0 < dkms.diff


-- System Information:
Debian Release: stretch/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'testing'), (490, 'stable'), (360, 
'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages dkms depends on:
ii  build-essential12.2
ii  coreutils  8.25-2
ii  dpkg-dev   1.18.10
ii  gcc4:6.1.1-1
ii  kmod   22-1.1
ii  make-guile [make]  4.1-9
ii  patch  2.7.5-1

Versions of packages dkms recommends:
ii  fakeroot  1.21-1
ii  menu  2.1.47
ii  pseudo [fakeroot] 1.7.5-5
ii  sudo  1.8.17p1-2

Versions of packages dkms suggests:
pn  python3-apport  



--- dkms-2.2.1.0+git20160527.orig/debian/patches/0004-mkbmdeb-support-for-lean-binary-package-with-only-th.patch	2016-08-23 08:24:29.0 +0200
+++ dkms-2.2.1.0+git20160527/debian/patches/0004-mkbmdeb-support-for-lean-binary-package-with-only-th.patch	2016-10-09 03:40:38.160812629 +0200
@@ -87,7 +87,7 @@
 +	die 7 $"There was a problem creating your ${create_type}."
 +	echo $""
 +	echo $"DKMS: mk${create_type} completed."
-+	invoke_command "mv '$temp_dir/${debian_package}-dkms-bin_${module_version}_${debian_build_arch}.deb' '$deb_basedir'" "Moving built files to $deb_basedir"
++	invoke_command "mv '$temp_dir/${debian_package}-modules-${kernelver}_${module_version}_${debian_build_arch}.deb' '$deb_basedir'" "Moving built files to $deb_basedir"
  ;;
  esac
  popd > /dev/null 2>&1
@@ -187,7 +187,7 @@
 ===
 --- /dev/null
 +++ dkms/template-dkms-mkbmdeb/debian/control
-@@ -0,0 +1,13 @@
+@@ -0,0 +1,14 @@
 +Source: DEBIAN_PACKAGE-dkms-bin
 +Section: misc
 +Priority: optional
@@ -195,9 +195,10 @@
 +Build-Depends: debhelper (>= 7), dkms
 +Standards-Version: 3.8.1
 +
-+Package: DEBIAN_PACKAGE-dkms-bin
++Package: DEBIAN_PACKAGE-modules-KERNEL_VERSION
 +Architecture: DEBIAN_BUILD_ARCH
 +Depends: ${misc:Depends}, linux-image-KERNEL_VERSION
++Provides: DEBIAN_PACKAGE-modules
 +Description: DEBIAN_PACKAGE binary drivers for linux-image-KERNEL_VERSION
 + This package contains DEBIAN_PACKAGE drivers for the KERNEL_VERSION Linux kernel,
 + built from DEBIAN_PACKAGE-dkms for the DEBIAN_BUILD_ARCH architecture.



--- etc/dkms/template-dkms-mkbmdeb/debian/control.orig	2016-07-06 01:12:45.0 +0200
+++ etc/dkms/template-dkms-mkbmdeb/debian/control	2016-10-09 03:52:29.292842991 +0200
@@ -5,9 +5,10 @@
 Build-Depends: debhelper (>= 7), dkms
 Standards-Version: 3.8.1
 
-Package: DEBIAN_PACKAGE-dkms-bin
+Package: DEBIAN_PACKAGE-modules-KERNEL_VERSION
 Architecture: DEBIAN_BUILD_ARCH
 Depends: ${misc:Depends}, linux-image-KERNEL_VERSION
+Provides: DEBIAN_PACKAGE-modules
 Description: DEBIAN_PACKAGE binary drivers for linux-image-KERNEL_VERSION
  This package contains DEBIAN_PACKAGE drivers for the KERNEL_VERSION Linux kernel,
  built from DEBIAN_PACKAGE-dkms for the DEBIAN_BUILD_ARCH architecture.
--- usr/sbin/dkms.orig	2016-08-23 08:24:38.0 +0200
+++ usr/sbin/dkms	2016-10-09 04:11:12.331207864 +0200
@@ -3119,7 +3119,7 @@
 	die 7 $"There was a problem creating your ${create_type}."
 	echo $""
 	echo $"DKMS: mk${create_type} completed."
-	invoke_command "mv '$temp_dir/${debian_package}-dkms-bin_${module_version}_${debian_build_arch}.deb' '$deb_basedir'" "Moving built files to $deb_basedir"
+	invoke_command "mv '$temp_dir/${debian_package}-modules-${kernelver}_${module_version}_${debian_build_arch}.deb' '$deb_basedir'" "Moving built files to $deb_basedir"
 ;;
 esac
 popd > /dev/null 2>&1





Bug#830670: mkbmdeb lacks support for Provides:

2016-07-10 Thread Craig Sanders
Package: dkms
Version: 2.2.0.3-5

It's great to see that Bug#554843 is finally closed
and 'dkms mkbmdeb' builds a standalone binary package.  Thanks!

Unfortunately, this doesn't help anything that depends on the -dkms
package itself, or a -modules virtual package

For example, the 'zfs-zed', 'zfs-initramfs', 'zfs-dracut', and
'zfsutils-linux' packages all have:

Depends: [...], zfs-modules | zfs-dkms, zfsutils-linux

The 'zfs-dkms' package has:

Provides: zfs-modules

The 'zfs-dkms-bin' package built by 'dkms mkbmdeb -m zfs -v 0.6.5.7' has
only:

Package: zfs-dkms-bin
Version: 0.6.5.7
Architecture: amd64
Maintainer: Dynamic Kernel Modules Support Team 

Installed-Size: 3086
Depends: linux-image-4.6.0-1-amd64
Section: misc
Priority: optional

This does not satisfy the dependencies of 'zfs-zed' or the others.

The binary module package should probably have a Provides: line
containing either or both of the 'Package:' and 'Provides:' fields of
the -dkms package it replaces.



BTW, The same is true for the 'virtualbox' package, which depends on
'virtualbox-dkms' or 'virtualbox-modules'. A quick check with

apt-cache search -n -- -dkms | cut -d' ' -f1 | 
xargs -n1 apt-cache rdepends | grep -v '^[R ]'

seems to indicate that this will be a problem with ALL -dkms packages.

craig

PS: one current work-around is to use the 'equivs' package to build a
dummy package which has, for example:

Depends: zfs-dkms-bin
Provides: zfs-modules, zfs-dkms

-- 
craig sanders