[Pkg-utopia-maintainers] Bug#500916: hal: FDI cache does not get updated when installing .fdi files from packages

Martin Pitt martin.pitt at ubuntu.com
Thu Oct 2 15:01:31 UTC 2008


Package: hal
Version: 0.5.11-3
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu intrepid ubuntu-patch

Hi!

It already occurred several times to me that people had trouble with
FDI files which were apparently not "picked up" by hal. One particular
case is https://bugs.launchpad.net/bugs/275825, where I finally saw
the light: time-based comparison of .fdi files vs. the cache, as done
in di_cache_coherency_check(), doesn't work with dpkg, which maintains
the original file timestamps on unpack.

The quick fix for this is to remove the cache in the init script,
which I just did in Ubuntu (we are close to release). It sacrifices
most of the startup speed improvement unfortunately, and hal still
won't pick up fdi changes immediately, but at least it will work after
a reboot.

The more correct long-term solution could be to create a
dh_install_hal_fdi which generates
/usr/lib/hal/hald-generate-fdi-cache postinst snippets, and convert
all packages shipping .fdi files to use it. But that's not really
adequate for Lenny, and with DeviceKit being on the horizon, it might
be obsolete before we even finish..

Thanks,

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
=== modified file 'debian/changelog'
--- debian/changelog	2008-09-29 12:58:55 +0000
+++ debian/changelog	2008-10-02 14:50:35 +0000
@@ -1,3 +1,12 @@
+hal (0.5.11-3~ubuntu10) UNRELEASED; urgency=low
+
+  * debian/hal.init: Remove the FDI cache before startup. dpkg preserves
+    original timestamps of unpacked fdi files in packages, so changes in those
+    will never get picked up on upgrade, not even after a reboot.
+    (LP: #275825)
+
+ -- Martin Pitt <martin.pitt at ubuntu.com>  Thu, 02 Oct 2008 16:48:50 +0200
+
 hal (0.5.11-3~ubuntu9) intrepid; urgency=low
 
   * debian/10-x11-keymap.fdi: Disable -evdev for the ThinkPad extra buttons;

=== modified file 'debian/hal.init'
--- debian/hal.init	2008-07-30 20:10:31 +0000
+++ debian/hal.init	2008-10-02 14:50:35 +0000
@@ -37,6 +37,11 @@
         # temporarily disabling automount (see LP #134712)
         rm -f /usr/share/hal/fdi/policy/gparted-disable-automount.fdi || true
 
+        # the time stamp based cache obsolescence check does not really work
+        # with .debs, since dpkg maintains the original timestamps on the
+        # files, and thus new fdi files from packages would never be picked up
+        rm -f /var/cache/hald/fdi-cache
+
 	if [ ! -d $PIDDIR ]; then
 		mkdir -p $PIDDIR
 	fi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-utopia-maintainers/attachments/20081002/10608fcb/attachment.pgp 


More information about the Pkg-utopia-maintainers mailing list