Is there an existing issue for this?
Is your feature request related to a problem?
My kernel does not have module support (CONFIG_MODULES=n) and also some other tailoring configurations. I also build Tetragon from source. Before make I dump my kernels BTF and use that instead of the vmlinux_generated_x86.h provided in the Tetragon source. However, the build fails with:
error: incomplete definition of type 'const struct load_info'
Because my kernel does not have module support the BTF does not contain struct load_info.
As a workaround I use indirection: I dump my kernels BTF to bpf/include/vmlinux_generated_x86.h.custom and add a new file bpf/include/module_defs.h:
#ifndef __VMLINUX_MODULE_DEFS_H__
#define __VMLINUX_MODULE_DEFS_H__
struct load_info {
...
};
#endif
Then, I overwrite the provided vmlinux_generated_x86.h like so:
#ifndef __VMLINUX_GENERATED_X86_H__
#define __VMLINUX_GENERATED_X86_H__
#include "vmlinux_generated.h.custom"
#include "module_defs.h"
#endif
That way the build works. I think the dependency to load_info was introduced via #1433.
Describe the feature you would like
Could you please introduce some kind of feature flag to allow building Tetragon from source for kernels that do not have module support?
Describe your proposed solution
A flag for make that controls a preprocessor directive perhaps?
Code of Conduct
Is there an existing issue for this?
Is your feature request related to a problem?
My kernel does not have module support (
CONFIG_MODULES=n) and also some other tailoring configurations. I also build Tetragon from source. BeforemakeI dump my kernels BTF and use that instead of thevmlinux_generated_x86.hprovided in the Tetragon source. However, the build fails with:Because my kernel does not have module support the BTF does not contain
struct load_info.As a workaround I use indirection: I dump my kernels BTF to
bpf/include/vmlinux_generated_x86.h.customand add a new filebpf/include/module_defs.h:Then, I overwrite the provided
vmlinux_generated_x86.hlike so:That way the build works. I think the dependency to
load_infowas introduced via #1433.Describe the feature you would like
Could you please introduce some kind of feature flag to allow building Tetragon from source for kernels that do not have module support?
Describe your proposed solution
A flag for make that controls a preprocessor directive perhaps?
Code of Conduct