From: Zbigniew Jędrzejewski-Szmek Date: Thu, 15 Oct 2020 15:58:43 +0000 (+0200) Subject: man: describe wildcards and range matches in hwdb syntax X-Git-Tag: v247-rc1~61^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F17358%2Fhead;p=thirdparty%2Fsystemd.git man: describe wildcards and range matches in hwdb syntax --- diff --git a/man/hwdb.xml b/man/hwdb.xml index 5267d212bad..5e906907472 100644 --- a/man/hwdb.xml +++ b/man/hwdb.xml @@ -47,6 +47,19 @@ they are combined by OR. Every match line must start at the first character of the line. + Match patterns consist of literal characters, and shell-style wildcards: + + Asterisk * matches any number of characters + + Question mark ? matches a single character + + Character list [chars] matches one of + the characters chars listed between [ and + ]. A range may be specified as with a dash as + [first-last]. The match may + be inverted with a caret [^…]. + + The match lines are followed by one or more key-value pair lines, which are recognized by a leading space character. The key name and value are separated by =. An empty line signifies the end of a record. Lines beginning @@ -84,6 +97,11 @@ mouse:*:name:*trackball*:* mouse:*:name:*TrackBall*:* ID_INPUT_TRACKBALL=1 +# The rule above could be also be written in a form that +# matches Tb, tb, TB, tB: +mouse:*:name:*[tT]rack[bB]all*:* + ID_INPUT_TRACKBALL=1 + # A record with a single match and five properties mouse:usb:v046dp4041:name:Logitech MX Master:* MOUSE_DPI=1000@166 @@ -103,21 +121,25 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer*:pn*:* KEYBOARD_KEY_a2=setup KEYBOARD_KEY_a3=battery -evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer*:pn123*:* +# Match vendor name "Acer" and any product name starting with "X123" +evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer:pnX123*:* KEYBOARD_KEY_a2=wlan # /etc/udev/hwdb.d/70-keyboard.hwdb # disable wlan key on all at keyboards evdev:atkbd:* - KEYBOARD_KEY_a2=reserved + KEYBOARD_KEY_a2=reserved + PROPERTY_WITH_SPACES=some string If the hwdb consists of those two files, a keyboard with the lookup string - evdev:atkbd:dmi:bvnAcer:bdXXXXX:bd08/05/2010:svnAcer:pn123 + evdev:atkbd:dmi:bvnAcer:bdXXXXX:bd08/05/2010:svnAcer:pnX123 will match all three records, and end up with the following properties: KEYBOARD_KEY_a1=help KEYBOARD_KEY_a2=reserved -KEYBOARD_KEY_a3=battery +KEYBOARD_KEY_a3=battery +PROPERTY_WITH_SPACES=some string +