Whamcloud - gitweb
LU-11310 kernel: new kernel [SLES15 SP1 4.12.14-197.29] 93/32693/14
authorShaun Tancheff <stancheff@cray.com>
Sun, 1 Mar 2020 07:08:45 +0000 (23:08 -0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 11 Mar 2020 02:10:20 +0000 (02:10 +0000)
This patch makes changes to support new SLES15 SP1 release
with kernel 4.12.14-197.29 for Lustre client.

Test-Parameters: trivial \
envdefinitions=SANITY_EXCEPT="100 130 136 817" \
clientdistro=sles15sp1 serverdistro=el7.7 \
testlist=sanity

Cray-bug-id: LUS-6001
Signed-off-by: Chris Horn <hornc@cray.com>
Signed-off-by: Shaun Tancheff <stancheff@cray.com>
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Change-Id: I07d4dce16f7a01744c7776c826ba738ace83e58f
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/32693
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
contrib/lbuild/funcs.sh
contrib/lbuild/lbuild-sles15 [new file with mode: 0644]
lustre/ChangeLog
lustre/autoconf/lustre-core.m4
lustre/kernel_patches/targets/4.12-sles15sp1.target.in [new file with mode: 0644]

index 2f864ae..698a55f 100644 (file)
@@ -198,6 +198,7 @@ autodetect_target() {
         sles12.4) target="$(uname -r | cut -d . -f 1,2)-sles12sp4";;
         sles12.3) target="$(uname -r | cut -d . -f 1,2)-sles12sp3";;
         sles12*)  target="$(uname -r | cut -d . -f 1,2)-sles12";;
+        sles15.1) target="$(uname -r | cut -d . -f 1,2)-sles15sp1";;
           fc18)   target="3.x-fc18";;
              *)   fatal 1 "I don't know what distro $distro is.\nEither update autodetect_target() or use the --target argument.";;
     esac
