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