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."
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";;
# 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")
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\"" ;;
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}" \
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" \
# 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//\//\\/}"
--- /dev/null
+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
+}
%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:
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)
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
--- /dev/null
+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