handle kernel headers path for rhel based distros
bug
## Bug Report
<!--
If you have usage questions, please try the [Discussions](https://github.com/kubearmor/KubeArmor/discussions) or [KubeArmor Slack](https://kubearmor.slack.com/) first.
Please check the [Kubearmor issue](https://github.com/kubearmor/KubeArmor/issues) list to check if there is an issue already in the context.
-->
in case if btf is not supported on target host, it requires kernel headers to compile the system monitor. the default path where kernel headers would be installed could be different based on the distro and it's already getting handled:
https://github.com/kubearmor/KubeArmor/blob/5d622d362d8211d0b3c85c633d6adefc00f56171/KubeArmor/BPF/Makefile.vars#L19-L29
on rhel based distros it's been observed (validated on 3.10.0 el7, 5.14.0 el9) that the path would be `/usr/src/kernels/$(KRNVER)`. and this is leading to the issue that fails the compilation.
<img width="995" height="137" alt="Image" src="https://github.com/user-attachments/assets/a5840be8-3757-4f1e-8343-c54b95b6d0bd" />
a better alternative would be `/lib/module/$(KRNVER)`.
0 条评论