2015-12-22 11:10:07 +01:00
|
|
|
#!/bin/bash
|
2017-01-20 01:54:11 +01:00
|
|
|
|
|
|
|
# This file is part of Jehanne.
|
|
|
|
#
|
|
|
|
# Copyright (C) 2016-2017 Giacomo Tesio <giacomo@tesio.it>
|
|
|
|
|
2015-12-22 11:10:07 +01:00
|
|
|
set -e
|
|
|
|
|
2017-02-05 03:14:01 +01:00
|
|
|
function finish {
|
2017-02-22 00:55:12 +01:00
|
|
|
if [ "$TRAVIS_BUILD_DIR" != "" ]; then
|
2017-02-05 03:14:01 +01:00
|
|
|
# ensure that we preserve the toolchain on broken build/test
|
|
|
|
if [ -f "$JEHANNE/hacking/cross/toolchain/bin/x86_64-jehanne-gcc" ]; then
|
|
|
|
mv $JEHANNE/hacking/cross/toolchain/* $JEHANNE/tmp/toolchain/
|
|
|
|
fi
|
2017-02-22 00:55:12 +01:00
|
|
|
fi
|
|
|
|
(cd $JEHANNE/hacking; git clean -xdf disk-setup/; git checkout disk-setup/syslinux.cfg)
|
2017-02-05 03:14:01 +01:00
|
|
|
}
|
|
|
|
trap finish EXIT
|
|
|
|
|
2015-12-22 11:10:07 +01:00
|
|
|
if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then
|
2015-12-23 11:05:48 +01:00
|
|
|
cd `dirname $0`
|
2015-12-23 11:44:48 +01:00
|
|
|
cd ..
|
2015-12-23 11:05:48 +01:00
|
|
|
export JEHANNE=`pwd`
|
2015-12-22 11:10:07 +01:00
|
|
|
export PATH="$JEHANNE/hacking/bin:$PATH"
|
2016-11-26 10:48:59 +01:00
|
|
|
export PATH="$JEHANNE/hacking/cross/toolchain/bin:$PATH"
|
2015-12-22 11:10:07 +01:00
|
|
|
export ARCH=amd64
|
2016-11-26 12:49:36 +01:00
|
|
|
git clean -xdf arch/ sys/ qa/ usr/
|
2015-12-23 11:05:48 +01:00
|
|
|
if [ ! -f "$JEHANNE/hacking/bin/ufs" ]; then
|
2015-12-23 11:44:48 +01:00
|
|
|
echo "Cannot find build tools in $JEHANNE/hacking/bin"
|
|
|
|
$JEHANNE/hacking/buildtools.sh
|
2015-12-23 11:05:48 +01:00
|
|
|
fi
|
2016-11-25 23:46:15 +01:00
|
|
|
if [ ! -f "$JEHANNE/hacking/cross/toolchain/bin/x86_64-jehanne-gcc" ]; then
|
2016-11-26 12:41:29 +01:00
|
|
|
echo "Cannot find cross-compiling toolchain in $JEHANNE/hacking/bin"
|
|
|
|
if [ -f "$JEHANNE/tmp/toolchain/bin/x86_64-jehanne-gcc" ]; then
|
|
|
|
echo "Found cross-compiling toolchain in $JEHANNE/tmp/toolchain/"
|
2016-11-26 17:55:21 +01:00
|
|
|
mv $JEHANNE/tmp/toolchain/* $JEHANNE/hacking/cross/toolchain/
|
2016-11-26 12:41:29 +01:00
|
|
|
else
|
|
|
|
echo "Creating cross-compiling toolchain..."
|
2017-02-22 00:55:12 +01:00
|
|
|
(cd $JEHANNE/hacking/cross/; ./init.sh; git clean -xdf $JEHANNE/hacking/cross/tmp $JEHANNE/hacking/cross/src/)
|
2016-11-26 12:41:29 +01:00
|
|
|
fi
|
2016-11-25 23:46:15 +01:00
|
|
|
fi
|
2015-12-22 11:10:07 +01:00
|
|
|
|
2016-11-26 11:58:22 +01:00
|
|
|
export TOOLPREFIX=x86_64-jehanne-
|
2016-11-26 21:57:47 +01:00
|
|
|
export CC=x86_64-jehanne-gcc
|
2016-11-26 11:58:22 +01:00
|
|
|
|
2015-12-22 11:10:07 +01:00
|
|
|
echo
|
|
|
|
echo "Vendorized code verification..."
|
|
|
|
echo
|
|
|
|
for v in `find $JEHANNE -type f|grep vendor.json`; do
|
|
|
|
echo "cd `dirname $v`"
|
|
|
|
(cd `dirname $v`; vendor -check)
|
|
|
|
done
|
|
|
|
echo
|
|
|
|
|
|
|
|
build all
|
2016-11-26 12:41:29 +01:00
|
|
|
|
|
|
|
if [ "$TRAVIS_BUILD_DIR" != "" ]; then
|
2017-01-06 18:37:32 +01:00
|
|
|
if [ "$QA_CHECKS" != "" ]; then
|
|
|
|
echo "Run QA checks"
|
|
|
|
echo /qa/check | NCPU=2 KERNEL=workhorse.32bit KERNDIR=$JEHANNE/hacking/bin/ runqemu
|
2017-02-05 02:37:00 +01:00
|
|
|
|
|
|
|
echo "Create disk image to run QA checks"
|
|
|
|
sed -i -e 's/menu.c32/FromAHCI/g' -e 's/nobootprompt/console=comconsole nobootprompt/g' $JEHANNE/hacking/disk-setup/syslinux.cfg
|
|
|
|
$JEHANNE/hacking/disk-create.sh
|
|
|
|
(cd $JEHANNE/hacking/; git checkout disk-setup/syslinux.cfg)
|
|
|
|
|
|
|
|
echo "Run QA checks in sample disk"
|
|
|
|
export QA_DISK=$JEHANNE/hacking/sample-disk.img
|
|
|
|
echo /qa/check | NCPU=1 runqemu -p 'jehanne#'
|
2017-01-06 18:37:32 +01:00
|
|
|
fi
|
2016-12-15 22:47:10 +01:00
|
|
|
|
2016-11-26 12:41:29 +01:00
|
|
|
echo "Move cross-compiling toolchain to $JEHANNE/tmp/toolchain for Travis caches"
|
2016-11-26 17:55:21 +01:00
|
|
|
if [ ! -d "$JEHANNE/tmp/toolchain" ]; then
|
|
|
|
mkdir $JEHANNE/tmp/toolchain
|
|
|
|
fi
|
2016-11-26 12:41:29 +01:00
|
|
|
fi
|
2015-12-22 11:10:07 +01:00
|
|
|
fi
|