Lava: Upgrade rootfs to Xenial for kernel tests
[lttng-ci.git] / scripts / lttng-modules / param-build.sh
index cb9602543ef982df5fc885cf6ac5146cf805e602..cfc74f893f67ca980f9b2e333d10e38bbe56f7db 100644 (file)
@@ -53,7 +53,8 @@ prepare_lnx_sources() {
         cp CONFIGS/${ubuntu_config} "${outdir}"/.config
         ;;
       *)
-        make ${koutput} defconfig
+        # Que sera sera
+        make ${koutput} allyesconfig CC=$CC
         ;;
     esac
 
@@ -63,6 +64,9 @@ prepare_lnx_sources() {
     # Don't try to sign modules
     sed -i "s/CONFIG_MODULE_SIG=y/# CONFIG_MODULE_SIG is not set/g" "${outdir}"/.config
 
+    # Disable kernel stack frame correctness validation, introduced in 4.6.0 and currently fails
+    sed -i "s/CONFIG_STACK_VALIDATION=y/# CONFIG_STACK_VALIDATION is not set/g" "${outdir}"/.config
+
     # Enable CONFIG_KALLSYMS_ALL
     echo "CONFIG_KPROBES=y" >> "${outdir}"/.config
     echo "CONFIG_FTRACE=y" >> "${outdir}"/.config
@@ -71,8 +75,8 @@ prepare_lnx_sources() {
     echo "CONFIG_KALLSYMS_ALL=y" >> "${outdir}"/.config
 
 
-    make ${koutput} silentoldconfig
-    make ${koutput} modules_prepare
+    make ${koutput} silentoldconfig CC=$CC
+    make ${koutput} modules_prepare CC=$CC
 
     # Version specific tasks
     case "$kversion" in
@@ -85,7 +89,7 @@ prepare_lnx_sources() {
 
     # On powerpc this object is required to link modules
     if [ "${karch}" = "powerpc" ]; then
-        make ${koutput} arch/powerpc/lib/crtsavres.o
+        make ${koutput} arch/powerpc/lib/crtsavres.o CC=$CC
     fi
 }
 
@@ -111,7 +115,7 @@ build_modules() {
         set +e
 
         # Build modules
-        KERNELDIR="${kdir}" make -j${NPROC} V=1
+        KERNELDIR="${kdir}" make -j${NPROC} V=1 CC=$CC
 
         # We expect this build to fail, if it doesn't, fail the job.
         if [ "$?" -eq 0 ]; then
@@ -123,24 +127,27 @@ build_modules() {
 
         set -e
 
-        KERNELDIR="${kdir}" make clean
+        KERNELDIR="${kdir}" make clean CC=$CC
 
     else # Regular build
 
         # Build modules against full kernel sources
-        KERNELDIR="${kdir}" make -j${NPROC} V=1
+        KERNELDIR="${kdir}" make -j${NPROC} V=1 CC=$CC
 
         # Install modules to build dir
-        KERNELDIR="${kdir}" make INSTALL_MOD_PATH="${bdir}" modules_install
+        KERNELDIR="${kdir}" make INSTALL_MOD_PATH="${bdir}" modules_install CC=$CC
 
         # Clean build dir
-        KERNELDIR="${kdir}" make clean
+        KERNELDIR="${kdir}" make clean CC=$CC
     fi
 }
 
 
 ## MAIN ##
 
+# Use gcc 4.9, older kernel don't build with gcc 5
+export CC=gcc-4.9
+
 # Use all CPU cores
 NPROC=$(nproc)
 
@@ -150,7 +157,7 @@ LNXSRCDIR="${WORKSPACE}/src/linux"
 LNXBUILDDIR="${WORKSPACE}/build/linux"
 LNXHDRDIR="${WORKSPACE}/build/linux-headers"
 
-LTTBUILKSRCDDIR="${WORKSPACE}/build/lttng-modules-ksrc"
+LTTBUILDKSRCDIR="${WORKSPACE}/build/lttng-modules-ksrc"
 LTTBUILDKHDRDIR="${WORKSPACE}/build/lttng-modules-khdr"
 
 
@@ -240,7 +247,7 @@ fi
 
 
 # Create build directories
-mkdir -p "${LNXBUILDDIR}" "${LNXHDRDIR}" "${LTTBUILKSRCDDIR}" "${LTTBUILDKHDRDIR}"
+mkdir -p "${LNXBUILDDIR}" "${LNXHDRDIR}" "${LTTBUILDKSRCDIR}" "${LTTBUILDKHDRDIR}"
 
 
 
@@ -333,18 +340,20 @@ prepare_lnx_sources "${LNXBUILDDIR}"
 ## BUILD modules
 
 # Build modules against full kernel sources
-build_modules "${LNXBUILDDIR}" "${LTTBUILKSRCDDIR}"
+build_modules "${LNXBUILDDIR}" "${LTTBUILDKSRCDIR}"
 
 # Build modules against kernel headers
 build_modules "${LNXHDRDIR}" "${LTTBUILDKHDRDIR}"
 
 # Make sure modules were built
-if [ "x$(find "${LTTBUILKSRCDDIR}" -name "*.ko" -printf yes -quit)" != "xyes" ]; then
+tree "${LTTBUILDKSRCDIR}"
+if [ "x$(find "${LTTBUILDKSRCDIR}" -name '*.ko*' -printf yes -quit)" != "xyes" ]; then
   echo "No modules built!"
   exit 1
 fi
 
-if [ "x$(find "${LTTBUILDKHDRDIR}" -name "*.ko" -printf yes -quit)" != "xyes" ]; then
+tree "${LTTBUILDKHDRDIR}"
+if [ "x$(find "${LTTBUILDKHDRDIR}" -name '*.ko*' -printf yes -quit)" != "xyes" ]; then
   echo "No modules built!"
   exit 1
 fi
This page took 0.042202 seconds and 4 git commands to generate.