. $O2IBPATH/ofed_patch.mk
fi
if test -n "$BACKPORT_INCLUDES"; then
- OFED_BACKPORT_PATH=`echo $BACKPORT_INCLUDES | sed "s#.*/src/ofa_kernel/#$O2IBPATH/#"`
+ OFED_BACKPORT_PATH="$O2IBPATH/${BACKPORT_INCLUDES/*\/kernel_addons/kernel_addons}/"
EXTRA_LNET_INCLUDE="-I$OFED_BACKPORT_PATH $EXTRA_LNET_INCLUDE"
AC_MSG_RESULT([yes])
else
--enable-rdac
Enables the building of MPTLINUX with the same kernel Lustre is
built with.
+
+ --set-value
+ Set's a variable to a given value.
+
EOF
# list_targets
local linux="$1"
local ofed_version="$2"
- # before lustre, build kernel-ib
+ # if an ofed version is given, then it means use OFED proper,
+ # not any vendor specific "inkernel" version
if [ -z "$ofed_version" -o "$ofed_version" = "inkernel" ]; then
+ # first see if there is a distro specific override for this
+ # XXX we need to better integrate an distro specific override with
+ # the rest of this function so that all of the reuse cache
+ # stuff is leveraged given that 80% of this function is reuse
+ if type -p build_ofed-${DISTRO}; then
+ local ofed_location
+ ofed_location=$(build_ofed-${DISTRO} ${STDOUT})
+ CONFIGURE_FLAGS="--with-o2ib=${ofed_location} ${CONFIGURE_FLAGS}"
+ return ${PIPESTATUS[0]}
+ fi
+ else
return 0
fi
-
+
+ # build kernel-ib
if $USE_BUILD_CACHE && [ -n "$REUSEBUILD" ]; then
local REUSE_SIGNATURE=$({ echo "$ofed_version";
echo "$(find_linux_release ${linux})";
ofed_version=$(echo $ofed_version |
sed -re 's/-(20[0-9]{6,6}-[0-9]{4,4}|rc[0-9]*)$//')
local rpm=$(ls $TOPDIR/RPMS/*/kernel-ib-devel-${ofed_version}-${linuxrelease//-/_}.*.rpm)
- rpm2cpio -itv < $rpm | cpio -id
+ if ! rpm2cpio < $rpm | cpio -id; then
+ fatal 1 "could not unpack the kernel-ib-devel rpm."
+ fi
CONFIGURE_FLAGS="--with-o2ib=$(pwd)/usr/src/ofa_kernel ${CONFIGURE_FLAGS}"
popd >/dev/null
# in RPMS/$arch to real files so that that that huge mess of
# complication known as LTS can copy them yet somewhere else.
# is it any wonder this whole process is so damn so? anyone ever
- # heard of hardlinks? it this cool new thing that allows you save
+ # heard of hardlinks? it's this cool new thing that allows you save
# tons of time and space by creating... well you can go read about
# them if you have not heard about them yet.
# can i say how much the implemenation of all of this really impedes
# RPM reuse?
- pushd RPMS/$TARGET_ARCH
- for file in *; do
- if [ -h $file ]; then
- cp $file foo
- mv foo $file
- fi
+ local dir
+ for dir in RPMS/*; do
+ pushd $dir
+ for file in *; do
+ if [ -h $file ]; then
+ cp $file foo
+ mv foo $file
+ fi
+ done
done
popd
+ # also, for i?86, make sure all of the RPMs are in RPMS/$TARGET_ARCH
+ # as that's where LTS expects to find them
+ for dir in RPMS/*; do
+ if [ $dir = RPMS/$TARGET_ARCH ]; then
+ continue
+ fi
+ pushd $dir
+ local files=$(ls)
+ if [ -n "$files" ]; then
+ cp -al $files ../$TARGET_ARCH
+ fi
+ popd
+ done
else
return 1
fi
resolve_arch() {
local arch="$1"
+ # because we build an i686 kernel, we need to know if the arch we are
+ # resolving for is for the patched or patchless kernel (which is i586)
+ # we really should be building an i586 kernel to match what Novell does
+ local for_patchless=${2:-true}
+ local canonical=${3:-false}
case $arch in
ppc64) arch=powerpc
;;
- i686) arch=i386
+ i?86) if $canonical; then
+ arch=i386
+ elif $for_patchless; then
+ arch=i586
+ fi
;;
esac
local path="$1"
LINUX=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}
- LINUXOBJ=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$(resolve_arch $TARGET_ARCH)/$RPMSMPTYPE
+ LINUXOBJ=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$(resolve_arch $TARGET_ARCH $PATCHLESS)/$RPMSMPTYPE
# XXX this has been commented out in th rhel5 build file for a while
# as it says there, it's probably not needed anymore and can be deleted
#LINUXRELEASE=$(find_linux_release "$LINUXOBJ")
source ${0%/*}/lbuild-sles
+# the location of the ofed-devel-<version>.<arch>.rpm
+OFED_DEVEL_LOCATION="$KERNELTREE"
+
+# do we want to rebuild the OFED devel RPM or use the supplied one?
+REBUILD_OFED_DEVEL_RPM=${REBUILD_OFED_DEVEL_RPM:-false}
+
edit_specs() {
# edit the SPECs with our changes
# get the Module.symvers out of the kenrel-flavor RPM
local kernelrpm=${callers_rpm/-source-/-$RPMSMPTYPE-}
- if ! rpm2cpio < "$kernelrpm" | cpio -id ./usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$(resolve_arch $TARGET_ARCH)/$RPMSMPTYPE/Module.symvers ./boot/sym\* > /dev/null 2>&1; then
+ if ! rpm2cpio < "$kernelrpm" | cpio -id ./usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$(resolve_arch $TARGET_ARCH $PATCHLESS true)/$RPMSMPTYPE/Module.symvers ./boot/sym\* > /dev/null 2>&1; then
return 255
fi
# now just sanity check that everything needed to build properly versioned
# modules is in place
- if [ ! -f usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$(resolve_arch $TARGET_ARCH)/$RPMSMPTYPE/Module.symvers && ! -f usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$TARGET_ARCH/$RPMSMPTYPE/Module.symvers ]; then
+ if [ ! -f usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$(resolve_arch $TARGET_ARCH $PATCHLESS true)/$RPMSMPTYPE/Module.symvers ]; then
fatal 1 "cannot build kernel modules: the Kernel's Module.symvers is missing."
fi
if [ ! -f boot/symsets-${lnxmaj}${lnxmin}-${lnxrel}-$RPMSMPTYPE.tar.gz ]; then
return 0
}
+
+build_sles_ofed_rpm() {
+ local variant="${1:+-$1}"
+ local add_spec_edit="$2"
+
+ if $REBUILD_OFED_DEVEL_RPM; then
+ #
+ # rebuild the $variant rpm
+ #
+
+ local SOURCE="${KERNELTREE}/ofed${variant}-${OFED_DEVEL_VERSION}.src.rpm"
+
+ local targets
+ for arch in $BUILD_ARCHS; do
+ targets="--target $(resolve_arch $arch $PATCHLESS) $targets"
+ done
+ if ! $RPMBUILD --rebuild --nodeps $targets \
+ --define "symsetsdir ${TOPDIR}/reused/boot" \
+ --define "kobjdir ${LINUXOBJ%/*/*}" \
+ --define "_tmppath /var/tmp" \
+ --define "_topdir ${TOPDIR}" \
+ ${SOURCE} 2>&1; then
+ return 255
+ fi
+ fi # $REBUILD_OFED_DEVEL_RPM; then
+
+}
+
+# additional edits need to the ofed spec
+edit_spec_ofed() {
+
+ ed ofed.spec <<"EOF"
+/^# we assume config.mk and the include files are same for all flavors/a
+built_flavors=(%flavors_to_build)
+.
+/^cp obj\/default\/config\.mk \$RPM_BUILD_ROOT\/%{_prefix}\/src\/kernel-modules-ofed/c
+cp obj/${built_flavors[0]}/config.mk $RPM_BUILD_ROOT/%{_prefix}/src/kernel-modules-ofed
+.
+/^for D in obj\/default\\\\include \$(sed 's@^.*-I\\\${CWD}\/@obj\/default\\\\@' obj\/default\/config.mk); do/c
+for D in obj/${built_flavors[0]}\\include $(sed "s@^.*-I\${CWD}/@obj/${built_flavors[0]}\\\@" obj/${built_flavors[0]}/config.mk); do
+.
+wq
+EOF
+
+}
+
+build_ofed-sles10() {
+ local outfd=$1
+
+ if [ -z "$outfd" ] || [ $outfd = 1 ]; then
+ fatal 1 "You must supply a file descriptor to ${FUNCNAME[0]} and it cannot be 1"
+ fi
+
+ if $REBUILD_OFED_DEVEL_RPM; then
+ build_sles_ofed_rpm cxgb3-NIC >&${outfd} || return ${PIPESTATUS[0]}
+ build_sles_ofed_rpm >&${outfd} || return ${PIPESTATUS[0]}
+ OFED_DEVEL_LOCATION="${TOPDIR}/RPMS/$(resolve_arch $TARGET_ARCH $PATCHLESS)"
+ fi # $REBUILD_OFED_DEVEL_RPM; then
+
+ # XXX I'm not convinced this belongs in here, but really, this is a
+ # temporary hack until we get a base O/S intalled ofed-devel
+ local arch=$TARGET_ARCH
+ if [ -n "$OFED_VERSION" -a "$OFED_VERSION" = "inkernel" ]; then
+ local ofed_devel="${OFED_DEVEL_LOCATION}/ofed-devel-${OFED_DEVEL_VERSION}.$(resolve_arch $TARGET_ARCH $PATCHLESS).rpm"
+ if ! rpm2cpio < $ofed_devel | cpio -id; then
+ fatal 1 "could not unpack the ofed-devel rpm."
+ fi
+ echo "$(pwd)/usr/src/kernel-modules-ofed/$(resolve_arch $TARGET_ARCH $PATCHLESS)/$RPMSMPTYPE"
+ fi
+
+ return 0
+
+}
#
# InfiniBand support
#
-# CONFIG_INFINIBAND is not set
+CONFIG_INFINIBAND=m
+CONFIG_INFINIBAND_USER_MAD=m
+CONFIG_INFINIBAND_USER_ACCESS=m
+CONFIG_INFINIBAND_MTHCA=m
+CONFIG_INFINIBAND_MTHCA_DEBUG=y
+CONFIG_INFINIBAND_IPOIB=m
+CONFIG_INFINIBAND_IPOIB_DEBUG=y
+# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
+CONFIG_INFINIBAND_SRP=m
+
#
# DMA Engine support
#
# InfiniBand support
#
-# CONFIG_INFINIBAND is not set
+CONFIG_INFINIBAND=m
+CONFIG_INFINIBAND_USER_MAD=m
+CONFIG_INFINIBAND_USER_ACCESS=m
+CONFIG_INFINIBAND_MTHCA=m
+CONFIG_INFINIBAND_MTHCA_DEBUG=y
+CONFIG_INFINIBAND_IPOIB=m
+CONFIG_INFINIBAND_IPOIB_DEBUG=y
+# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
+CONFIG_INFINIBAND_SRP=m
+
#
# DMA Engine support
EXTRA_VERSION="${lnxmin#.}-${lnxrel}_lustre.@VERSION@"
LUSTRE_VERSION=@VERSION@
-OFED_VERSION=1.5.2
+OFED_VERSION=inkernel
+# if using "inkernel" on sles10, we need to know which version of ofed-devel
+# to use
+OFED_DEVEL_VERSION="1.4.2-0.8.4.1682.0.PTF.578796"
RDAC_VERSION="09.03.0C02.0013"
MPTLINUX_VERSION="4.18.20.04"