How to package Berkeley Packet Filters
Hello Debian Mentors,
I'm writing because I seek advice on how to properly package Berkeley
Packet Filter objects. I was not able to find prior art in any other
Debian package.
The v4l-utils source package contains a program called ir-keytable which
could be used to alter in-kernel infrared decoder tables. Recently a new
feature was merged into 4.18 Kernel that allows arbitrary protocol
decoding using the Berkeley Packet Filter: https://lwn.net/Articles/759188/
The ir-keytable source contains some BPF source files that gets compiled
into BPF code using clang:
$(CLANG) ... -target bpf -O2 -c $<
The result are the following files:
debian/ir-keytable/lib/udev/rc_keymaps/protocols/manchester.o
debian/ir-keytable/lib/udev/rc_keymaps/protocols/grundig.o
debian/ir-keytable/lib/udev/rc_keymaps/protocols/pulse_length.o
debian/ir-keytable/lib/udev/rc_keymaps/protocols/rc_mm.o
debian/ir-keytable/lib/udev/rc_keymaps/protocols/pulse_distance.o
I'd like to know if you have suggestions how to properly package them.
Where should they stay according to FHS? Should I keep the .o suffix or
should I replace it with something like .bpf?
Theoretically one could make an ir-keytable-filters package with
Architecture: all and Multi-Arch: foreign but I wonder if it's worth the
effort for 36 KB of data.
dpkg-shlibdeps seems to have some problems:
objdump: debian/ir-keytable/lib/udev/rc_keymaps/protocols/pulse_length.o: not a dynamic object
objdump: debian/ir-keytable/lib/udev/rc_keymaps/protocols/pulse_length.o: invalid operation
dpkg-shlibdeps: warning: couldn't parse dynamic symbol definition: no symbols
As well as Lintian:
E: ir-keytable: binary-from-other-architecture lib/udev/rc_keymaps/protocols/grundig.o
Maybe a .bpf file suffix could help to accept those at certain
whitelisted locations.
Thanks for your input!
-Gregor
Reply to: