Whamcloud - gitweb
LU-4416 build: add build files for SLES 12 client build 32/14532/14
authorBob Glossman <bob.glossman@intel.com>
Tue, 21 Apr 2015 22:37:34 +0000 (15:37 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 5 Jun 2015 01:41:46 +0000 (01:41 +0000)
minimum changes to allow building SLES 12 clients
target and lbuild

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I9e3ab4a597f3e48658de01b1eeee150eeddadf2d
Reviewed-on: http://review.whamcloud.com/14532
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
contrib/lbuild/Makefile.am
contrib/lbuild/funcs.sh
contrib/lbuild/lbuild
contrib/lbuild/lbuild-sles12 [new file with mode: 0644]
lustre/ChangeLog
lustre/autoconf/lustre-core.m4
lustre/kernel_patches/series/3.12-sles12.series [new file with mode: 0644]
lustre/kernel_patches/targets/3.12-sles12.target.in [new file with mode: 0644]

index 573f3a1..5615cd0 100644 (file)
@@ -1,5 +1,5 @@
 EXTRA_DIST = lbuild
 EXTRA_DIST += lbuild-fc lbuild-fc11 lbuild-fc12 lbuild-fc15
 EXTRA_DIST += lbuild-rhel lbuild-rhel5 lbuild-rhel6 lbuild-rhel7
 EXTRA_DIST = lbuild
 EXTRA_DIST += lbuild-fc lbuild-fc11 lbuild-fc12 lbuild-fc15
 EXTRA_DIST += lbuild-rhel lbuild-rhel5 lbuild-rhel6 lbuild-rhel7
-EXTRA_DIST += lbuild-sles lbuild-sles10 lbuild-sles11
+EXTRA_DIST += lbuild-sles lbuild-sles10 lbuild-sles11 lbuild-sles12
 EXTRA_DIST += funcs.sh exit_traps.sh find_linux_rpms
 EXTRA_DIST += funcs.sh exit_traps.sh find_linux_rpms
index d26f1bb..56a7089 100644 (file)
@@ -140,9 +140,11 @@ autodetect_distro() {
                 ;;
             "SUSE LINUX")
                 name="sles"
                 ;;
             "SUSE LINUX")
                 name="sles"
-                PATCHLEVEL=$(sed -n -e 's/^PATCHLEVEL = //p' /etc/SuSE-release)
-                version="${version}.$PATCHLEVEL"
-                ;;
+               PATCHLEVEL=$(sed -n -e 's/^PATCHLEVEL = //p' /etc/SuSE-release)
+               if [ "$PATCHLEVEL" -ne "0" ]; then
+                       version="${version}.$PATCHLEVEL"
+               fi
+               ;;
             "Fedora")
                 name="fc"
                 ;;
             "Fedora")
                 name="fc"
                 ;;
@@ -156,8 +158,10 @@ autodetect_distro() {
         if [ -f /etc/SuSE-release ]; then
             name=sles
             version=$(sed -n -e 's/^VERSION = //p' /etc/SuSE-release)
         if [ -f /etc/SuSE-release ]; then
             name=sles
             version=$(sed -n -e 's/^VERSION = //p' /etc/SuSE-release)
-            PATCHLEVEL=$(sed -n -e 's/^PATCHLEVEL = //p' /etc/SuSE-release)
-            version="${version}.$PATCHLEVEL"
+           PATCHLEVEL=$(sed -n -e 's/^PATCHLEVEL = //p' /etc/SuSE-release)
+           if [ "$PATCHLEVEL" -ne "0" ]; then
+                   version="${version}.$PATCHLEVEL"
+           fi
         elif [ -f /etc/redhat-release ]; then
             #name=$(head -1 /etc/redhat-release)
             name=rhel
         elif [ -f /etc/redhat-release ]; then
             #name=$(head -1 /etc/redhat-release)
             name=rhel
@@ -188,6 +192,7 @@ autodetect_target() {
         sles10*)  target="2.6-sles10";;
         sles11.3) target="$(uname -r | cut -d . -f 1,2)-sles11sp3";;
         sles11*)  target="$(uname -r | cut -d . -f 1,2)-sles11";;
         sles10*)  target="2.6-sles10";;
         sles11.3) target="$(uname -r | cut -d . -f 1,2)-sles11sp3";;
         sles11*)  target="$(uname -r | cut -d . -f 1,2)-sles11";;
+       sles12*)  target="$(uname -r | cut -d . -f 1,2)-sles12";;
           fc15)   target="2.6-fc15";;
           fc18)   target="3.x-fc18";;
              *)   fatal 1 "I don't know what distro $distro is.\nEither update autodetect_target() or use the --target argument.";;
           fc15)   target="2.6-fc15";;
           fc18)   target="3.x-fc18";;
              *)   fatal 1 "I don't know what distro $distro is.\nEither update autodetect_target() or use the --target argument.";;
index 06e08e1..7de6716 100755 (executable)
@@ -285,6 +285,9 @@ check_options() {
     fi
 
     case $TARGET in
     fi
 
     case $TARGET in
+        3.12-sles12)
+            CANONICAL_TARGET="sles12"
+            ;;
         3.10-rhel7)
             CANONICAL_TARGET="rhel7"
             ;;
         3.10-rhel7)
             CANONICAL_TARGET="rhel7"
             ;;