diff --git a/contrib/lbuild/lbuild-sles15 b/contrib/lbuild/lbuild-sles15
new file mode 100644 (file)
index 0000000..1d5a038
--- /dev/null
@@ -0,0 +1,124 @@
+# vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
+
+# increment this if you have made a change that should force a new kernel
+# to build built for this distribution (only -- if you want to force a kernel
+# build on all distributions, update the BUILD_GEN variable in build/lbuild)
+BUILD_GEN+=".0"
+
+# This distro does not support zfs, so define WITH_ZFS
+# use words that make the bash log readable.
+WITH_ZFS="Zfs Not Supported"
+
+source ${LBUILD_DIR}/lbuild-sles
+
+kernel_srpm_location() {
+    local site
+    site="http://mgmt/cobbler/repo_mirror/updates-sles15.1-src"
+    echo "$site/src/"
+}
+
+edit_specs() {
+    # edit the SPECs with our changes
+    local spec
+    (cd $TOPDIR/SOURCES; ./mkspec --release ${lnxrel})
+    for spec in $RPMSMPTYPE source syms; do
+        #cp $TOPDIR/SOURCES/kernel-$spec.spec{,.orig}
+        sed -i -e "s/^\(Release: *\).*$/\1${lnxrel}_${buildid}/" \
+               -e '/^%setup /a\
+cp  %_sourcedir/linux-4.12-lustre.patch %_builddir/%{name}-%{version}/intel.lustre.patch\
+grep -q intel.lustre.patch %_sourcedir/series.conf || echo -e "\\n\\tintel.lustre.patch" >> %_sourcedir/series.conf' \
+          SOURCES/kernel-${spec}.spec || \
+            fatal 1 "Error while editing SOURCES/kernel-${spec}.spec"
+
+        if $KERNEL_LUSTRE_NAMING; then
+            # these are all of the changes needed because we change the package names
+            # to kernel-lustre-*.  these should all go away when we stop this insanity
+            sed -i -e 's/^\(Name:.*kernel-\)\(.*\)/\1lustre-\2/' \
+                   -e "/^Provides:  *kernel = /a\
+Provides:       kernel-$spec = %{version}-%{release}
+" \
+                   -e 's/^\([  ][      ]*-i %_builddir\/kernel-\)\(source-2.6.27.21\/\$patch; then\)/\1lustre-\2/' \
+                   -e '/^%build/,/^%changelog/s/\(kernel-\)\(source\.files\)/\1lustre-\2/g' \
+                   -e '/--no-backup-if-mismatch/,/fi/s/kernel-source-/kernel-lustre-source-/g' \
+                   -e "s/^\(%package -n kernel-\)\(.*\)/\1lustre-\2/" \
+                   -e "s/^\(%description -n kernel-\)\(.*\)/\1lustre-\2/" \
+                   -e "s/^\(%files -n kernel-\)\(.*\)/\1lustre-\2/" \
+                   -e "s/^\(Provides:.*kernel-\)\(.*\)/\1lustre-\2/" \
+                   -e "s/^\(Requires:.*kernel-\)\(.*\)/\1lustre-\2/" \
+                   -e "s/^\(Supplements:.*kernel-\)\(.*\)/\1lustre-\2/" \
+                SOURCES/kernel-${spec}.spec || \
+                fatal 1 "Error while editing SOURCES/kernel-${spec}.spec"
+        fi
+    done
+}
+
+unpack_linux_devel_rpm-sles15() {
+    local callers_rpm="$1"
+
+    local rpmdir="${callers_rpm%/*}"
+
+    local kernelrpm
+    local wanted_kernel="${lnxmaj}${lnxmin}-${lnxrel}"
+
+    # this is a hack that should go away when the modified lustre kernel
+    # Provides kernel-default-devel                       vvvvvvvvv
+    if ! kernelrpm=$(find_rpm "$rpmdir" provides "^kernel-(lustre-)?default-devel = $wanted_kernel"); then
+        fatal 1 "Could not find the kernel-default-devel in $rpmdir/"
+    fi
+
+    if ! rpm2cpio < "$rpmdir/$kernelrpm" | cpio -id > /dev/null 2>&1; then
+        fatal 1 "Unpack error for $kernelrpm"
+    fi
+
+    if [ -d "${rpmdir}/../noarch" ]; then
+       rpmdir="${rpmdir%/*}"
+       rpmdir="${rpmdir}/noarch"
+    fi
+
+    if ! kernelrpm=$(find_rpm "$rpmdir" provides "^kernel-(lustre-)?devel = $wanted_kernel"); then
+        fatal 1 "Could not find the kernel-devel in $rpmdir/"
+    fi
+
+    if ! rpm2cpio < "$rpmdir/$kernelrpm" | cpio -id > /dev/null 2>&1; then
+        fatal 1 "Unpack error for $kernelrpm"
+    fi
+
+    # SLES also needs the kernel-source together with the kernel-default-devel
+    if ! kernelrpm=$(find_rpm "$rpmdir" provides "^kernel-source = $wanted_kernel"); then
+        fatal 1 "Could not find the kernel-source in $rpmdir/"
+    fi
+
+    if ! rpm2cpio < "$rpmdir/$kernelrpm" | cpio -id > /dev/null 2>&1; then
+        fatal 1 "Unpack error for $kernelrpm"
+    fi
+
+}
+
+find_linux_rpm-sles15() {
+    local prefix="$1"
+    local wanted_kernel="$2"
+    local pathtorpms=${3:-"$KERNELRPMSBASE/$lnxmaj/$DISTROMAJ/$TARGET_ARCH"}
+    local wanted_kernel_org="$wanted_kernel"
+
+    if [ "x$rpmfix_diff" != "x" ] && [ $wanted_kernel != "${lnxmaj}${lnxmin}-${lnxrel}${rpmfix_diff}" ]; then
+        wanted_kernel="${lnxmaj}${lnxmin}-${lnxrel}${rpmfix_diff}"
+    fi
+
+    local base_site="http://mgmt/cobbler/repo_mirror/updates-basesystem-sles15.1-x86_64"
+    local dev_site="http://mgmt/cobbler/repo_mirror/updates-devtools-sles15.1-x86_64"
+
+    if [ ! -f $pathtorpms/kernel-default-devel-$wanted_kernel.$(resolve_arch $TARGET_ARCH).rpm ]; then
+        fetch_url "$base_site/x86_64/kernel-default-devel-$wanted_kernel.$(resolve_arch $TARGET_ARCH).rpm" $pathtorpms
+    fi
+    # SLES 15 also needs kernel-devel in addition to kernel-default-devel
+    if [ ! -f $pathtorpms/kernel-devel-$wanted_kernel_org.noarch.rpm ]; then
+        fetch_url "$base_site/noarch/kernel-devel-$wanted_kernel_org.noarch.rpm" $pathtorpms
+    fi
+    # SLES also needs the kernel-source along with kernel-devel
+    if [ ! -f $pathtorpms/kernel-source-$wanted_kernel_org.noarch.rpm ]; then
+        fetch_url "$dev_site/noarch/kernel-source-$wanted_kernel_org.noarch.rpm" $pathtorpms
+    fi
+    echo "kernel-default-devel-$wanted_kernel.$(resolve_arch $TARGET_ARCH).rpm"
+
+    return 0
+}
index 487b2e1..dfb5fa8 100644 (file)
@@ -18,6 +18,7 @@ TBD Whamcloud
        * Client primary unpatched kernels built and tested during release cycle:
          3.10.0-1062.9.1.el7 (RHEL7.7)
          4.12.14-95.45       (SLES12 SP4)
