Put the full path of bpf objects in the hwdb
Right now we statically store the single path to look for in the binary itself.
This means that if a user manually installs the binary from sources, it will replace the binary shipped in the distribution making the load of bpf objects shipped by the distribution impossible.
The use case is:
- a distribution ships udev-hid-bpf with the stable BPF objects
- a user needs to test a brand new HID-BPF file, so goes into the
make release
job of the pipeline of the MR, and runsinstall.sh
- now any pre-existing stable bpf objects are never loaded because the new
udev-hid-bpf
binary doesn't know how to look them up.
A discussed solution is to ship different udev rules, but then we can not guarantee which BPF program will be loaded and attached, because each udev-hid-bpf
run is not capable of seeing the other bpf objects.
The solution seems to drop the lookup directory and store the full path in the hwdb. This way, any udev-hid-bpf
installation can see all of the bpf files, and whichever the latest installed udev-hid-bpf
binary it is, it will still be able to access all of the bpf objects and make an educated guess.