udev-hid-bpf(1)

πŸ“¦
version 2.3.0.20260703.4.gef5fbe3 Β· 5 versions
, in ubuntu stonking

πŸ’… NAME πŸ’…

udev-hid-bpf β€” a loader tool for HID eBPF programs πŸ¦‹βœ¨


✨ SYNOPSIS ✨

udev-hid-bpf [--help|--version] <command> [args]

🌸 DESCRIPTION 🌸

okay so bestie, udev-hid-bpf is a loader and general-purpose utility tool for HID eBPF programs. no cap. 🫢

usually it gets invoked by udev to load and unload HID eBPF programs that match a given device β€” like, that's its whole day job. but it ALSO ships a bunch of commands to make your life easier: it can ease development of new eBPF programs, and it can install specific eBPF programs that are not installed by default. it's giving main character energy honestly πŸ‘‘


πŸ’– OPTIONS πŸ’–

  • --help β€” prints help and dips out. bye! πŸ‘‹
  • --verbose β€” turns on verbose output for whatever command you're running. yes queen, tell me everything πŸ™ˆ
  • --version β€” prints the version and exits. slay.

πŸŽ€ COMMANDS πŸŽ€

⭐ add [--bpfdir /path/to/directory] device [/path/to/program.bpf.o]

Loads HID eBPF programs for a device. this one is typically invoked from a udev rule on the "add" action, iykyk.

if you don't hand it an eBPF program, the matching eBPF programs are obtained from the udev properties set on that device. no program? no problem, we'll go find them πŸ’…

if you pass multiple devices and/or multiple eBPF programs, you gotta separate the devices from the eBPF programs with a literal -. like literally a dash, that's the vibe check. for example:

udev-hid-bpf add dev1 dev2 - 1.bpf.o 2.bpf.o

if eBPF programs are specified without a full path, they get searched for in the directory given by the --bpfdir option (if any) and the built-in directories /usr/lib/x86_64-linux-gnu/bpf/, in that order. first come, first served bestie.

the device must be specified as a syspath. non-negotiable, that's the rule 🚨

🌈 options for add

  • --bpfdir β€” prepends a directory to the list of directories to search for eBPF programs. priority queue energy ✨
  • --property KEY=VALUE β€” provides 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, and it takes precedence over any udev property of the same name. you can specify this option multiple times to supply multiple properties. empty properties must be the empty string (NAME="") β€” that's the move, don't fight it πŸ’…
  • --replace β€” removes current BPF programs for the device first. this is equivalent to running udev-hid-bpf remove with the same device argument first. out with the old, in with the new πŸ¦‹

🌸 remove device

Removes all HID eBPF programs for a given device. typically invoked from a udev rule on the "remove" action.

the device must be specified as a syspath. same rule as always bestie 😭

🧚 list-bpf-programs [--bpfdir /path/to/directory]

Lists available HID eBPF programs in the (built-in) default lookup directories, or in the given directory. window shopping, but make it eBPF ✨

πŸ‘‘ list-devices

Lists available HID devices. look at all these lil guys πŸŽ€

πŸ”₯ inspect path/to/program.bpf.o

Inspects the given eBPF program. get in loser, we're investigating πŸ”

πŸ’œ install [options] path/to/program.bpf.o

Installs the given eBPF program into /etc/udev-hid-bpf with a corresponding udev rule in /etc/udev/rules.d. use this command for testing a single eBPF program, or for when a full install of udev-hid-bpf is not suitable. it's the lil snack version 🌈

the following options are available for the --install command:

⭐ options for install

  • --dry-run β€” does everything except actually creating directories and installing target files. pretend mode, no commitment, we love a rehearsal πŸ™ˆ
  • --install-exe β€” also installs the udev-hid-bpf executable in $prefix/bin. if the executable already exists at that path, this option does nothing. respect, it saw itself out πŸ’€
  • --force β€” overwrites existing files with the same name. no mercy periods πŸ’…
  • --prefix /path/to/prefix β€” installs into the given prefix. defaults to the built-in prefix /usr. home base 🏠

πŸ¦‹ SEE ALSO πŸ¦‹

udev-hid-bpf's online documentation:

https://libevdev.pages.freedesktop.org/udev-hid-bpf/

okay that's the whole page bestie, you ate that fr fr πŸ’–βœ¨ this was udev-hid-bpf version 2.3.0-20260703 from the udev-hid-bpf(1) manual, dated 20260703 β€” go forth and load some eBPF programs, you absolute icon πŸ‘‘πŸŽ€πŸŒΈ

πŸ“¦ where this page comes from