Skip to content

Commit 0c4f9c1

Browse files
vdovhanychbluca
authored andcommitted
add udev rules for trezor hw wallet devices
(cherry picked from commit 2cf425e) (cherry picked from commit a78a524) (cherry picked from commit e8fe599)
1 parent 855a353 commit 0c4f9c1

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

hwdb.d/70-hardware-wallets.hwdb

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This file is part of systemd.
2+
#
3+
# Database for Hardware Wallets that should be accessible to the seat owner.
4+
##
5+
# To add local entries, copy this file to
6+
# /etc/udev/hwdb.d/
7+
# and add your rules there. To load the new rules execute (as root):
8+
# systemd-hwdb update
9+
# udevadm trigger
10+
11+
################
12+
# Trezor Hardware Wallets
13+
################
14+
15+
# Trezor v1
16+
usb:v534Cp0001*
17+
ID_HARDWARE_WALLET=1
18+
19+
# Trezor v2
20+
usb:v1209p53C0*
21+
ID_HARDWARE_WALLET=1
22+
23+
usb:v1209p53C1*
24+
ID_HARDWARE_WALLET=1

hwdb.d/meson.build

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ hwdb_files_test = files(
2929
'70-analyzers.hwdb',
3030
'70-av-production.hwdb',
3131
'70-cameras.hwdb',
32+
'70-hardware-wallets.hwdb',
3233
'70-joystick.hwdb',
3334
'70-mouse.hwdb',
3435
'70-pda.hwdb',

hwdb.d/parse_hwdb.py

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ def property_grammar():
173173
('ID_INPUT_TOUCHSCREEN', Or((Literal('0'), Literal('1')))),
174174
('ID_INPUT_TRACKBALL', Or((Literal('0'), Literal('1')))),
175175
('ID_SIGNAL_ANALYZER', Or((Literal('0'), Literal('1')))),
176+
('ID_HARDWARE_WALLET', Or((Literal('0'), Literal('1')))),
176177
('POINTINGSTICK_SENSITIVITY', INTEGER),
177178
('ID_INPUT_JOYSTICK_INTEGRATION', Or(('internal', 'external'))),
178179
('ID_INPUT_TOUCHPAD_INTEGRATION', Or(('internal', 'external'))),

rules.d/70-uaccess.rules.in

+4
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,8 @@ SUBSYSTEM=="hidraw", ENV{ID_AV_PRODUCTION_CONTROLLER}=="1", TAG+="uaccess"
9797
# This also allows accessing HID devices with the libusb backend of hidapi.
9898
SUBSYSTEM=="usb", ENV{ID_AV_PRODUCTION_CONTROLLER}=="1", TAG+="uaccess"
9999

100+
# Hardware wallets
101+
SUBSYSTEM=="usb", ENV{ID_HARDWARE_WALLET}=="1", TAG+="uaccess"
102+
SUBSYSTEM=="hidraw", ENV{ID_HARDWARE_WALLET}=="1", TAG+="uaccess"
103+
100104
LABEL="uaccess_end"

0 commit comments

Comments
 (0)