I am trying to develop an out-of-tree driver kernel module and an application using buildroot Linux, which implement ioctl like control from user space to kernel space. I want to make user space and kernel space share same data structure, which is supposed to be placed at uapi folder, I found all uapi folders are under output/build/linux-5.15 for my case, even I place my new header at output/build/linux-5.15/include/uapi or output/build/linux-5.15/arch/arm/include/uapi, but the 'make' will not compile files at output/build/linux-5.15, where should I put the new data strut header file for out-of-tree module, such as cirosantilli's kernel_module example (How to add a Linux kernel driver module as a Buildroot package?).
Asked
Active
Viewed 376 times
1
-
1Hi, considering https://stackoverflow.com/questions/40307328/how-to-add-a-linux-kernel-driver-module-as-a-buildroot-package/43874273#43874273 couldn't you just place the shared header under the "kernel_module/" external package? And then modify the Makefile to build both the kernel module and the userland program, both including the the same header, possibly with `-I $(BR2_EXTERNAL_KERNEL_MODULE_PATH)` (added to `ccflags-y` for the kernel build0? This should be enough, since you don't want the header to be present in the target, which generally does not have a compiler. – Ciro Santilli OurBigBook.com Mar 17 '22 at 20:41
-
1Thanks much to Ciro Santilli's quick answer! – zl_kneron Mar 18 '22 at 03:13