Dear all,
I want to use the libtorch libraries inside a kernel module. I wrote a simple Makefile to compile the kernel module:
obj-m += firewall.o
SRC := $(shell pwd)
KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build/
all:
$(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules
install:
cp firewall.ko /lib/modules/$(shell uname -r)/
modprobe firewall
clean:
$(MAKE) -C $(KERNEL_SRC) M=$(SRC) clean
However, I get the following error:
firewall.c:1:10: fatal error: linux/init.h: No such file or directory
1 | #include <linux/init.h> // Macros
How may I solve?