Bug#858456: Stale references to 60-multipath.rules and 60-kpartx.rules

2017-03-24 Thread Ritesh Raj Sarraf
On Wed, 2017-03-22 at 15:19 +0100, Christian Ehrhardt wrote:
> 
> The TL;DR is that I think the 60-multipath.rules references in
> debian/initramfs/hooks no more apply - so they should be either fixed or
> dropped.
> Since it seems to work without dropping likely is better, but I'm not sure on
> this.

I must have fucked up something in the last year. udev rules should be present
for those packages. Thanks for reporting.

-- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System

signature.asc
Description: This is a digitally signed message part


Bug#858456: Stale references to 60-multipath.rules and 60-kpartx.rules

2017-03-22 Thread Christian Ehrhardt
Package: multipath-tools
Version: 0.6.4-4
Severity: normal

Hi,
we got an Ubuntu bug report [1] , but I think this is better solved in
Debian than to make our Delta even more weird, therefore reporting to you
here.

The TL;DR is that I think the 60-multipath.rules references in
debian/initramfs/hooks no more apply - so they should be either fixed or
dropped.
Since it seems to work without dropping likely is better, but I'm not sure
on this.

This is the list of references I still find:
- In postinst is only a transition to remove "Removing dangling $RULE
symlink..."
  The same it true for the kpartx.rule (That transition should be done now
right?)
- multipath/Makefile installs it with different names now 56-multipath.rules
- debian/initramfs/hooks refers to older filenames (60-multipath.rules),
therefore current references are no-ops.

One can search e.g. buildlogs to confirm the file no more existing: [2]
Or look on a Debian system with all multipath packages installed which shows
  $ dpkg -L kpartx multipath-tools multipath-tools-boot | egrep '\.rules'
  /lib/udev/rules.d/60-kpartx.rules

I must admit I don't see how the 60-kpartx.rules gets to its name (I'd have
expected 66-), but it is there so I'm not complaining on that one.

Yet on the no more existing rules there could be two changes made
1. drop the multipath.rules references like
"0001-stale-60-multipath.rules-ref.patch"
2. If you agree that the transition of the old rule references is done (was
debian/lenny 0.4.8-13 might be even older), then also drop the link dropper
code like in "0002-postinst-simplify-by-dropping-old-transition.patch"
On the latter one might even consider dropping the full case statement now.

Both patches are attached.
Open for discussion, if you want changes as real commits somewhere let me
know.

[1]: https://bugs.launchpad.net/ubuntu/+source/multipath-tools/+bug/1548303
[2]:
https://buildd.debian.org/status/fetch.php?pkg=multipath-tools=i386=0.6.4-4=1487750289=0

-- 
Christian Ehrhardt
Software Engineer, Ubuntu Server
Canonical Ltd
From 22f5179dc1bf07e1f962fe46bfa1b885a68ab34a Mon Sep 17 00:00:00 2001
From: Christian Ehrhardt 
Date: Wed, 22 Mar 2017 15:12:28 +0100
Subject: [PATCH 1/2] stale 60-multipath.rules ref

Signed-off-by: Christian Ehrhardt 
---
 debian/initramfs/hooks | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/initramfs/hooks b/debian/initramfs/hooks
index bddfb9d..e27bbdb 100644
--- a/debian/initramfs/hooks
+++ b/debian/initramfs/hooks
@@ -27,7 +27,7 @@ add_bindings()
 
 add_udev_rules()
 {
-  for rules in 60-multipath.rules 60-kpartx.rules; do
+  for rules in 60-kpartx.rules; do
 if [ -e /lib/udev/rules.d/$rules ]; then
   cp -p /lib/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/
 fi
-- 
2.7.4

From df587dc9e2be16e751860d57f627abcaea7b Mon Sep 17 00:00:00 2001
From: Christian Ehrhardt 
Date: Wed, 22 Mar 2017 15:16:13 +0100
Subject: [PATCH 2/2] postinst: simplify by dropping old transition

Signed-off-by: Christian Ehrhardt 
---
 debian/kpartx.postinst  | 14 +-
 debian/multipath-tools.postinst | 14 +-
 2 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/debian/kpartx.postinst b/debian/kpartx.postinst
index fa4de59..86d9b55 100644
--- a/debian/kpartx.postinst
+++ b/debian/kpartx.postinst
@@ -17,20 +17,8 @@ set -e
 # for details, see http://www.debian.org/doc/debian-policy/ or
 # the debian-policy package
 
-RULE=/etc/udev/rules.d/kpartx.rules
-
 case "$1" in
-configure)
-	if [ -n "$2" ] && dpkg --compare-versions "$2" lt "0.4.7-4"; then
-	if [ -L $RULE ] && ! readlink -e $RULE; then
-		echo -n "Removing dangling $RULE symlink..."
-		rm $RULE
-		echo "done."
-	fi
-	fi
-;;
-
-abort-upgrade|abort-remove|abort-deconfigure)
+configure|abort-upgrade|abort-remove|abort-deconfigure)
 ;;
 
 *)
diff --git a/debian/multipath-tools.postinst b/debian/multipath-tools.postinst
index fef2966..627b642 100644
--- a/debian/multipath-tools.postinst
+++ b/debian/multipath-tools.postinst
@@ -17,20 +17,8 @@ set -e
 # for details, see http://www.debian.org/doc/debian-policy/ or
 # the debian-policy package
 
-RULE=/etc/udev/rules.d/multipath.rules
-
 case "$1" in
-configure)
-	if [ -n "$2" ] && dpkg --compare-versions "$2" lt "0.4.7-4"; then
-	if [ -L $RULE ] && ! readlink -e $RULE; then
-		echo -n "Removing dangling $RULE symlink..."
-		rm $RULE
-		echo "done."
-	fi
-	fi
-;;
-
-abort-upgrade|abort-remove|abort-deconfigure)
+configure|abort-upgrade|abort-remove|abort-deconfigure)
 ;;
 
 *)
-- 
2.7.4