From 168cc11ba254000d861b6a4aff1083d5965ffd1a Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sat, 21 Oct 2023 13:19:07 +0100 Subject: [PATCH] Fix detection of linux headers on Raspberry Pi OS On the Raspberry Pi OS the Linux headers are split into multiple packages and directories under /usr/src: the configuration and actual header files are in different packages. Presumably, this is done this way to allow re-using the header files of the same kernel by all Raspberry Pi kernel flavors. This made the logic before this change to not consider valid linux headers directory be so: /usr/src/linux-headers-${KERNEL_RELEASE} does not contain include/linux/user.h. Tweak the code so that it additionally considers directories which contains include/generated/autoconf.h to be kernel headers directory. This file is checked by the linux header's directory Makefile and it is not found the kernel configuration is considered invalid. This path sees to be hardcoded, so it should be the same on all platforms. --- driver/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/driver/CMakeLists.txt b/driver/CMakeLists.txt index bd9a15f..c5ff72f 100644 --- a/driver/CMakeLists.txt +++ b/driver/CMakeLists.txt @@ -16,7 +16,9 @@ execute_process( # Find the headers find_path( KERNELHEADERS_DIR - include/linux/user.h + NAMES + include/linux/user.h + include/generated/autoconf.h PATHS /usr/src/linux-headers-${KERNEL_RELEASE} )