2 # Copyright (C) 2016 - Francis Deslauriers <francis.deslauriers@efficios.com>
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Version compare functions
20 if [[ "$1" == "$2" ]]; then
24 local i ver1
=($1) ver2
=($2)
25 # fill empty fields in ver1 with zeros
26 for ((i
=${#ver1[@]}; i
<${#ver2[@]}; i
++)); do
29 for ((i
=0; i
<${#ver1[@]}; i
++)); do
30 if [[ -z ${ver2[i]} ]]; then
31 # fill empty fields in ver2 with zeros
34 if ((10#${ver1[i]} > 10#${ver2[i]})); then
37 if ((10#${ver1[i]} < 10#${ver2[i]})); then
46 vercomp
"$1" "$2"; local res
="$?"
47 [ "$res" -eq "0" ] ||
[ "$res" -eq "2" ]
51 vercomp
"$1" "$2"; local res
="$?"
56 vercomp
"$1" "$2"; local res
="$?"
57 [ "$res" -eq "0" ] ||
[ "$res" -eq "1" ]
61 vercomp
"$1" "$2"; local res
="$?"
66 vercomp
"$1" "$2"; local res
="$?"
76 $SSH_COMMAND "$STORAGE_USER@$STORAGE_HOST" ls "$STORAGE_KERNEL_IMAGE"
79 # We need to build the lttng modules if the kernel has changed.
83 $S3_COMMAND info
"s3://$S3_STORAGE_KERNEL_IMAGE"
86 # We need to build the lttng modules if the kernel has changed.
90 $SSH_COMMAND "$STORAGE_USER@$STORAGE_HOST" ls "$STORAGE_LTTNG_MODULES"
95 $S3_COMMAND info
"s3://$S3_STORAGE_LTTNG_MODULES"
102 # We need to fetch the kernel source and lttng-modules to build either the
104 if [ $NEED_MODULES_BUILD -eq 1 ] ||
[ $NEED_KERNEL_BUILD -eq 1 ] ; then
105 mkdir
-p "$LINUX_PATH"
108 git remote add origin
"$KGITREPO"
109 git fetch
--depth 1 origin
"$KERNEL_COMMIT_ID"
110 git checkout FETCH_HEAD
111 version
=$
(make -s kernelversion
)
115 # Prepare version string for comparison.
116 # Strip any '-rc tag'.
117 version
=${version%%"-"*}
119 cp src
/lttng-ci
/lava
/kernel
/vanilla
/x86_64_server.config
"$LINUX_PATH/.config"
120 make --directory="$LINUX_PATH" olddefconfig
122 if [ $BUILD_DEVICE = 'kvm' ] ; then
123 if vergte
"$version" "3.19"; then
124 make --directory="$LINUX_PATH" kvm_guest.config
126 make --directory="$LINUX_PATH" kvmconfig
130 make --directory="$LINUX_PATH" modules_prepare
133 #We create files to specify what needs to be built for the subsequent build steps
134 if [ $NEED_MODULES_BUILD -eq 0 ] ; then
135 touch modules-built.txt
137 if [ $NEED_KERNEL_BUILD -eq 0 ] ; then
138 touch kernel-built.txt
This page took 0.031357 seconds and 4 git commands to generate.