+ CONFIGURE_FLAGS="--with-o2ib=$(pwd)/usr/src/ofa_kernel ${CONFIGURE_FLAGS}"
+ popd >/dev/null
+
+}
+
+build_with_srpm() {
+
+ if ! $PATCHLESS; then
+ local kernel_extra_version
+ if ! kernel_extra_version=$(build_kernel_with_srpm ${STDOUT}); then
+ fatal 1 "Failed to build the kernel from it's SRPM"
+ fi
+
+ for arch in $BUILD_ARCHS; do
+ local kernel_devel_rpm
+ if ! kernel_devel_rpm=$(find_rpm "$TOPDIR/RPMS/$arch/" provides "^$(devel_kernel_name $KERNEL_LUSTRE_NAMING) ="); then
+ fatal 1 "Failed to find a kernel development RPM in $TOPDIR/RPMS/$arch/"
+ fi
+
+ # install the -devel RPM in preparation for modules builds
+ if ! lnxrel="$kernel_extra_version" unpack_linux_devel_rpm \
+ "$TOPDIR/RPMS/$arch/$kernel_devel_rpm"; then
+ fatal 1 "Could not find the Linux tree in $TOPDIR/RPMS/$arch/$kernel_devel_rpm"
+ fi
+ done
+ else
+ # need to find and unpack the vendor's own kernel-devel for patchless
+ # client build
+ local kernelrpm
+ if ! kernelrpm=$(find_linux_rpm "-$DEVEL_KERNEL_TYPE"); then
+ fatal 1 "Could not find the kernel-$DEVEL_KERNEL_TYPE RPM in ${KERNELRPMSBASE}/${lnxmaj}/${DISTRO}"
+ fi
+ if ! lnxrel="$lnxrel" unpack_linux_devel_rpm "$kernelrpm" "-"; then
+ fatal 1 "Could not find the Linux tree in $kernelrpm"
+ fi
+ fi
+
+ # ~sigh~ have to make copies of and modify some of the rpm
+ # infrastructure files so that find-requires can find our unpacked
+ # kernel-devel artifacts
+ cp $RPM_HELPERS_DIR/{symset-table,find-requires{,.ksyms}} .
+ FIND_REQUIRES="$(pwd)/find-requires"
+ chmod 755 {symset-table,find-requires{,.ksyms}}
+ local tmp="$(pwd)"
+ tmp="${tmp//\//\\/}"
+ ed find-requires <<EOF
+1a
+set -x
+.
+/|.*find-requires.ksyms/s/|/| bash -x/
+g/ [^ ]*\/\(find-requires\.ksyms\)/s// $tmp\/\1/g
+wq
+EOF
+ ed find-requires.ksyms <<EOF
+1a
+set -x
+.
+g/\/.*\/\(symset-table\)/s//$tmp\/\1/g
+wq
+EOF
+ ed symset-table <<EOF
+1a
+set -x
+.
+g/\(\/boot\/\)/s//$tmp\/reused\1/g
+g/\(\/usr\/src\/kernels\/\)/s//$tmp\/reused\1/g
+wq
+EOF
+
+ build_ofed "${LINUXOBJ:-$LINUX}" "$OFED_VERSION" ||
+ fatal 1 "error building OFED"