3 # Copyright (C) 2016 - Michael Jeanson <mjeanson@efficios.com>
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Kernel version compare functions
20 [ "$1" = "`printf '%s\n%s' $1 $2 | sort -V | head -n1`" ]
24 [ "$1" = "$2" ] && return 1 || verlte
$1 $2
28 [ "$1" = "`printf '%s\n%s' $1 $2 | sort -V | tail -n1`" ]
32 [ "$1" = "$2" ] && return 1 || vergte
$1 $2
38 SRCDIR
="${WORKSPACE}/lttng-modules"
39 BUILDDIR
="${WORKSPACE}/build"
40 LNXSRCDIR
="${WORKSPACE}/linux"
41 LNXBUILDDIR
="${WORKSPACE}/linux-build"
43 # Create build directory
44 mkdir
-p "${BUILDDIR}" "${LNXBUILDDIR}"
46 # Enter linux source dir
49 # Prepare linux sources for modules OOT build
50 make O
="${LNXBUILDDIR}" defconfig
52 # Enable CONFIG_KALLSYMS_ALL
53 sed -i "s/# CONFIG_KALLSYMS_ALL is not set/CONFIG_KALLSYMS_ALL=y/g" "${LNXBUILDDIR}"/.config
55 # Build to out of tree dir
56 make O
="${LNXBUILDDIR}" modules_prepare
60 #fakeroot debian/rules clean
61 #fakeroot debian/rules genconfigs
62 #cp CONFIGS/amd64-config.flavour.generic .config
64 # Add Ubuntu ABI number to kernel headers, this is normally done by the packaging code
65 ABINUM
=$
(echo $kversion |
grep -P -o 'Ubuntu-(lts-)?.*-\K\d+(?=\..*)')
66 echo "#define UTS_UBUNTU_RELEASE_ABI $ABINUM" >> ${LNXBUILDDIR}/include
/generated
/utsrelease.h
70 # Get kernel version from source tree
72 KVERSION
=$
(make kernelversion
)
77 # kernels 3.10 to 3.10.13 and 3.11 to 3.11.2 introduce a deadlock in the
78 # timekeeping subsystem. We want those build to fail.
79 if { vergte
"$KVERSION" "3.10" && verlte
"$KVERSION" "3.10.13"; } || \
80 { vergte
"$KVERSION" "3.11" && verlte
"$KVERSION" "3.11.2"; }; then
85 KERNELDIR
="${LNXBUILDDIR}" make -j${NPROC} V
=1
87 # We expect this build to fail, if it doesn't, fail the job.
88 if [ "$?" -eq 0 ]; then
92 # We have to publish at least one file or the build will fail
93 echo "This kernel is broken, there is a deadlock in the timekeeping subsystem." > "${BUILDDIR}/BROKEN.txt"
100 KERNELDIR
="${LNXBUILDDIR}" make -j${NPROC} V
=1
102 # Install modules to build dir
103 KERNELDIR
="${LNXBUILDDIR}" make INSTALL_MOD_PATH
="${BUILDDIR}" modules_install
This page took 0.040662 seconds and 4 git commands to generate.