]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
build: remove linux/module.h check
authorEmil Velikov <emil.l.velikov@gmail.com>
Thu, 22 Aug 2024 16:04:21 +0000 (17:04 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 23 Aug 2024 18:51:19 +0000 (13:51 -0500)
We include the header for the UAPI MODULE_INIT_* constants, while we
also provide them locally.

At a glance, at least Arch and Alpine build kmod without the uapi
header, so just drop the check and ifndef guards all together.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/86
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
configure.ac
libkmod/libkmod-module.c
shared/missing.h

index 62781470f120078c36232e9e25b0e0073bd3cf44..5396436da734e43742a82bf4a17113c725bba6cc 100644 (file)
@@ -55,9 +55,6 @@ AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include <sys/stat.h>])
 # not desired here
 AC_CHECK_DECLS_ONCE([[strndupa], [basename]], [], [], [[#include <string.h>]])
 
-# Check kernel headers
-AC_CHECK_HEADERS_ONCE([linux/module.h])
-
 AC_MSG_CHECKING([whether _Static_assert() is supported])
 AC_COMPILE_IFELSE(
        [AC_LANG_SOURCE([[_Static_assert(1, "Test");]])],
index c23159fbdcc580d0001120536f66d79d3ac94464..9cfc80173ae7a878d03144d42d0948850a3964bf 100644 (file)
@@ -21,9 +21,6 @@
 #include <sys/syscall.h>
 #include <sys/types.h>
 #include <sys/wait.h>
-#ifdef HAVE_LINUX_MODULE_H
-#include <linux/module.h>
-#endif
 
 #include <shared/util.h>
 
index 137c9a9fd47ebd4d0b80e54d3eb8ae1bcd6bc0b7..86caf80ae17525eaf93b289fa0327d31348acf29 100644 (file)
@@ -3,21 +3,17 @@
 #include <unistd.h>
 #include <sys/syscall.h>
 
-#ifdef HAVE_LINUX_MODULE_H
-#include <linux/module.h>
-#endif
-
-#ifndef MODULE_INIT_IGNORE_MODVERSIONS
-# define MODULE_INIT_IGNORE_MODVERSIONS 1
-#endif
-
-#ifndef MODULE_INIT_IGNORE_VERMAGIC
-# define MODULE_INIT_IGNORE_VERMAGIC 2
-#endif
-
-#ifndef MODULE_INIT_COMPRESSED_FILE
-# define MODULE_INIT_COMPRESSED_FILE 4
-#endif
+/*
+ * Macros pulled from linux/module.h, to avoid pulling the header.
+ *
+ * In practise very few people have it installed and distros do not install the
+ * relevant package during their build.
+ *
+ * Values are UAPI, so they cannot change.
+ */
+#define MODULE_INIT_IGNORE_MODVERSIONS 1
+#define MODULE_INIT_IGNORE_VERMAGIC 2
+#define MODULE_INIT_COMPRESSED_FILE 4
 
 #ifndef __NR_finit_module
 # warning __NR_finit_module missing - kmod might not work correctly