tags 683863 + patch
usertags 683863 + debian-packaging
thanks

Hi there!

On Sat, 11 Aug 2012 04:00:57 +0200, Marco d'Itri wrote:
> On Aug 05, Didier Raboud <did...@raboud.com> wrote:
>
>> > this can be done with the "udevadm trigger" command.  By default, this
>> > will trigger change events for all devices.  I'm not sure whether that
>> > could have undesirable consequences.  You could limit the events to just
>> > fingerprint readers with a series of
>> > 
>> >     udevadm trigger --attr-match=idVendor=xxxx --attr-match=idProduct=xxxx
>> > 
>> > Possible dh_installudev should help you with this.
>> 
>> As mentionned above, I don't think it's libfprint's job to handle this: if 
>> deemed useful, it should be done by dh_installudev (that doesn't do much 
>> else 
>> than installing the udev rules file) or by a udev dpkg trigger.
>> 
>> I'm CC'ing the udev maintainer to have his input on this. Marco: opinions?
> OP is correct: this kind of rules are not magically applied to existing 
> devices when they are installed, so your package needs to use udevadm 
> trigger in postinst to synthesize change uevents for the installed 
> hardware.

Attached an untested Git patch, which limit the events to only the
devices the package support: I will push it in one week if no one
complains, as well as ask for a wheezy unblock.

Please note that IMHO dh_installudev should be expanded to handle the
creation of the `udevadm trigger` calls, see:

  <http://bugs.debian.org/697362>

Thx, bye,
Gismo / Luca

From f1defc544b4277d8cae718c4b37e77103e95675a Mon Sep 17 00:00:00 2001
From: Luca Capello <l...@pca.it>
Date: Fri, 4 Jan 2013 13:29:38 +0100
Subject: [PATCH] debian/libfprint0.postinst: (#683863) apply udev rules at
 install

---
 debian/changelog           |    7 +++++++
 debian/libfprint0.postinst |   31 +++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+)
 create mode 100644 debian/libfprint0.postinst

diff --git a/debian/changelog b/debian/changelog
index 896b58e..3f92aff 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libfprint (1:0.4.0-4-gdfff16f-5) UNRELEASED; urgency=low
+
+  * debian/libprint0.postinst:
+    + apply udev rules at package installation (Closes: #683863).
+
+ --
+
 libfprint (1:0.4.0-4-gdfff16f-4) unstable; urgency=low
 
   * Fix libusb global variables FTBFS. (Closes: #680838)
diff --git a/debian/libfprint0.postinst b/debian/libfprint0.postinst
new file mode 100644
index 0000000..61bf030
--- /dev/null
+++ b/debian/libfprint0.postinst
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+set -e
+
+#DEBHELPER#
+
+if [ "$1" = "configure" -o "$1" = "upgrade" ]; then
+	# apply udev rules at package installation, see
+	# <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683863#27>
+	# NOTA BENE: after the DEBHELPER section since dh_installudev
+	# adds stuff there
+	udevadm trigger --action=add --attr-match=idVendor=0483 --attr-match=idProduct=2016
+	udevadm trigger --action=add --attr-match=idVendor=147e --attr-match=idProduct=2016
+	udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=5501
+	udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2500
+	udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2580
+	udevadm trigger --action=add --attr-match=idVendor=045e --attr-match=idProduct=00bb
+	udevadm trigger --action=add --attr-match=idVendor=045e --attr-match=idProduct=00bc
+	udevadm trigger --action=add --attr-match=idVendor=045e --attr-match=idProduct=00bd
+	udevadm trigger --action=add --attr-match=idVendor=045e --attr-match=idProduct=00ca
+	udevadm trigger --action=add --attr-match=idVendor=05ba --attr-match=idProduct=0007
+	udevadm trigger --action=add --attr-match=idVendor=05ba --attr-match=idProduct=0008
+	udevadm trigger --action=add --attr-match=idVendor=05ba --attr-match=idProduct=000a
+	udevadm trigger --action=add --attr-match=idVendor=061a --attr-match=idProduct=0110
+	udevadm trigger --action=add --attr-match=idVendor=061a --attr-match=idProduct=1000
+	udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=1600
+	udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=0001
+	udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2810
+fi
+
+exit 0
-- 
1.7.10.4

Attachment: pgpVKfgYQl3Yb.pgp
Description: PGP signature

Reply via email to