Provide a udev-hid-bpf inspect command
Should replace #8 (closed)
build.rs
is currently generating the hwdb because inspecting a produced bpf.o
file to fetch the various modaliases is hard. So we implemented it in rust in build.rs
because it would reduce the span of the project itself.
However, this prevent to regenerate the hwdb from outside and makes our life miserable with cargo build
.
So we should provide a udev-hid-bpf inspect
command that shouts a json human readable output that can be used by any tools later to generate hwdb, or simple udev rules.
For example, we could export something like:
{
"name": "foo.bpf.o",
"devices": [
{ "bus": "USB", "vid": "0x0b0a", "pid": "0x0001"}
],
"progs": [
{"name": "probe", "SEC": "syscall"},
{"name": "foo", "SEC": "fmod_ret/hid_bpf_device_event"},
{"name": "bar", "SEC": "baz"},
]
}
Then generating the hwdb could be script in whatever language we prefer, and be generated by the install
command (from meson
likely)