From a4d146549e8dc63ec4960790a2841db794eb8cb6 Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Tue, 23 Aug 2022 23:07:36 -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 Lustre-change: https://review.whamcloud.com/47847 Lustre-commit: bbe5e9818053e43ebf97e2d3fa240917bfbd8336 Test-Parameters: trivial clientdistro=el9.0 \ env=SANITY_EXCEPT="101j 130 244a" testlist=sanity Test-Parameters: trivial clientdistro=el9.0 \ env=LIPE_FIND_VERBOSE=true testlist=sanity-lipe Test-Parameters: clientdistro=el9.0 testlist=sanity-pcc Test-Parameters: clientdistro=el8.6 testlist=sanity-pcc Change-Id: Ib7fdf9d3946df626759d395b5000b375391da344 Co-Authored-By: Minh Diep Co-Authored-By: Alex Deiter Signed-off-by: Jian Yu Signed-off-by: Minh Diep Signed-off-by: Alex Deiter Reviewed-on: https://review.whamcloud.com/47880 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Yang Sheng Reviewed-by: Andreas Dilger --- contrib/lbuild/funcs.sh | 9 ++- contrib/lbuild/lbuild | 37 +++++---- contrib/lbuild/lbuild-rhel9 | 93 ++++++++++++++++++++++ lustre/ChangeLog | 1 + lustre/autoconf/lustre-core.m4 | 1 + .../kernel_patches/targets/5.14-rhel9.0.target.in | 26 ++++++ 6 files changed, 148 insertions(+), 19 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 bcd7749..f448e03 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 b9f276c..c050683 100755 --- a/contrib/lbuild/lbuild +++ b/contrib/lbuild/lbuild @@ -310,20 +310,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") @@ -351,7 +354,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/ChangeLog b/lustre/ChangeLog index 58af697..04609fb 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -41,6 +41,7 @@ 4.18.0-305.25.1.el8 (RHEL8.4) 4.18.0-348.23.1.el8 (RHEL8.5) 4.18.0-372.16.1.el8 (RHEL8.6) + 5.14.0-70.22.1.el9 (RHEL9.0) 4.4.120-92.70 (SLES12 SP2) 4.4.180-94.100 (SLES12 SP3) 4.4.0-131 (Ubuntu 16.04) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 6426cdc..040a39f 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -3116,6 +3116,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