Whamcloud - gitweb
b=15316,13969
[fs/lustre-release.git] / build / lbuild
index 33e9e20..5c35f10 100755 (executable)
@@ -174,7 +174,7 @@ Usage: ${0##*/} [OPTION]... [-- <lustre configure options>]
     pulling from CVS.
 
   --nodownload
-    Do not try to download a kernel from ftp.lustre.org
+    Do not try to download a kernel from downloads.lustre.org
 
   --nosrc
     Do not build a .src.rpm, a full kernel patch, or a patched kernel
@@ -377,10 +377,10 @@ download_and_build_tarball() {
 
     local srpm=kernel-${lnxmaj}-${lnxrel}.src.rpm
 
-    echo "Downloading http://ftp.lustre.org/pub/kernels/$target/old/$srpm..."
-    if ! wget -nv "http://ftp.lustre.org/pub/kernels/$target/old/$srpm" \
+    echo "Downloading http://downloads.lustre.org/public/kernels/$target/old/$srpm..."
+    if ! wget -nv "http://downloads.lustre.org/public/kernels/$target/old/$srpm" \
         -O "$KERNELDIR/$srpm" ; then
-        fatal 1 "Could not download target $kernel_file's kernel SRPM $srpm from ftp.lustre.org."
+        fatal 1 "Could not download target $kernel_file's kernel SRPM $srpm from downloads.lustre.org."
     fi
 
     build_tarball $target $srpm
@@ -420,8 +420,8 @@ load_target()
                 build_tarball $CANONICAL_TARGET $KERNEL_SRPM
             else
                 if (( $DOWNLOAD )) ; then
-                    echo "Downloading http://ftp.lustre.org/pub/kernels/$CANONICAL_TARGET/old/$KERNEL..."
-                    if ! wget -nv "http://ftp.lustre.org/pub/kernels/$CANONICAL_TARGET/old/$KERNEL" -O "$KERNELDIR/$KERNEL" ; then
+                    echo "Downloading http://downloads.lustre.org/public/kernels/$CANONICAL_TARGET/old/$KERNEL..."
+                    if ! wget -nv "http://downloads.lustre.org/public/kernels/$CANONICAL_TARGET/old/$KERNEL" -O "$KERNELDIR/$KERNEL" ; then
                         # see if we can do it with an SRPM from the download site
                         download_and_build_tarball $CANONICAL_TARGET $KERNEL_FILE
                     fi
@@ -430,6 +430,19 @@ load_target()
                 fi
             fi
         fi
+        if [ -n "$OFED_VERSION" ] && \
+           [ ! -r "$KERNELTREE/../OFED-${OFED_VERSION}.tgz" ] ; then
+            if (( $DOWNLOAD )) ; then
+                local location="http://downloads.lustre.org/public/OFED/"
+                echo "Downloading $location/OFED-${OFED_VERSION}.tgz..."
+                if ! wget -nv "$location/OFED-${OFED_VERSION}.tgz" \
+                    -O "$KERNELTREE/../OFED-${OFED_VERSION}.tgz" ; then
+                    fatal 1 "Could not download OFED-${OFED_VERSION}.tgz from downloads.lustre.org."
+                fi
+            else
+                fatal 1 "OFED-${OFED_VERSION}.tgz not found in kernel directory $KERNELDIR."
+            fi
+        fi
     fi
 
     if [ "$SERIES" ] ; then
@@ -521,6 +534,15 @@ untar()
     tar $(tarflags "$1") "$1"
 }
 
+unpack_ofed()
+{
+    untar "$KERNELTREE/../OFED-${OFED_VERSION}.tgz"
+    [ -d OFED ] || ln -sf OFED-[0-9].[0-9]* OFED
+    pwd
+    ls -ld OFED OFED-[0-9].[0-9]*
+    ls -l OFED OFED-[0-9].[0-9]*
+}
+
 unpack_lustre()
 {
     DIRNAME="lustre-$TAG-$TIMESTAMP"
@@ -629,6 +651,7 @@ prep_kernel_build()
         -e "s^@JENSEN_ARCHS@^$BOOT_ARCHS^g" \
         -e "s^@KERNEL_EXTRA_VERSION@^$EXTRA_VERSION^g" \
         -e "s^@KERNEL_EXTRA_VERSION_DELIMITER@^$EXTRA_VERSION_DELIMITER^g" \
+        -e "s^@KERNEL_TARGET_DELIMITER@^$TARGET_DELIMITER^g" \
         -e "s^@KERNEL_RELEASE@^${EXTRA_VERSION//-/_}^g" \
         -e "s^@KERNEL_SOURCE@^$KERNEL^g" \
         -e "s^@KERNEL_VERSION@^$VERSION^g" \
@@ -1204,24 +1227,12 @@ patchless_build_sequence()
     fi
     [ -d $TOPDIR/reused ] && rm -rf $TOPDIR/reused
 
-    local type=
-    local delimiter=
+    local delimiter=${EXTRA_VERSION_DELIMITER:-"-"}
+    # default to source type -source and special case below
+    local type=-source
     case "$DISTRO" in
         rhel*)
             type=-devel
-            delimiter=-
-            ;;
-        sles10)
-            type=-source
-            delimiter=.
-            ;;
-        sles9)
-            type=-source
-            delimiter=-
-            ;;
-        *)
-            echo "Don't know what to do with $DISTRO"
-            return 255
             ;;
     esac
 
@@ -1542,6 +1553,10 @@ unpack_lustre
 load_target
 EXTRA_VERSION_DELIMITER=${EXTRA_VERSION_DELIMITER:-"-"}
 
+if [ -n "$OFED_VERSION" ]; then
+    unpack_ofed
+fi
+
 build_success=false
 if $PATCHLESS; then
     patchless_build_sequence && build_success=true