From: Thomas Stibor Date: Tue, 13 Jun 2023 17:34:39 +0000 (-0400) Subject: LU-12019 build: Recognize Debian Kernel and set KMP dir X-Git-Tag: 2.15.57~92 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F66%2F51066%2F6;p=fs%2Flustre-release.git LU-12019 build: Recognize Debian Kernel and set KMP dir 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 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51066 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Thomas Stibor Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- diff --git a/config/lustre-build-linux.m4 b/config/lustre-build-linux.m4 index 59e010e..61eb9b3 100644 --- a/config/lustre-build-linux.m4 +++ b/config/lustre-build-linux.m4 @@ -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) diff --git a/debian/postinst b/debian/postinst index 28f069e..d2343eb 100755 --- a/debian/postinst +++ b/debian/postinst @@ -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 diff --git a/debian/rules b/debian/rules index f3065dc..d0cd233 100755 --- a/debian/rules +++ b/debian/rules @@ -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)