Strengthen Linux kernel capabilities detection
- Add `CONFIG_BLOCK` Linux config requirement to `ZFS_AC_KERNEL_CONFIG_DEFINED`. OpenZFS won't compile without that block device support due to large amount of functional dependencies on it. - Remove dependency on `groups_alloc()` in `ZFS_AC_KERNEL_SRC_GROUP_INFO_GID` to circumvent the missing stub in Linux 4.X kernel headers. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: szubersk <szuberskidamian@gmail.com> Closes #13351
This commit is contained in:
parent
47a02e3972
commit
2f31b585e7
|
@ -19,19 +19,46 @@ AC_DEFUN([ZFS_AC_KERNEL_CONFIG_DEFINED], [
|
|||
])
|
||||
])
|
||||
|
||||
ZFS_AC_KERNEL_SRC_CONFIG_BLOCK
|
||||
ZFS_AC_KERNEL_SRC_CONFIG_DEBUG_LOCK_ALLOC
|
||||
ZFS_AC_KERNEL_SRC_CONFIG_TRIM_UNUSED_KSYMS
|
||||
ZFS_AC_KERNEL_SRC_CONFIG_ZLIB_INFLATE
|
||||
ZFS_AC_KERNEL_SRC_CONFIG_ZLIB_DEFLATE
|
||||
ZFS_AC_KERNEL_SRC_CONFIG_ZLIB_INFLATE
|
||||
|
||||
AC_MSG_CHECKING([for kernel config option compatibility])
|
||||
ZFS_LINUX_TEST_COMPILE_ALL([config])
|
||||
AC_MSG_RESULT([done])
|
||||
|
||||
ZFS_AC_KERNEL_CONFIG_BLOCK
|
||||
ZFS_AC_KERNEL_CONFIG_DEBUG_LOCK_ALLOC
|
||||
ZFS_AC_KERNEL_CONFIG_TRIM_UNUSED_KSYMS
|
||||
ZFS_AC_KERNEL_CONFIG_ZLIB_INFLATE
|
||||
ZFS_AC_KERNEL_CONFIG_ZLIB_DEFLATE
|
||||
ZFS_AC_KERNEL_CONFIG_ZLIB_INFLATE
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Check CONFIG_BLOCK
|
||||
dnl #
|
||||
dnl # Verify the kernel has CONFIG_BLOCK support enabled.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_CONFIG_BLOCK], [
|
||||
ZFS_LINUX_TEST_SRC([config_block], [
|
||||
#if !defined(CONFIG_BLOCK)
|
||||
#error CONFIG_BLOCK not defined
|
||||
#endif
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_CONFIG_BLOCK], [
|
||||
AC_MSG_CHECKING([whether CONFIG_BLOCK is defined])
|
||||
ZFS_LINUX_TEST_RESULT([config_block], [
|
||||
AC_MSG_RESULT([yes])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([
|
||||
*** This kernel does not include the required block device support.
|
||||
*** Rebuild the kernel with CONFIG_BLOCK=y set.])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
|
|
|
@ -6,8 +6,8 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_GROUP_INFO_GID], [
|
|||
ZFS_LINUX_TEST_SRC([group_info_gid], [
|
||||
#include <linux/cred.h>
|
||||
],[
|
||||
struct group_info *gi = groups_alloc(1);
|
||||
gi->gid[0] = KGIDT_INIT(0);
|
||||
struct group_info gi __attribute__ ((unused)) = {};
|
||||
gi.gid[0] = KGIDT_INIT(0);
|
||||
])
|
||||
])
|
||||
|
||||
|
|
Loading…
Reference in New Issue