diff --git a/contrib/lbuild/lbuild-sles12 b/contrib/lbuild/lbuild-sles12
new file mode 100644 (file)
index 0000000..e2343f2
--- /dev/null
@@ -0,0 +1,118 @@
+# 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
+# LU-6490 work around
+CONFIGURE_FLAGS="$CONFIGURE_FLAGS --disable-gss"
+
+edit_specs() {
+
+    # edit the SPECs with our changes
+    local spec
+    (cd $TOPDIR/SOURCES; ./mkspec --release ${lnxrel})
+    for spec in $RPMSMPTYPE source; do
+        #cp $TOPDIR/SOURCES/kernel-$spec.spec{,.orig}
+        sed -i -e "s/^\(Release: *\).*$/\1${lnxrel}_${buildid}/" \
+               -e '/^%setup /a\
+cp  %_sourcedir/linux-3.0-lustre.patch %_builddir/%{name}-%{version}/lustre.patch\
+! grep -q lustre.patch %_sourcedir/series.conf && echo -e "\\n\\tlustre.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
+
+        # XXX - a building-on-Ubuntu hack
+        if grep -q "Ubuntu" /etc/issue; then
+            sed -i -e '/^%_sourcedir\/install-configs %_sourcedir .*/i\
+curl ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.17/2.6.17-mm1/broken-out/i386-use-c-code-for-current_thread_info.patch | patch -p1' \
+                   -e 's/^\(BuildRequires: .*\)$/#NOU \1/g' \
+                   -e 's/%(\(chmod .*\))$/%(bash -c "\1")/' \
+                   -e 's/ -a 109//' \
+              SOURCES/kernel-${spec}.spec || \
+            fatal 1 "Error while editing SOURCES/kernel-${spec}.spec"
+        fi
+    done
+}
+
+unpack_linux_devel_rpm-sles12() {
+    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 ! 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-sles12() {
+    local prefix="$1"
+    local wanted_kernel="$2"
+    local pathtorpms=${3:-"$KERNELRPMSBASE/$lnxmaj/$DISTROMAJ/$TARGET_ARCH"}
+
+    local PLEV=$(sed -n -e 's/^PATCHLEVEL = //p' /etc/SuSE-release)
+    local site="https://nu.novell.com/repo/\$RCE/SLES12-SP${PLEV}-Updates/sle-12-$(resolve_arch $TARGET_ARCH)/rpm/$(resolve_arch $TARGET_ARCH)"
+    if [ ! -f $pathtorpms/kernel-default-devel-$wanted_kernel.$(resolve_arch $TARGET_ARCH).rpm ]; then
+        fetch_url "$site/kernel-default-devel-$wanted_kernel.$(resolve_arch $TARGET_ARCH).rpm" $pathtorpms
+    fi
+    # SLES also needs the kernel-source along with kernel-devel
+    if [ ! -f $pathtorpms/kernel-source-$wanted_kernel.$(resolve_arch $TARGET_ARCH).rpm ]; then
+        fetch_url "$site/kernel-source-$wanted_kernel.$(resolve_arch $TARGET_ARCH).rpm" $pathtorpms
+    fi
+    echo "kernel-default-devel-$wanted_kernel.$(resolve_arch $TARGET_ARCH).rpm"
+
+    return 0
+
+}
index 4d2b125..d632164 100644 (file)
@@ -12,6 +12,7 @@ TBD Intel Corporation
          2.6.32-504.16.2.el6 (RHEL6.6)
          3.10.0-229.4.2.el7  (RHEL7.1)
          3.0.101-0.47.52     (SLES11 SP3)
          2.6.32-504.16.2.el6 (RHEL6.6)
          3.10.0-229.4.2.el7  (RHEL7.1)
          3.0.101-0.47.52     (SLES11 SP3)
+         3.12.39-47          (SLES12)
        * Recommended e2fsprogs version: 1.42.9.wc1 or newer
        * NFS export disabled when stack size < 8192 (32-bit Lustre clients),
          since the NFSv4 export of Lustre filesystem with 4K stack may cause a
        * Recommended e2fsprogs version: 1.42.9.wc1 or newer
        * NFS export disabled when stack size < 8192 (32-bit Lustre clients),
          since the NFSv4 export of Lustre filesystem with 4K stack may cause a
index 37f1fe9..4b65c12 100644 (file)
@@ -2114,6 +2114,7 @@ lustre/kernel_patches/targets/2.6-rhel5.target
 lustre/kernel_patches/targets/2.6-sles11.target
 lustre/kernel_patches/targets/3.0-sles11.target
 lustre/kernel_patches/targets/3.0-sles11sp3.target
 lustre/kernel_patches/targets/2.6-sles11.target
 lustre/kernel_patches/targets/3.0-sles11.target
 lustre/kernel_patches/targets/3.0-sles11sp3.target
+lustre/kernel_patches/targets/3.12-sles12.target
 lustre/kernel_patches/targets/2.6-fc11.target
 lustre/kernel_patches/targets/2.6-fc12.target
 lustre/kernel_patches/targets/2.6-fc15.target
 lustre/kernel_patches/targets/2.6-fc11.target
 lustre/kernel_patches/targets/2.6-fc12.target
 lustre/kernel_patches/targets/2.6-fc15.target
diff --git a/lustre/kernel_patches/series/3.12-sles12.series b/lustre/kernel_patches/series/3.12-sles12.series
new file mode 100644 (file)
index 0000000..b19b544
--- /dev/null
@@ -0,0 +1,4 @@
+raid5-mmp-unplug-dev-3.7.patch
+dev_read_only-3.7.patch
+blkdev_tunables-3.7.patch
+bh_lru_size_increase.patch
diff --git a/lustre/kernel_patches/targets/3.12-sles12.target.in b/lustre/kernel_patches/targets/3.12-sles12.target.in
new file mode 100644 (file)
index 0000000..6c6386b
--- /dev/null
@@ -0,0 +1,37 @@
+lnxmaj="3.12"
+lnxmin=".39"
+lnxrel="47"
+# 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=3.12-sles12.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