Whamcloud - gitweb
LU-12019 build: Recognize Debian Kernel and set KMP dir 66/51066/6
authorThomas Stibor <t.stibor@gsi.de>
Tue, 13 Jun 2023 17:34:39 +0000 (13:34 -0400)
committerOleg Drokin <green@whamcloud.com>
Sat, 8 Jul 2023 22:35:24 +0000 (22:35 +0000)
Recognize Debian kernel and make sure kernel module package (KMP)
directory matches with KMP_MODDIR of Ubuntu and the Debian building
package system.

Change-Id: Ia3570500ed538c5d3c7a002eafddfc715efbf580
Test-Parameters: trivial clientdistro=ubuntu2204
Signed-off-by: Thomas Stibor <t.stibor@gsi.de>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51066
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Thomas Stibor <thomas@stibor.net>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
config/lustre-build-linux.m4
debian/postinst
debian/rules

index 59e010e..61eb9b3 100644 (file)
@@ -112,6 +112,7 @@ AC_DEFUN([LB_LINUX_RELEASE], [
        RHEL_KERNEL="no"
        SUSE_KERNEL="no"
        UBUNTU_KERNEL="no"
+       DEBIAN_KERNEL="no"
        OPENEULER_KERNEL="no"
        # And if any of the above kernels has been detected yet
        KERNEL_FOUND="no"
@@ -154,6 +155,19 @@ AC_DEFUN([LB_LINUX_RELEASE], [
                ])
        ])
 
+       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"
+               ])
+       ])
+
        # Check for a ELRepo -ml kernel on RHEL 7/8
        AS_IF([test "x$KERNEL_FOUND" = "xno"], [
                AC_CACHE_CHECK([for ELRepo -ml kernel signature on CentOS],
@@ -192,7 +206,7 @@ AC_DEFUN([LB_LINUX_RELEASE], [
 
        # 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, openEuler nor Ubuntu])
+               AC_MSG_WARN([Kernel Distro seems to be neither RedHat, SuSE, openEuler, Ubuntu nor Debian])
        ])
 
        AC_MSG_CHECKING([for Linux kernel module package directory])
@@ -205,7 +219,8 @@ AC_DEFUN([LB_LINUX_RELEASE], [
                      [test x$OPENEULER_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, openEuler nor Ubuntu])]
+                     [test x$DEBIAN_KERNEL = xyes], [KMP_MODDIR="updates/kernel"],
+                     [AC_MSG_WARN([Kernel Distro seems to be neither RedHat, SuSE, openEuler, Ubuntu nor Debian])]
                )
                IN_KERNEL="${PACKAGE}"])
        AC_MSG_RESULT($KMP_MODDIR)
index 28f069e..d2343eb 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 f3065dc..d0cd233 100755 (executable)
@@ -522,7 +522,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)