]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/hwdb.xml
Merge pull request #1799 from jengelh/doc
[thirdparty/systemd.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-property-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> and
44 the local administration directory <filename>/etc/udev/hwdb.d</filename>.
45 All hwdb files are collectively sorted and processed in lexical order,
46 regardless of the directories in which they live. However, files with
47 identical filenames replace each other. Files in <filename>/etc</filename>
48 have the highest priority and take precedence over files with the same
49 name in <filename>/usr/lib</filename>. This can be used to override a
50 system-supplied hwdb file with a local file if needed;
51 a symlink in <filename>/etc</filename> with the same name as a hwdb file in
52 <filename>/usr/lib</filename>, pointing to <filename>/dev/null</filename>,
53 disables the hwdb file entirely. hwdb files must have the extension
54 <filename>.hwdb</filename>; other extensions are ignored.</para>
55
56 <para>The hwdb file contains data records consisting of matches and
57 associated key-value pairs. Every record in the hwdb starts with one or
58 more match strings, specifying a shell glob to compare the database
59 lookup string against. Multiple match lines are specified in additional
60 consecutive lines. Every match line is compared individually, and they are
61 combined by OR. Every match line must start at the first character of
62 the line.</para>
63
64 <para>The match lines are followed by one or more key-value pair lines, which
65 are recognized by a leading space character. The key name and value are separated
66 by <literal>=</literal>. An empty line signifies the end
67 of a record. Lines beginning with <literal>#</literal> are ignored.</para>
68
69 <para>The content of all hwdb files is read by
70 <citerefentry><refentrytitle>systemd-hwdb</refentrytitle><manvolnum>8</manvolnum></citerefentry>
71 and compiled to a binary database located at <filename>/etc/udev/hwdb.bin</filename>,
72 or alternatively <filename>/usr/lib/udev/hwdb.bin</filename> if you want ship the compiled
73 database in an immutable image.
74 During runtime, only the binary database is used.</para>
75 </refsect1>
76
77 <refsect1>
78 <title>See Also</title>
79 <para>
80 <citerefentry>
81 <refentrytitle>systemd-hwdb</refentrytitle><manvolnum>8</manvolnum>
82 </citerefentry>
83 </para>
84 </refsect1>
85 </refentry>