Whamcloud - gitweb
LU-12019 build: Recognize Debian Kernel and set KMP dir 29/34329/3
authorThomas Stibor <t.stibor@gsi.de>
Tue, 7 May 2019 16:37:20 +0000 (12:37 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 21 May 2019 05:12:13 +0000 (05:12 +0000)
Recognize Debian kernel and make sure kernel module package (KMP)
directory matches with KMP_MODDIR of Ubuntu and the Debian building
package system.

Test-Parameters: clientdistro=ubuntu1804
Signed-off-by: Thomas Stibor <t.stibor@gsi.de>
Change-Id: Iaf3635af6a624c9395db3f891d31413cb9e57b92
Reviewed-on: https://review.whamcloud.com/34329
Tested-by: Jenkins
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Nathaniel Clark <nclark@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
config/lustre-build-linux.m4
debian/postinst
debian/rules

index 9941045..6333154 100644 (file)
@@ -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)
index a05e2a5..4b623f6 100755 (executable)
@@ -4,6 +4,6 @@ DEPMOD_DIR="/etc/depmod.d"
 LUSTRE_DEPMOD_FILE="${DEPMOD_DIR}/lustre.conf"
 
 [ ! -d ${DEPMOD_DIR} ] && { mkdir -p ${DEPMOD_DIR}; }
-[ ! -e ${LUSTRE_DEPMOD_FILE} ] && { echo "search updates built-in" > ${LUSTRE_DEPMOD_FILE}; }
+[ ! -e ${LUSTRE_DEPMOD_FILE} ] && { echo "search updates/kernel built-in" > ${LUSTRE_DEPMOD_FILE}; }
 
 depmod -a
index 5913409..e2bfbd1 100755 (executable)
@@ -477,7 +477,7 @@ kdist_config: prep-deb-files patch-stamp
                --disable-snmp \
                --disable-tests \
                --enable-quota \
-               --with-kmp-moddir=updates \
+               --with-kmp-moddir=updates/kernel \
                $${EXTRAFLAGS} \
                $(EXTRA_OPTIONS)