3 This directory contains various fixes for devices. They add new features or
4 fix some behaviors without being entirely mandatory. It is better to load them
5 when you have such a device, but they should not be a requirement for a device
6 to be working during the boot stage.
8 The .bpf.c files provided here are not automatically compiled in the kernel.
9 They should be loaded in the kernel by `udev-hid-bpf`:
11 https://gitlab.freedesktop.org/libevdev/udev-hid-bpf
13 The main reasons for these fixes to be here is to have a central place to
14 "upstream" them, but also this way we can test them thanks to the HID
17 Once a .bpf.c file is accepted here, it is duplicated in `udev-hid-bpf`
18 in the `src/bpf/stable` directory, and distributions are encouraged to
19 only ship those bpf objects. So adding a file here should eventually
20 land in distributions when they update `udev-hid-bpf`
30 Just run `sudo udev-hid-bpf install ./my-awesome-fix.bpf.o`
34 - copy the `.bpf.o` you want in `/etc/udev-hid-bpf/`
35 - create a new udev rule to automatically load it
37 The following should do the trick (assuming udev-hid-bpf is available in
41 $> cp xppen-ArtistPro16Gen2.bpf.o /etc/udev-hid-bpf/
42 $> udev-hid-bpf inspect xppen-ArtistPro16Gen2.bpf.o
45 "name": "xppen-ArtistPro16Gen2.bpf.o",
61 $> cat <EOF > /etc/udev/rules.d/99-load-hid-bpf-xppen-ArtistPro16Gen2.rules
62 ACTION!="add|remove", GOTO="hid_bpf_end"
63 SUBSYSTEM!="hid", GOTO="hid_bpf_end"
65 # xppen-ArtistPro16Gen2.bpf.o
66 ACTION=="add",ENV{MODALIAS}=="hid:b0003g0001v000028BDp0000095A", RUN{program}+="/usr/local/bin/udev-hid-bpf add $sys$devpath /etc/udev-hid-bpf/xppen-ArtistPro16Gen2.bpf.o"
67 ACTION=="remove",ENV{MODALIAS}=="hid:b0003g0001v000028BDp0000095A", RUN{program}+="/usr/local/bin/udev-hid-bpf remove $sys$devpath "
68 # xppen-ArtistPro16Gen2.bpf.o
69 ACTION=="add",ENV{MODALIAS}=="hid:b0003g0001v000028BDp0000095B", RUN{program}+="/usr/local/bin/udev-hid-bpf add $sys$devpath /etc/udev-hid-bpf/xppen-ArtistPro16Gen2.bpf.o"
70 ACTION=="remove",ENV{MODALIAS}=="hid:b0003g0001v000028BDp0000095B", RUN{program}+="/usr/local/bin/udev-hid-bpf remove $sys$devpath "
74 $> udevadm control --reload
77 Then unplug and replug the device.
83 You can check that the udev rule is correctly working by issuing
86 $> udevadm test /sys/bus/hid/devices/0003:28BD:095B*
88 run: '/usr/local/bin/udev-hid-bpf add /sys/devices/virtual/misc/uhid/0003:28BD:095B.0E57 /etc/udev-hid-bpf/xppen-ArtistPro16Gen2.bpf.o'
93 You can check that the program has been properly loaded with `bpftool`
98 247: tracing name xppen_16_fix_eraser tag 18d389353ed2ef07 gpl
99 loaded_at 2024-03-28T16:02:28+0100 uid 0
100 xlated 120B jited 77B memlock 4096B