Whamcloud - gitweb
LU-15874 kernel: new kernel [RHEL 9.0 5.14.0-70.22.1.el9_0] 47/47847/11
authorJian Yu <yujian@whamcloud.com>
Mon, 15 Aug 2022 15:50:52 +0000 (08:50 -0700)
committerOleg Drokin <green@whamcloud.com>
Fri, 19 Aug 2022 04:33:20 +0000 (04:33 +0000)
This patch makes changes to support new RHEL 9.0 release
for Lustre client.

fix lbuild to include modified find-requires.ksyms

Test-Parameters: trivial clientdistro=el9.0 \
env=SANITY_EXCEPT="130 244a" testlist=sanity

Change-Id: Ib7fdf9d3946df626759d395b5000b375391da344
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/47847
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
contrib/lbuild/funcs.sh
contrib/lbuild/lbuild
contrib/lbuild/lbuild-rhel9 [new file with mode: 0644]
lustre.spec.in
lustre/ChangeLog
lustre/autoconf/lustre-core.m4
lustre/kernel_patches/targets/5.14-rhel9.0.target.in [new file with mode: 0644]

index 22b115d..c33d6ad 100644 (file)
@@ -169,10 +169,10 @@ autodetect_distro() {
                    version="${version}.$PATCHLEVEL"
            fi
         elif [ -f /etc/redhat-release ]; then
-            #name=$(head -1 /etc/redhat-release)
-            name=rhel
-            version=$(echo "$distroname" |
-                      sed -e 's/^[^0-9.]*//g' | sed -e 's/[ ].*//')
+               #name=$(head -1 /etc/redhat-release)
+               name=rhel
+               version=$(cat /etc/redhat-release |
+                         sed -e 's/^[^0-9.]*//g' | sed -e 's/[ ].*//')
         fi
         if [ -z "$name" -o -z "$version" ]; then
             fatal 1 "I don't know how to determine distro type/version.\nEither update autodetect_distro() or use the --distro argument."
@@ -192,6 +192,7 @@ autodetect_target() {
     case ${distro} in
          rhel7*)  target="3.10-rhel7";;
          rhel8*)  target="4.18-rhel8";;
+       rhel-9.0) target="5.14-rhel9.0";;
         sles11.4) target="$(uname -r | cut -d . -f 1,2)-sles11sp4";;
         sles11.3) target="$(uname -r | cut -d . -f 1,2)-sles11sp3";;
         sles11*)  target="$(uname -r | cut -d . -f 1,2)-sles11";;
