From bbe5e9818053e43ebf97e2d3fa240917bfbd8336 Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Mon, 15 Aug 2022 08:50:52 -0700 Subject: [PATCH] LU-15874 kernel: new kernel [RHEL 9.0 5.14.0-70.22.1.el9_0] 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 Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/47847 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Sebastien Buisson Reviewed-by: Yang Sheng Reviewed-by: Oleg Drokin --- contrib/lbuild/funcs.sh | 9 ++- contrib/lbuild/lbuild | 37 +++++---- contrib/lbuild/lbuild-rhel9 | 93 ++++++++++++++++++++++ lustre.spec.in | 2 +- lustre/ChangeLog | 1 + lustre/autoconf/lustre-core.m4 | 1 + .../kernel_patches/targets/5.14-rhel9.0.target.in | 26 ++++++ 7 files changed, 149 insertions(+), 20 deletions(-) create mode 100644 contrib/lbuild/lbuild-rhel9 create mode 100644 lustre/kernel_patches/targets/5.14-rhel9.0.target.in diff --git a/contrib/lbuild/funcs.sh b/contrib/lbuild/funcs.sh index 22b115d..c33d6ad 100644 --- a/contrib/lbuild/funcs.sh +++ b/contrib/lbuild/funcs.sh @@ -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";; diff --git a/contrib/lbuild/lbuild b/contrib/lbuild/lbuild index 2a386ab..a95914b 100755 --- a/contrib/lbuild/lbuild +++ b/contrib/lbuild/lbuild @@ -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 < /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 +} diff --git a/lustre.spec.in b/lustre.spec.in index 800d31e..f28007d 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -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: diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 377ed04..7d3d9bf 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -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) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 9adaac6..0379f74 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -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 index 0000000..7ffa25b --- /dev/null +++ b/lustre/kernel_patches/targets/5.14-rhel9.0.target.in @@ -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 -- 1.8.3.1