X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=scripts%2Flttng-modules%2Fparam-build.sh;h=ef7a3d0d8fa021b8b8ed194f1dfa9bd6e87366d5;hb=c72041ebe744c7c3fd8411fafd93abe46292bff4;hp=e580dd41318866e0de4ab3049f580e7c6bb203de;hpb=28b10e79262a888b6662128cdde9c35f5f9ed38e;p=lttng-ci.git diff --git a/scripts/lttng-modules/param-build.sh b/scripts/lttng-modules/param-build.sh index e580dd4..ef7a3d0 100644 --- a/scripts/lttng-modules/param-build.sh +++ b/scripts/lttng-modules/param-build.sh @@ -1,6 +1,6 @@ -#!/bin/bash -exu +#!/bin/bash # -# Copyright (C) 2016-2019 - Michael Jeanson +# Copyright (C) 2016-2019 Michael Jeanson # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,8 +15,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +set -exu + # Parameters -arch=${arch:-} +arch=${arch:-amd64} cross_arch=${cross_arch:-} ktag=${ktag:-} kgitrepo=${kgitrepo:-} @@ -102,7 +104,7 @@ select_compiler() { set +e - for cc in gcc-5 gcc-4.8; do + for cc in gcc-8 gcc-5 gcc-4.8; do if "${CROSS_COMPILE:-}${cc}" -I include/ -D__LINUX_COMPILER_H -D__LINUX_COMPILER_TYPES_H -E include/linux/compiler-gcc.h; then selected_cc="$cc" break @@ -150,6 +152,15 @@ build_linux_kernel() { exit 0 fi fi + + # Disable riscv64 config generation, we don't have a toolchain on bionic + sed -i 's/riscv64 //' debian.master/etc/kernelconfig + + # Hack for kernel Ubuntu-hwe-5.8 + if [ ! -f "debian/compat" ]; then + echo "10" > "debian/compat" + fi + fakeroot debian/rules clean KW_DEFCONFIG_DIR=. fakeroot debian/rules genconfigs KW_DEFCONFIG_DIR=. cp CONFIGS/"${ubuntu_config}" .config @@ -256,6 +267,9 @@ build_linux_kernel() { scripts/config --disable CONFIG_IGBVF fi + # Don't fail the build on warnings + scripts/config --disable CONFIG_WERROR + # Set required options scripts/config --enable CONFIG_TRACEPOINTS scripts/config --enable CONFIG_KALLSYMS @@ -269,6 +283,9 @@ build_linux_kernel() { scripts/config --enable CONFIG_EVENT_TRACING scripts/config --enable CONFIG_KRETPROBES + # FIXME: disable objtool on vmlinux, it OOMs on allyesconfig + sed -i 's/objtool_link vmlinux.o//' scripts/link-vmlinux.sh || true + # Debug #cat .config @@ -280,7 +297,7 @@ build_linux_kernel() { # Save the kernel and modules mkdir -p "$LINUX_INSTOBJ_DIR/boot" make INSTALL_MOD_PATH="$LINUX_INSTOBJ_DIR" INSTALL_MOD_STRIP=1 modules_install CC="$CC" - make INSTALL_PATH="$LINUX_INSTOBJ_DIR/boot" install CC="$CC" + make INSTALL_MOD_PATH="$LINUX_INSTOBJ_DIR" INSTALL_PATH="$LINUX_INSTOBJ_DIR/boot" install CC="$CC" rm -f "$LINUX_INSTOBJ_DIR/lib/modules/${krelease}/source" "$LINUX_INSTOBJ_DIR/lib/modules/${krelease}/build" ln -s ../../../../sources "$LINUX_INSTOBJ_DIR/lib/modules/${krelease}/source" ln -s ../../../../sources "$LINUX_INSTOBJ_DIR/lib/modules/${krelease}/source" @@ -376,7 +393,9 @@ extract_distro_headers() { touch -r "${LINUX_HDROBJ_DIR}/.config" "${LINUX_HDROBJ_DIR}/include/generated/autoconf.h" # Copy .config to include/config/auto.conf so "make prepare" is unnecessary. - cp "${LINUX_HDROBJ_DIR}/.config" "${LINUX_HDROBJ_DIR}/include/config/auto.conf" + if [ ! -f "${LINUX_HDROBJ_DIR}/include/config/auto.conf" ]; then + cp "${LINUX_HDROBJ_DIR}/.config" "${LINUX_HDROBJ_DIR}/include/config/auto.conf" + fi # Finally clean the object files from the full source tree make clean @@ -420,6 +439,10 @@ build_modules() { kversion=$(make -C "$LINUX_HDROBJ_DIR" -s kernelversion) + # Try to catch some compatibility problems by turning some + # warnings into errors. + #export KCFLAGS="$KCFLAGS -Wall -Werror" + # Enter lttng-modules source dir cd "${MODULES_GIT_DIR}" @@ -600,7 +623,13 @@ signature_v2 = False" > "$WORKSPACE/.s3cfg" url_hash="$(echo -n "$kgitrepo" | md5sum | awk '{ print $1 }')" obj_name="linux.tar.bz2" -obj_url_prefix="$OBJ_STORE_URL/linux-build/$url_hash/$ktag/$arch/${cross_arch:-native}" + +if [ "x${cross_arch}" = "x" ]; then + obj_url_prefix="$OBJ_STORE_URL/linux-build/$url_hash/$ktag/$arch/native" +else + obj_url_prefix="$OBJ_STORE_URL/linux-build/$url_hash/$ktag/${cross_arch}" +fi + obj_url="$obj_url_prefix/$obj_name" set +e