index 2a386ab..a95914b 100755 (executable)
@@ -313,20 +313,23 @@ check_options() {
 #               usage 1 "Target '$TARGET' was not found."
     fi
 
-    case $TARGET in
-        3.12-sles12 | 4.4-sles12)
-            CANONICAL_TARGET="sles12"
-            ;;
-        4.18-rhel8*)
-            CANONICAL_TARGET="rhel8"
-            ;;
-        3.10-rhel7*)
-            CANONICAL_TARGET="rhel7"
-            ;;
-        3.0-sles11)
-            CANONICAL_TARGET="sles11"
-            ;;
-    esac
+       case $TARGET in
+               3.12-sles12 | 4.4-sles12)
+                       CANONICAL_TARGET="sles12"
+                       ;;
+               5.14-rhel9*)
+                       CANONICAL_TARGET="rhel9"
+                       ;;
+               4.18-rhel8*)
+                       CANONICAL_TARGET="rhel8"
+                       ;;
+               3.10-rhel7*)
+                       CANONICAL_TARGET="rhel7"
+                       ;;
+               3.0-sles11)
+                       CANONICAL_TARGET="sles11"
+                       ;;
+       esac
 
     local timestampnodig=$(echo $TIMESTAMP | sed -e s/[0-9]*//g)
     [ "$timestampnodig" = "" ] || TIMESTAMP=$(date -d "$DATE" "+%Y%m%d%H%M%S")
@@ -354,7 +357,8 @@ check_options() {
     cat >${BINDIR}/rpmbuild <<EOF
 #!/bin/bash
 
-ARGS="\${FIND_REQUIRES:+--define \"__find_requires \$FIND_REQUIRES\"}"
+ARGS="\${FIND_REQUIRES:+--define \"__find_requires \$FIND_REQUIRES\"}
+\${FIND_KSYMS_REQUIRES:+--define \"__required_ksyms_requires \$FIND_KSYMS_REQUIRES\"}"
 for arg; do
     case \$arg in
     *\'* ) ARGS="\$ARGS \"\$arg\"" ;;
@@ -1318,6 +1322,7 @@ EOF
                if ! $RPMBUILD $BUILD_TYPE --define 'build_kernel_ib 1' \
                        --define 'build_kernel_ib_devel 1' \
                        ${FIND_REQUIRES:+--define "__find_requires $FIND_REQUIRES"} \
+                       ${FIND_KSYMS_REQUIRES:+--define "__required_ksyms_requires $FIND_KSYMS_REQUIRES"} \
                        --define "_topdir ${TOPDIR}" --target ${TARGET_ARCH} \
                        --define "KVERSION ${linuxrelease}" \
                        --define "$K_SRC ${linux}" \
@@ -1331,6 +1336,7 @@ EOF
                mlnx)
                if ! $RPMBUILD $BUILD_TYPE \
                        ${FIND_REQUIRES:+--define "__find_requires $FIND_REQUIRES"} \
+                       ${FIND_KSYMS_REQUIRES:+--define "__required_ksyms_requires $FIND_KSYMS_REQUIRES"} \
                        --define "_topdir ${TOPDIR}" --target ${TARGET_ARCH} \
                        --define "KVERSION ${linuxrelease}" \
                        --define "KMP 1" \
@@ -1772,6 +1778,7 @@ build_with_srpm() {
        # kernel-devel artifacts
        cp $RPM_HELPERS_DIR/{symset-table,find-requires{,.ksyms}} .
        export FIND_REQUIRES="$(pwd)/find-requires"
+       export FIND_KSYMS_REQUIRES="$(pwd)/find-requires.ksyms"
        chmod 755 {symset-table,find-requires{,.ksyms}}
        local tmp="$(pwd)"
        tmp="${tmp//\//\\/}"
diff --git a/contrib/lbuild/lbuild-rhel9 b/contrib/lbuild/lbuild-rhel9
new file mode 100644 (file)
index 0000000..73327e9
--- /dev/null
@@ -0,0 +1,93 @@
+source ${LBUILD_DIR}/lbuild-rhel
+
+# increment this if you have made a change that should force a new kernel
+# to build built
+BUILD_GEN+=".0"
+
+SPEC_NAME="kernel.spec"
+DEVEL_PATH_ARCH_DELIMETER="."
+USE_KABI=false
+
+# force local definition of %dist into ~/.rpmmacros
+# to avoid verbose extended strings like ".el9.centos"
+# in kernel version and rpm names
+#
+RMAC=$HOME/.rpmmacros
+grep '^%dist' $RMAC &> /dev/null || echo '%dist .el9' >> $RMAC
+
+patch_spec_rhel9() {
+       sed -i -e '/Provides: kernel-uname-r =/a\
+Provides: kernel-lustre = %{KVRA}%{?1:.%{1}}\\' \
+              -e '/Provides: kernel-devel-uname-r =/a\
+Provides: kernel-devel-lustre = %{KVRA}%{?1:.%{1}}\\' \
+              -e '/^    find $RPM_BUILD_ROOT\/lib\/modules\/$KernelVer/a\
+       cp -a fs/ext4/* $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/fs/ext4\
+       rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/fs/ext4/ext4-inode-test*' \
+       SPECS/$SPEC_NAME 2>&1 ||
+               fatal 1 "Error while editing SPECS/$SPEC_NAME"
+}
+
+patch_spec() {
+       local buildid="$1"
+
+       # the el9 .spec file requires patch names to begin with "patch-3."
+       # so rename the lustre patch from lbuild to one the .spec will like
+       mv $TOPDIR/SOURCES/linux-${lnxmaj}-lustre.patch \
+               $TOPDIR/SOURCES/patch-${lnxmaj}-lustre.patch
+
+       # edit the SPEC with our changes
+       patch_spec_rhel9 "$buildid"
+       sed -i -e '/^# empty final patch to facilitate testing of kernel patches/i\
+# adds Lustre patches\
+Patch99995: patch-%{version}-lustre.patch' \
+              -e '/^ApplyOptionalPatch linux-kernel-test.patch/i\
+\
+# lustre patch\
+ApplyOptionalPatch patch-%{version}-lustre.patch\
+' \
+               -e '/^# Dynamically generate kernel/a echo "CONFIG_BH_LRU_SIZE=16" >> config-generic'\
+       SPECS/$SPEC_NAME 2>&1 ||
+               fatal 1 "Error while editing SPECS/$SPEC_NAME"
+}
+
+unpack_linux_devel_rpm-rhel9() {
+       local callers_rpm="$1"
+
+       unpack_linux_devel_rpm-rhel "$callers_rpm"
+}
+
+get_rpmbuildopts() {
+       if $KERNEL_LUSTRE_NAMING; then
+               echo -e "--define \"variant -lustre\" \c"
+       fi
+
+       echo "--with firmware --without debug"
+}
+
+find_linux_rpm-rhel9() {
+       local prefix="$1"
+       local wanted_kernel="$2"
+       local pathtorpms=${3:-"$KERNELRPMSBASE/$lnxmaj/$DISTROMAJ/$TARGET_ARCH"}
+
+       find_linux_rpm-rhel "$prefix" "$wanted_kernel" "$pathtorpms"
+}
+
+kernel_srpm_location() {
+       local base_os="http://mirror.stream.centos.org/9-stream/BaseOS"
+
+       echo "$base_os/source/tree/Packages/"
+}
+
+kernel_debuginfo_location() {
+       local base_os="http://mirror.stream.centos.org/9-stream/BaseOS"
+
+       echo "$base_os/$TARGET_ARCH/debug/tree/Packages/"
+}
+
+apply_kmod_requires_conflicts() {
+       if $PATCHLESS; then
+               # don't allow the patched kernel to be considered as
+               # a valid kernel for the patchless client
+               echo "Conflicts:      kernel-lustre" >> rpm/kmp-lustre.preamble
+       fi
+}
index 800d31e..f28007d 100644 (file)
@@ -390,7 +390,7 @@ to be used by the Lustre testing framework.
 %package -n lustre-iokit
 Summary: The Lustre IO-Kit is a collection of benchmark tools for a cluster with the Lustre file system.
 Group: Applications/System
-Requires: python2 > 2.2, sg3_utils
+Requires: python3, sg3_utils
 
 %description -n lustre-iokit
 This package includes five tools:
index 377ed04..7d3d9bf 100644 (file)
@@ -26,6 +26,7 @@ TBD Whamcloud
          vanilla linux 5.4.136  (ZFS + ldiskfs)
        * ldiskfs needs an ldiskfs patch series for that kernel, ZFS does not
        * Client primary kernels built and tested during release cycle:
+         5.14.0-70.22.1.el9   (RHEL9.0)
          4.18.0-372.16.1.el8  (RHEL8.6)
          5.4.0-37             (Ubuntu 20.04)
          5.3.18-59.27         (SLES15 SP3)
index 9adaac6..0379f74 100644 (file)
@@ -3291,6 +3291,7 @@ lustre/doc/Makefile
 lustre/include/Makefile
 lustre/include/lustre/Makefile
 lustre/include/uapi/linux/lustre/Makefile
+lustre/kernel_patches/targets/5.14-rhel9.0.target
 lustre/kernel_patches/targets/4.18-rhel8.6.target
 lustre/kernel_patches/targets/4.18-rhel8.5.target
 lustre/kernel_patches/targets/4.18-rhel8.4.target
diff --git a/lustre/kernel_patches/targets/5.14-rhel9.0.target.in b/lustre/kernel_patches/targets/5.14-rhel9.0.target.in
new file mode 100644 (file)
index 0000000..7ffa25b
--- /dev/null
@@ -0,0 +1,26 @@
+lnxmaj="5.14.0"
+lnxrel="70.22.1.el9_0"
+
+KERNEL_SRPM=kernel-${lnxmaj}-${lnxrel}.src.rpm
+SERIES=""
+EXTRA_VERSION=${lnxrel}_lustre.@VERSION@
+LUSTRE_VERSION=@VERSION@
+
+DEVEL_PATH_ARCH_DELIMETER="."
+OFED_VERSION=inkernel
+
+BASE_ARCHS="i686 x86_64 ia64 ppc64"
+BIGMEM_ARCHS=""
+BOOT_ARCHS=""
+JENSEN_ARCHS=""
+#SMP_ARCHS="i686 x86_64 ia64 ppc64"
+# RHEL8 doesn't use smp specific kernels
+SMP_ARCHS=""
+UP_ARCHS=""
+
+for cc in gcc ; do
+    if which $cc >/dev/null 2>/dev/null ; then
+        export CC=$cc
+        break
+    fi
+done