X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=config%2Fkernel.m4;h=87c49a82ce5a9c02b4e73cd4344e9d7c9e66d393;hb=76659dc110ef2ada13bcb8e4e2ec60d8216c6836;hp=2d3a1774a099531b81ca6ba448c3b02d461dbc02;hpb=5e6121455c0b941f4612ceb2c1f312d527534b46;p=zfs.git diff --git a/config/kernel.m4 b/config/kernel.m4 index 2d3a177..87c49a8 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -8,12 +8,18 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ ZFS_AC_KERNEL_BDEV_BLOCK_DEVICE_OPERATIONS ZFS_AC_KERNEL_TYPE_FMODE_T ZFS_AC_KERNEL_KOBJ_NAME_LEN + ZFS_AC_KERNEL_BLKDEV_GET_BY_PATH ZFS_AC_KERNEL_OPEN_BDEV_EXCLUSIVE ZFS_AC_KERNEL_INVALIDATE_BDEV_ARGS ZFS_AC_KERNEL_BDEV_LOGICAL_BLOCK_SIZE ZFS_AC_KERNEL_BIO_EMPTY_BARRIER + ZFS_AC_KERNEL_BIO_FAILFAST + ZFS_AC_KERNEL_BIO_FAILFAST_DTD + ZFS_AC_KERNEL_REQ_FAILFAST_MASK ZFS_AC_KERNEL_BIO_END_IO_T_ARGS + ZFS_AC_KERNEL_BIO_RW_SYNC ZFS_AC_KERNEL_BIO_RW_SYNCIO + ZFS_AC_KERNEL_REQ_SYNC ZFS_AC_KERNEL_BLK_END_REQUEST ZFS_AC_KERNEL_BLK_FETCH_REQUEST ZFS_AC_KERNEL_BLK_REQUEUE_REQUEST @@ -23,21 +29,31 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ ZFS_AC_KERNEL_GET_DISK_RO ZFS_AC_KERNEL_RQ_IS_SYNC ZFS_AC_KERNEL_RQ_FOR_EACH_SEGMENT + ZFS_AC_KERNEL_CONST_XATTR_HANDLER + ZFS_AC_KERNEL_XATTR_HANDLER_GET + ZFS_AC_KERNEL_XATTR_HANDLER_SET + ZFS_AC_KERNEL_FSYNC_2ARGS + ZFS_AC_KERNEL_EVICT_INODE + ZFS_AC_KERNEL_INSERT_INODE_LOCKED + ZFS_AC_KERNEL_D_OBTAIN_ALIAS + ZFS_AC_KERNEL_CHECK_DISK_SIZE_CHANGE + ZFS_AC_KERNEL_TRUNCATE_SETSIZE + ZFS_AC_KERNEL_6ARGS_SECURITY_INODE_INIT_SECURITY + ZFS_AC_KERNEL_MOUNT_NODEV + ZFS_AC_KERNEL_BDI + + if test "$LINUX_OBJ" != "$LINUX"; then + KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ" + fi + AC_SUBST(KERNELMAKE_PARAMS) + dnl # -Wall -fno-strict-aliasing -Wstrict-prototypes and other dnl # compiler options are added by the kernel build system. + KERNELCPPFLAGS="$KERNELCPPFLAGS $NO_UNUSED_BUT_SET_VARIABLE" KERNELCPPFLAGS="$KERNELCPPFLAGS -DHAVE_SPL -D_KERNEL" KERNELCPPFLAGS="$KERNELCPPFLAGS -DTEXT_DOMAIN=\\\"zfs-linux-kernel\\\"" - KERNELCPPFLAGS="$KERNELCPPFLAGS -I$SPL" - KERNELCPPFLAGS="$KERNELCPPFLAGS -I$SPL/include" - KERNELCPPFLAGS="$KERNELCPPFLAGS -include $SPL/spl_config.h" - KERNELCPPFLAGS="$KERNELCPPFLAGS -include $TOPDIR/zfs_config.h" - if test "$LINUX_OBJ" != "$LINUX"; then - KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ" - fi - - AC_SUBST(KERNELMAKE_PARAMS) AC_SUBST(KERNELCPPFLAGS) ]) @@ -53,6 +69,14 @@ AC_DEFUN([ZFS_AC_MODULE_SYMVERS], [ else LINUX_SYMBOLS=Module.symvers fi + + if ! test -f "$LINUX_OBJ/$LINUX_SYMBOLS"; then + AC_MSG_ERROR([ + *** Please make sure the kernel devel package for your distribution + *** is installed. If your building with a custom kernel make sure the + *** kernel is configured, built, and the '--with-linux=PATH' configure + *** option refers to the location of the kernel source.]) + fi else LINUX_SYMBOLS=NONE fi @@ -76,8 +100,11 @@ AC_DEFUN([ZFS_AC_KERNEL], [ AC_MSG_CHECKING([kernel source directory]) if test -z "$kernelsrc"; then - headersdir="/lib/modules/$(uname -r)/build" - if test -e "$headersdir"; then + if test -e "/lib/modules/$(uname -r)/source"; then + headersdir="/lib/modules/$(uname -r)/source" + sourcelink=$(readlink -f "$headersdir") + elif test -e "/lib/modules/$(uname -r)/build"; then + headersdir="/lib/modules/$(uname -r)/build" sourcelink=$(readlink -f "$headersdir") else sourcelink=$(ls -1d /usr/src/kernels/* \ @@ -103,7 +130,9 @@ AC_DEFUN([ZFS_AC_KERNEL], [ AC_MSG_RESULT([$kernelsrc]) AC_MSG_CHECKING([kernel build directory]) if test -z "$kernelbuild"; then - if test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then + if test -e "/lib/modules/$(uname -r)/build"; then + kernelbuild=`readlink -f /lib/modules/$(uname -r)/build` + elif test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu} elif test -d ${kernelsrc}-obj/${target_cpu}/default; then kernelbuild=${kernelsrc}-obj/${target_cpu}/default @@ -171,6 +200,10 @@ AC_DEFUN([ZFS_AC_SPL_MODULE_SYMVERS], [ SPL_SYMBOLS=Module.symvers elif test -r $SPL_OBJ/Modules.symvers; then SPL_SYMBOLS=Modules.symvers + elif test -r $SPL_OBJ/module/Module.symvers; then + SPL_SYMBOLS=Module.symvers + elif test -r $SPL_OBJ/module/Modules.symvers; then + SPL_SYMBOLS=Modules.symvers else SPL_SYMBOLS=$LINUX_SYMBOLS fi @@ -222,11 +255,7 @@ AC_DEFUN([ZFS_AC_SPL], [ AC_MSG_RESULT([$splsrc]) AC_MSG_CHECKING([spl build directory]) if test -z "$splbuild"; then - if test -d ${splsrc}/module; then - splbuild=${splsrc}/module - else - splbuild=${splsrc} - fi + splbuild=${splsrc} fi AC_MSG_RESULT([$splbuild]) @@ -261,6 +290,12 @@ AC_DEFUN([ZFS_AC_SPL], [ ]) dnl # +dnl # Certain kernel build options are not supported. These must be +dnl # detected at configure time and cause a build failure. Otherwise +dnl # modules may be successfully built that behave incorrectly. +dnl # +dnl # CONFIG_PREEMPT - Preempt kernels require special handling. +dnl # dnl # There are certain kernel build options which when enabled are dnl # completely incompatible with non GPL kernel modules. It is best dnl # to detect these at configure time and fail with a clear error @@ -270,6 +305,11 @@ dnl # CONFIG_DEBUG_LOCK_ALLOC - Maps mutex_lock() to mutex_lock_nested() dnl # AC_DEFUN([ZFS_AC_KERNEL_CONFIG], [ + ZFS_LINUX_CONFIG([PREEMPT], + AC_MSG_ERROR([ + *** Kernel built with CONFIG_PREEMPT which is not supported. + ** You must rebuild your kernel without this option.]), []) + if test "$ZFS_META_LICENSE" = CDDL; then ZFS_LINUX_CONFIG([DEBUG_LOCK_ALLOC], AC_MSG_ERROR([ @@ -341,9 +381,7 @@ dnl # AC_DEFUN([ZFS_LINUX_CONFIG], [AC_MSG_CHECKING([whether Linux was built with CONFIG_$1]) ZFS_LINUX_TRY_COMPILE([ - #ifndef AUTOCONF_INCLUDED - #include - #endif + #include ],[ #ifndef CONFIG_$1 #error CONFIG_$1 not #defined