[systemd-devel] [PATCH] udev hwdb: Store binary database in libdir, not in /etc

Michael Biebl mbiebl at gmail.com
Fri Jul 5 13:04:29 PDT 2013

2013/6/18 Colin Walters <walters at verbum.org>:
>> b/ let udevadm hwdb --update check, if /var or /var/cache is on a
>> separate partition.
> If it was just udevadm, that wouldn't be so hard, but replicating
> the (what I expect to be fairly fragile) code to detect /var's
> paritioning scheme across any other components (e.g. fontconfig)
> would be ugly.
> Though I do keep coming back to the hwdb being a special case, since
> almost none of the other caches need to unify data from /usr and /etc.
> That does point out another potential solution - have two caches, one
> in /usr and one in /etc, and the /etc one is only created if there's
> anything to cache.

My very first idea was [1], to use /lib/udev for the cache file as
long as /etc/udev/hwdb.d was empty.
And as soon as files are added to /etc/udev/hwdb.d, the cache file is
generated in /etc/udev and udev will first try to read the cache file
from /etc and fall back to /lib
This would be rather simple to add. The cache file in /lib/udev would
still be perfectly shareable across hosts. And I don't share the
concern that this would be confusing for users (and appear random).
So I plan to use that approach in the Debian package.
Fwiw, that is basically what you also initially suggested in [2], with
the slight modification that you would use /etc/cache.

The idea to have support for a split hwdb, where you can read
fragments from different locations, is an interesting one. Dunno
though, how much this would complicate the implementation. IIRC the
hwdb cache/db file is mmapped.


[1] http://lists.freedesktop.org/archives/systemd-devel/2013-June/011383.html
[2] http://lists.freedesktop.org/archives/systemd-devel/2013-June/011370.html
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

More information about the systemd-devel mailing list