[systemd-devel] Excluding .hwdb files

Kay Sievers kay at vrfy.org
Mon Jul 22 09:45:17 PDT 2013


On Mon, Jul 22, 2013 at 6:31 PM, Tom Gundersen <teg at jklm.no> wrote:
> On 22 Jul 2013 18:19, "Michael Biebl" <mbiebl at gmail.com> wrote:
>>
>> 2013/7/22 Kay Sievers <kay at vrfy.org>:
>> > On Mon, Jul 22, 2013 at 3:32 PM, Umut Tezduyar <umut at tezduyar.com>
>> > wrote:
>> >> For an embedded system that is not using hwdb.bin, we are shipping
>> >> roughly 4 mb .hwdb files under /usr/lib/udev/hwdb.d. Is it
>> >> distributions responsibility to clean up .hwdb files after build or
>> >> should we have a configure option to exclude hwdb support?
>> >
>> > It's probably not really worth to compile-out the hwdb support, the
>> > involved code is quite small.
>> >
>> > Deleting/sub-packaging the ,hwdb source files (which are only needed
>> > to re-compile the database in /etc), or not compiling a the binary
>> > database at all should probably be a decision at the packaging/install
>> > level, and not a configure option. It should be reasonable easy to do
>> > step that at packaging/install time.
>> >
>>
>> Is the data in hwdb really optional, i.e. does it only contain strings
>> for representational purposes?
>
> In principle it can contain anything, so while it now mostly contain data
> for representation purposes, that's not really a safe assumption to make in
> general.
>
> For instance the keyboard database shipped with systemd contains quirks, and
> the database to be shipped with gphoto2 contains data to classify media
> devices (without which no cameras will be recognized as such by varies UIs).
>
> That said, there may be plenty of situations where you know you don't need a
> particular sub-database, so packaging these separately may make sense.

It might, yes.

What should always be taken into account though, is that adding data
to the hwdb is basically "free", very much unlike udev rules are.

Unused data in the hwdb does not significantly cause any overhead at
runtime. The query time for the hwdb is mostly bound to the length of
the query string. It does not depend directly on the amount of data
stored in the database.

All redundant data in the compiled database (the file in /etc) will be
removed and de-duplicated at compilation time. So avoiding to install
hwdb files would focus mostly on disk space for the source text files,
and not provide many other benefits at runtime, it should be hardly
measurable in any common setup.

Kay


More information about the systemd-devel mailing list