+         4.12.14-197.29      (SLES15 SP1)
          4.15.0-48           (Ubuntu 18.04)
        * Other clients known to build on unpatched kernels at some point (others may also work):
          3.10.0-862.14.4.el7 (RHEL7.5)
index 0c3c3db..1e23d85 100644 (file)
@@ -2695,6 +2695,7 @@ lustre/kernel_patches/targets/3.12-sles12.target
 lustre/kernel_patches/targets/4.4-sles12.target
 lustre/kernel_patches/targets/4.4-sles12sp3.target
 lustre/kernel_patches/targets/4.12-sles12sp4.target
+lustre/kernel_patches/targets/4.12-sles15sp1.target
 lustre/kernel_patches/targets/3.x-fc18.target
 lustre/ldlm/Makefile
 lustre/fid/Makefile
diff --git a/lustre/kernel_patches/targets/4.12-sles15sp1.target.in b/lustre/kernel_patches/targets/4.12-sles15sp1.target.in
new file mode 100644 (file)
index 0000000..7230bb4
--- /dev/null
@@ -0,0 +1,37 @@
+lnxmaj="4.12"
+lnxmin=".14"
+lnxrel="197.29"
+# use this when there is an "RPM fix" which means that the name of the
+# (source) RPM has been updated but the version of the kernel inside the
+# RPM is not also updated
+rpmfix=".1"
+
+# this is the delimeter that goes before the "smp" at the end of the version
+# defaults to empty
+FLAVOR_DELIMITER="-"
+
+KERNEL_SRPM=kernel-source-${lnxmaj}${lnxmin}-${lnxrel}${rpmfix}.src.rpm
+SERIES=""
+VERSION=$lnxmaj
+EXTRA_VERSION="${lnxmin#.}-${lnxrel}_lustre.@VERSION@"
+LUSTRE_VERSION=@VERSION@
+
+OFED_VERSION=inkernel
+
+BASE_ARCHS="i686 ppc x86_64 ia64 ppc64"
+BIGMEM_ARCHS=""
+BOOT_ARCHS=""
+JENSEN_ARCHS=""
+DEFAULT_ARCHS="i686 x86_64 ia64 ppc64"
+BIGSMP_ARCHS=""
+PSERIES64_ARCHS="ppc"
+UP_ARCHS=""
+SRC_ARCHS=""
+#RPMSMPTYPE="smp"
+
+for cc in gcc ; do
+    if which $cc >/dev/null 2>/dev/null ; then
+        export CC=$cc
+        break
+    fi
+done