jjb: Add env and os details printing to build jobs
[lttng-ci.git] / scripts / lttng-modules / build.sh
index 0d83cf41750a963056cb9d100fdc10cda2161e8a..b52aead53a04d82fb6cc61247bedcf76557058dd 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh -exu
+#!/bin/sh
 #
 # Copyright (C) 2015 - Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
 #                      Michael Jeanson <mjeanson@efficios.com>
@@ -16,6 +16,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+set -exu
+
 # Kernel version compare functions
 verlte() {
     [  "$1" = "`printf '%s\n%s' $1 $2 | sort -V | head -n1`" ]
@@ -37,9 +39,9 @@ vergt() {
 # Use all CPU cores
 NPROC=$(nproc)
 
-SRCDIR="${WORKSPACE}/lttng-modules"
+SRCDIR="${WORKSPACE}/src/lttng-modules"
 BUILDDIR="${WORKSPACE}/build"
-LNXSRCDIR="${WORKSPACE}/linux"
+LNXSRCDIR="${WORKSPACE}/src/linux"
 LNXBINDIR="${WORKSPACE}/deps/linux/build"
 
 # Create build directory
@@ -65,7 +67,7 @@ if { vergte "$KVERSION" "3.10" && verlte "$KVERSION" "3.10.13"; } || \
     set +e
 
     # Build modules
-    make -j${NPROC} -C "${LNXBINDIR}" M="$(pwd)" V=1 CONFIG_LTTNG=m
+    KERNELDIR="${LNXBINDIR}" make -j${NPROC} V=1 CONFIG_LTTNG=m
 
     # We expect this build to fail, if it doesn't, fail the job.
     if [ "$?" -eq 0 ]; then
@@ -80,10 +82,10 @@ if { vergte "$KVERSION" "3.10" && verlte "$KVERSION" "3.10.13"; } || \
 else # Regular build
 
     # Build modules
-    make -j${NPROC} -C "${LNXBINDIR}" M="$(pwd)" V=1 CONFIG_LTTNG=m
+    KERNELDIR="${LNXBINDIR}" make -j${NPROC} V=1 CONFIG_LTTNG=m
 
     # Install modules to build dir
-    make INSTALL_MOD_PATH="${BUILDDIR}" -C "${LNXBINDIR}" M="$(pwd)" modules_install
+    KERNELDIR="${LNXBINDIR}" make INSTALL_MOD_PATH="${BUILDDIR}" modules_install
 fi
 
 # EOF
This page took 0.039136 seconds and 4 git commands to generate.