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