X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=config%2Flustre-build-linux.m4;h=e1b46a374080a2c1b37d62246dc74f697c884470;hb=206b21741b07a10269bbcfdac28743591b64ab2f;hp=8967c01fd25806fd98396f3d8f9e9ec078775cfc;hpb=6dd7a9452664277e200ad41a1d219628ece72f12;p=fs%2Flustre-release.git diff --git a/config/lustre-build-linux.m4 b/config/lustre-build-linux.m4 index 8967c01..e1b46a3 100644 --- a/config/lustre-build-linux.m4 +++ b/config/lustre-build-linux.m4 @@ -79,6 +79,7 @@ AC_DEFUN([LB_LINUX_RELEASE], [ RHEL_KERNEL="no" SUSE_KERNEL="no" UBUNTU_KERNEL="no" + DEBIAN_KERNEL="no" # And if any of the above kernels has been detected yet KERNEL_FOUND="no" @@ -120,9 +121,23 @@ AC_DEFUN([LB_LINUX_RELEASE], [ ]) ]) + # Check for Debian + AS_IF([test "x$KERNEL_FOUND" = "xno"], [ + AC_CACHE_CHECK([for Debian kernel signature], lb_cv_debian_kernel_sig, [ + lb_cv_debian_kernel_sig="no" + AS_IF([grep -q "LINUX_PACKAGE_ID\s*\"\s*Debian" $LINUX_OBJ/include/generated/package.h], [ + lb_cv_debian_kernel_sig="yes" + ]) + ]) + AS_IF([test "x$lb_cv_debian_kernel_sig" = "xyes"], [ + DEBIAN_KERNEL="yes" + KERNEL_FOUND="yes" + ]) + ]) + # If still no kernel was found, a warning is issued AS_IF([test "x$KERNEL_FOUND" = "xno"], [ - AC_MSG_WARN([Kernel Distro seems to be neither RedHat, SuSE nor Ubuntu]) + AC_MSG_WARN([Kernel Distro seems to be neither RedHat, SuSE, Ubuntu nor Debian]) ]) AC_MSG_CHECKING([for Linux kernel module package directory]) @@ -134,7 +149,8 @@ AC_DEFUN([LB_LINUX_RELEASE], [ AS_IF([test x$RHEL_KERNEL = xyes], [KMP_MODDIR="extra/kernel"], [test x$SUSE_KERNEL = xyes], [KMP_MODDIR="updates/kernel"], [test x$UBUNTU_KERNEL = xyes], [KMP_MODDIR="updates/kernel"], - [AC_MSG_WARN([Kernel Distro seems to be neither RedHat, SuSE nor Ubuntu])] + [test x$DEBIAN_KERNEL = xyes], [KMP_MODDIR="updates/kernel"], + [AC_MSG_WARN([Kernel Distro seems to be neither RedHat, SuSE, Ubuntu nor Debian])] ) IN_KERNEL="${PACKAGE}"]) AC_MSG_RESULT($KMP_MODDIR) @@ -210,11 +226,13 @@ AC_DEFUN([LB_ARG_CANON_PATH], [ # Find paths for linux, handling kernel-source rpms # AC_DEFUN([LB_LINUX_PATH], [ -for DEFAULT_LINUX in /lib/modules/$(uname -r)/{source,build} /usr/src/linux $(find /usr/src/kernels/ -maxdepth 1 -name @<:@0-9@:>@\* | xargs -r ls -d | tail -n 1); do +for DEFAULT_LINUX in /usr/src/linux-source-* /lib/modules/$(uname -r)/{source,build} /usr/src/linux $(find /usr/src/kernels/ -maxdepth 1 -name @<:@0-9@:>@\* | xargs -r ls -d | tail -n 1); do AS_IF([readlink -q -e $DEFAULT_LINUX >/dev/null], [break]) done if test "$DEFAULT_LINUX" = "/lib/modules/$(uname -r)/source"; then PATHS="/lib/modules/$(uname -r)/build" +else + PATHS="/usr/src/linux-headers-$(uname -r)" fi PATHS+=" $DEFAULT_LINUX" for DEFAULT_LINUX_OBJ in $PATHS; do @@ -257,8 +275,6 @@ LB_CHECK_FILE([$LINUX_CONFIG], [], [AC_MSG_ERROR([ Kernel config could not be found. - -If you are building from a kernel-source rpm consult build/README.kernel-source ]) ]) AC_SUBST(LINUX_CONFIG) @@ -270,7 +286,7 @@ LB_CHECK_FILE([/boot/kernel.h], AC_ARG_WITH([kernel-source-header], AC_HELP_STRING([--with-kernel-source-header=path], - [Use a different kernel version header. Consult build/README.kernel-source for details.]), + [Use a different kernel version header.]), [LB_ARG_CANON_PATH([kernel-source-header], [KERNEL_SOURCE_HEADER])]) # ----------- make dep run? ------------------ @@ -417,8 +433,7 @@ LC_MODULE_LOADING AC_DEFUN([LB_USES_DPKG], [ AC_CACHE_CHECK([if this distro uses dpkg], lb_cv_uses_dpkg, [ lb_cv_uses_dpkg="no" -AS_CASE([$(lsb_release -i -s 2>/dev/null)], - [Ubuntu | Debian], [lb_cv_uses_dpkg="yes"]) +AS_CASE([$(which dpkg 2>/dev/null)],[*/dpkg], [lb_cv_uses_dpkg="yes"]) ]) uses_dpkg=$lb_cv_uses_dpkg ]) @@ -528,7 +543,7 @@ MODULE_LICENSE("GPL");]) AC_DEFUN([LB_LINUX_COMPILE_IFELSE], [m4_ifvaln([$1], [AC_LANG_CONFTEST([AC_LANG_SOURCE([$1])])])dnl rm -f build/conftest.o build/conftest.mod.c build/conftest.ko -SUBARCH=$(echo $target_cpu | sed -e 's/powerpc.*/powerpc/' -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/' -e 's/k1om/x86/' -e 's/aarch64.*/arm64/') +SUBARCH=$(echo $target_cpu | sed -e 's/powerpc.*/powerpc/' -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/' -e 's/k1om/x86/' -e 's/aarch64.*/arm64/' -e 's/armv7.*/arm/') AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] LDFLAGS= ${LD:+LD="$LD"} CC="$CC" -f $PWD/build/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="$EXTRA_CHECK_INCLUDE -I$LINUX/arch/$SUBARCH/include -Iinclude -Iarch/$SUBARCH/include/generated -I$LINUX/include -Iinclude2 -I$LINUX/include/uapi -Iinclude/generated -I$LINUX/arch/$SUBARCH/include/uapi -Iarch/$SUBARCH/include/generated/uapi -I$LINUX/include/uapi -Iinclude/generated/uapi ${SPL_OBJ:+-include $SPL_OBJ/spl_config.h} ${ZFS_OBJ:+-include $ZFS_OBJ/zfs_config.h} ${SPL:+-I$SPL -I$SPL/include } ${ZFS:+-I$ZFS -I$ZFS/include} -include $CONFIG_INCLUDE" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])], [$4], [_AC_MSG_LOG_CONFTEST