build: remove linux/module.h check

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>
This commit is contained in:
Emil Velikov 2024-08-22 17:04:21 +01:00 committed by Lucas De Marchi
parent c296cc1842
commit d469acd4d5
3 changed files with 11 additions and 21 deletions

View 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");]])],

View 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>

View 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