udev-hid-bpf - Man Page
loader tool for HID eBPF programs
Synopsis
Description
udev-hid-bpf is a loader and general utility tool for HID eBPF programs. Typically it is invoked by udev to load and unload HID eBPF programs that match a given device but it provides commands to ease development of new eBPF programs and install specific eBPF programs that are not installed by default.
Options
- --help
Print help and exit
- --verbose
Enable verbose output for the given command
- --version
Print version and exit
Commands
- add [--bpfdir /path/to/directory] device [/path/to/program.bpf.o]
Load HID eBPF programs for a device. This command is typically invoked from a udev rule on the "add" action.
If no eBPF program is provided, matching eBPF programs are obtained from the udev properties set on that device.
If multiple devices and/or eBPF programs are provided, devices and eBPF programs must be separated by a literal '-'. For example: udev-hid-bpf add dev1 dev2 - 1.bpf.o 2.bpf.o
If eBPF programs are specified without a full path they are searched for in the directory given by the --bpfdir option (if any) and the built-in directories /usr/lib/firmware/hid/bpf, /usr/local/lib/firmware/hid/bpf, /lib/firmware/hid/bpf, in that order.
The device must be specified as a syspath.
- --bpfdir
Prepend a directory to the list of directories to search for eBPF programs.
- --property KEY=VALUE
Provide an arbitrary NAME=VALUE pair to the BPF program. This NAME=VALUE pair is treated as if it was a property set on the device, taking precedence over any udev property of the same name. This option may be specified multiple times to supply multiple properties. Empty properties must be the empty string (NAME="")
- --replace
Remove current BPF programs for the device first. This is equivalent to running udev-hid-bpf remove with the same device argument first.
- remove device
Remove all HID eBPF programs for a given device. This command is typically invoked from a udev rule on the "remove" action.
The device must be specified as a syspath.
- list-bpf-programs [--bpfdir /path/to/directory]
List available HID eBPF programs in the (built-in) default lookup directories or the given directory.
- list-devices
List available HID devices.
- inspect path/to/program.bpf.o
Inspect the given eBPF program.
- install [options] path/to/program.bpf.o
Install the given eBPF program into /etc/udev-hid-bpf with a corresponding udev rule in /etc/udev/rules.d. This command should be used for testing a single eBPF program or where a full install of udev-hid-bpf is not suitable.
The following options are available for the --install command:
- --dry-run
Do everything except actually creating directories and installing target files
- --install-exe
Also install the udev-hid-bpf executable in $prefix/bin. If the executable already exists at that path this option does nothing.
- --force
Overwrite existing files with the same name
- --prefix /path/to/prefix
Install into the given prefix. Defaults to the built-in prefix /usr.
See Also
udev-hid-bpf's online documentation: