chiark / gitweb /
update TODO
[elogind.git] / man / hwdb.xml
1 <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <refentry id="hwdb" conditional="ENABLE_HWDB">
6   <refentryinfo>
7     <title>hwdb</title>
8     <productname>systemd</productname>
9     <authorgroup>
10       <author>
11         <contrib>Developer</contrib>
12         <firstname>Kay</firstname>
13         <surname>Sievers</surname>
14         <email>kay@vrfy.org</email>
15       </author>
16       <author>
17         <contrib>Developer</contrib>
18         <firstname>Tom</firstname>
19         <surname>Gundersen</surname>
20         <email>teg@jklm.no</email>
21       </author>
22     </authorgroup>
23   </refentryinfo>
24
25   <refmeta>
26     <refentrytitle>hwdb</refentrytitle>
27     <manvolnum>7</manvolnum>
28   </refmeta>
29
30   <refnamediv>
31     <refname>hwdb</refname>
32     <refpurpose>Hardware Database</refpurpose>
33   </refnamediv>
34
35   <refsect1><title>Description</title>
36     <para>The hardware database is a key-value store for associating modalias-like keys to
37     udev-properties-like values. It is used primarily by udev to add the relevant properties
38     to matching devices, but it can also be queried directly.</para>
39   </refsect1>
40
41   <refsect1><title>Hardware Database Files</title>
42       <para>The hwdb files are read from the files located in the
43       system hwdb directory <filename>/usr/lib/udev/hwdb.d</filename>,
44       the volatile runtime directory <filename>/run/udev/hwdb.d</filename>
45       and the local administration directory <filename>/etc/udev/hwdb.d</filename>.
46       All hwdb files are collectively sorted and processed in lexical order,
47       regardless of the directories in which they live. However, files with
48       identical filenames replace each other. Files in <filename>/etc</filename>
49       have the highest priority, files in <filename>/run</filename> take precedence
50       over files with the same name in <filename>/usr/lib</filename>. This can be
51       used to override a system-supplied hwdb file with a local file if needed;
52       a symlink in <filename>/etc</filename> with the same name as a hwdb file in
53       <filename>/usr/lib</filename>, pointing to <filename>/dev/null</filename>,
54       disables the hwdb file entirely. hwdb files must have the extension
55       <filename>.hwdb</filename>; other extensions are ignored.</para>
56
57       <para>The hwdb file contains data records consisting of matches and
58       associated key-value pairs. Every record in the hwdb starts with one or
59       more match string, specifying a shell glob to compare the database
60       lookup string against. Multiple match lines are specified in additional
61       consecutive lines. Every match line is compared indivdually, they are
62       combined by OR. Every match line must start at the first character of
63       the line.</para>
64
65       <para>The match lines are followed by one or more key-value pair lines, which
66       are recognized by a leading space character. The key name and value are separated
67       by <literal>=</literal>. An empty line signifies the end
68       of a record. Lines beginning with <literal>#</literal> are ignored.</para>
69
70       <para>The content of all hwdb files is read by
71       <citerefentry><refentrytitle>systemd-hwdb</refentrytitle><manvolnum>8</manvolnum></citerefentry>
72       and compiled to a binary database located at <filename>/etc/udev/hwdb.bin</filename>,
73       or alternatively <filename>/usr/lib/udev/hwdb.bin</filename> if you want ship the compiled
74       database in an immutable image.
75       During runtime only the binary database is used.</para>
76   </refsect1>
77
78   <refsect1>
79     <title>See Also</title>
80     <para>
81       <citerefentry>
82         <refentrytitle>systemd-hwdb</refentrytitle><manvolnum>8</manvolnum>
83       </citerefentry>
84     </para>
85   </refsect1>
86 </refentry>