2004-10-19 09:00:47 +02:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2008-01-18 16:08:58 +01:00
|
|
|
# coreboot autobuild
|
2004-10-19 09:00:47 +02:00
|
|
|
#
|
2008-01-18 16:08:58 +01:00
|
|
|
# This script builds coreboot images for all available targets.
|
2004-10-19 09:00:47 +02:00
|
|
|
#
|
|
|
|
# (C) 2004 by Stefan Reinauer <stepan@openbios.org>
|
2010-01-30 11:44:28 +01:00
|
|
|
# (C) 2006-2010 by coresystems GmbH <info@coresystems.de>
|
2013-05-31 21:33:30 +02:00
|
|
|
# (C) 2013 Sage Electronic Engineering, LLC
|
2004-10-19 09:00:47 +02:00
|
|
|
#
|
|
|
|
# This file is subject to the terms and conditions of the GNU General
|
|
|
|
# Public License. See the file COPYING in the main directory of this
|
|
|
|
# archive for more details.
|
2010-04-27 08:56:47 +02:00
|
|
|
#
|
2004-10-19 09:00:47 +02:00
|
|
|
|
2004-11-05 09:50:54 +01:00
|
|
|
#set -x # Turn echo on....
|
2004-10-21 23:41:57 +02:00
|
|
|
|
2013-05-31 21:33:30 +02:00
|
|
|
ABUILD_DATE="May 31, 2013"
|
|
|
|
ABUILD_VERSION="0.9.2"
|
2006-10-25 21:02:34 +02:00
|
|
|
|
2011-11-05 13:21:14 +01:00
|
|
|
TOP=$PWD
|
|
|
|
|
2004-10-21 23:41:57 +02:00
|
|
|
# Where shall we place all the build trees?
|
2010-03-27 18:18:39 +01:00
|
|
|
TARGET=coreboot-builds
|
2011-11-05 13:21:14 +01:00
|
|
|
XMLFILE=$TOP/abuild.xml
|
|
|
|
REAL_XMLFILE=$XMLFILE
|
2004-10-19 09:00:47 +02:00
|
|
|
|
2004-10-21 23:41:57 +02:00
|
|
|
# path to payload. Should be more generic
|
2004-11-04 12:04:33 +01:00
|
|
|
PAYLOAD=/dev/null
|
2004-10-21 23:41:57 +02:00
|
|
|
|
2013-05-31 21:33:30 +02:00
|
|
|
# path to coreboot XGCC
|
|
|
|
XGCCPATH="`pwd`/util/crossgcc/xgcc/bin/"
|
|
|
|
|
|
|
|
# Add XGCC to the path.
|
|
|
|
if [ -d "$XGCCPATH" ] && [[ ":$PATH:" != *":$XGCCPATH:"* ]]; then
|
|
|
|
PATH="$XGCCPATH:$PATH"
|
|
|
|
fi
|
|
|
|
|
2004-10-21 23:41:57 +02:00
|
|
|
# Lines of error context to be printed in FAILURE case
|
2010-03-30 16:02:19 +02:00
|
|
|
CONTEXT=6
|
2004-10-21 23:41:57 +02:00
|
|
|
|
2008-01-18 16:08:58 +01:00
|
|
|
TESTSUBMISSION="http://qa.coreboot.org/deployment/send.php"
|
2006-10-25 21:02:34 +02:00
|
|
|
|
2009-03-11 16:00:50 +01:00
|
|
|
# Configure-only mode
|
|
|
|
configureonly=0
|
|
|
|
|
2011-06-01 21:29:48 +02:00
|
|
|
# Did any board fail to build?
|
|
|
|
failed=0
|
|
|
|
|
2004-10-21 23:41:57 +02:00
|
|
|
# One might want to adjust these in case of cross compiling
|
2009-05-26 16:03:51 +02:00
|
|
|
for i in make gmake gnumake nonexistant_make; do
|
|
|
|
$i --version 2>/dev/null |grep "GNU Make" >/dev/null && break
|
|
|
|
done
|
|
|
|
if [ "$i" = "nonexistant_make" ]; then
|
|
|
|
echo No GNU Make found.
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
MAKE=$i
|
2004-10-19 09:00:47 +02:00
|
|
|
|
2006-05-27 02:22:02 +02:00
|
|
|
# this can be changed to xml by -x
|
|
|
|
mode=text
|
|
|
|
|
2008-05-27 20:29:26 +02:00
|
|
|
# silent mode.. no compiler calls, only warnings in the log files.
|
|
|
|
# this is disabled per default but can be enabled with -s
|
|
|
|
silent=
|
|
|
|
|
2009-03-11 16:43:02 +01:00
|
|
|
# clang mode enabled by -sb option.
|
|
|
|
scanbuild=false
|
|
|
|
|
2008-09-30 19:09:44 +02:00
|
|
|
# stackprotect mode enabled by -ns option.
|
|
|
|
stackprotect=false
|
|
|
|
|
2004-10-19 09:00:47 +02:00
|
|
|
ARCH=`uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
|
2009-03-11 16:00:50 +01:00
|
|
|
-e s/i86pc/i386/ \
|
2004-10-19 09:00:47 +02:00
|
|
|
-e s/arm.*/arm/ -e s/sa110/arm/ -e s/x86_64/amd64/ \
|
|
|
|
-e "s/Power Macintosh/ppc/"`
|
|
|
|
|
2006-10-25 21:02:34 +02:00
|
|
|
trap interrupt INT
|
|
|
|
|
|
|
|
function interrupt
|
|
|
|
{
|
|
|
|
printf "\n$0: execution interrupted manually.\n"
|
|
|
|
if [ "$mode" == "xml" ]; then
|
|
|
|
printf "$0: deleting incomplete xml output file.\n"
|
|
|
|
fi
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2004-11-05 12:57:00 +01:00
|
|
|
function debug
|
|
|
|
{
|
2006-10-25 21:02:34 +02:00
|
|
|
test "$verbose" == "true" && printf "$*\n"
|
2004-11-05 12:57:00 +01:00
|
|
|
}
|
2004-11-05 20:55:06 +01:00
|
|
|
|
2006-05-27 02:22:02 +02:00
|
|
|
function xml
|
|
|
|
{
|
2006-10-25 21:02:34 +02:00
|
|
|
test "$mode" == "xml" && printf "$*\n" >> $XMLFILE
|
2010-03-30 16:02:19 +02:00
|
|
|
return 0
|
2006-05-27 02:22:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function xmlfile
|
|
|
|
{
|
2010-04-27 08:56:47 +02:00
|
|
|
test "$mode" == "xml" && {
|
2006-10-25 21:02:34 +02:00
|
|
|
printf '<![CDATA[\n'
|
|
|
|
cat $1
|
2010-04-27 08:56:47 +02:00
|
|
|
printf ']]>\n'
|
2006-10-25 21:02:34 +02:00
|
|
|
} >> $XMLFILE
|
2006-05-27 02:22:02 +02:00
|
|
|
}
|
|
|
|
|
2011-06-03 21:56:13 +02:00
|
|
|
function junit
|
|
|
|
{
|
|
|
|
test "$mode" == "junit" && printf "$*\n" >> $XMLFILE
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
function junitfile
|
|
|
|
{
|
|
|
|
test "$mode" == "junit" && {
|
|
|
|
printf '<![CDATA[\n'
|
|
|
|
cat $1
|
|
|
|
printf ']]>\n'
|
|
|
|
} >> $XMLFILE
|
|
|
|
}
|
2006-05-27 02:22:02 +02:00
|
|
|
|
|
|
|
|
2004-10-19 09:00:47 +02:00
|
|
|
function vendors
|
|
|
|
{
|
|
|
|
# make this a function so we can easily select
|
|
|
|
# without breaking readability
|
2010-01-30 11:44:28 +01:00
|
|
|
ls -1 "$ROOT/src/mainboard" | grep -v Kconfig | grep -v Makefile
|
2004-10-19 09:00:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function mainboards
|
|
|
|
{
|
|
|
|
# make this a function so we can easily select
|
|
|
|
# without breaking readability
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2004-10-19 09:00:47 +02:00
|
|
|
VENDOR=$1
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2010-01-30 11:44:28 +01:00
|
|
|
ls -1 $ROOT/src/mainboard/$VENDOR | grep -v Kconfig
|
2004-10-19 09:00:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function architecture
|
|
|
|
{
|
|
|
|
VENDOR=$1
|
|
|
|
MAINBOARD=$2
|
2010-02-07 22:43:48 +01:00
|
|
|
ARCH=`cat $ROOT/src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \
|
|
|
|
grep "select ARCH_"|cut -f2- -d_`
|
|
|
|
echo $ARCH | sed s/X86/i386/
|
2004-10-19 09:00:47 +02:00
|
|
|
}
|
|
|
|
|
2010-01-30 11:44:28 +01:00
|
|
|
function create_config
|
|
|
|
{
|
|
|
|
VENDOR=$1
|
|
|
|
MAINBOARD=$2
|
|
|
|
CONFIG=$3
|
|
|
|
|
|
|
|
build_dir=$TARGET/${VENDOR}_${MAINBOARD}
|
|
|
|
|
|
|
|
# get a working payload for the board if we have one.
|
2010-04-27 08:56:47 +02:00
|
|
|
# the --payload option expects a directory containing
|
2010-01-30 11:44:28 +01:00
|
|
|
# a shell script payload.sh
|
|
|
|
# Usage: payload.sh [VENDOR] [DEVICE]
|
|
|
|
# the script returns an absolute path to the payload binary.
|
|
|
|
|
|
|
|
if [ -f $payloads/payload.sh ]; then
|
|
|
|
PAYLOAD=`sh $payloads/payload.sh $VENDOR $MAINBOARD`
|
2012-09-24 20:52:42 +02:00
|
|
|
if [ $? -gt 0 ]; then
|
|
|
|
echo "problem with payload"
|
|
|
|
exit 1
|
|
|
|
fi
|
2010-01-30 11:44:28 +01:00
|
|
|
printf "Using payload $PAYLOAD\n"
|
2012-10-07 15:05:42 +02:00
|
|
|
elif [ "$payloads" = "none" ]; then
|
|
|
|
PAYLOAD=none
|
2010-01-30 11:44:28 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p ${build_dir}
|
2010-04-17 00:48:57 +02:00
|
|
|
mkdir -p $TARGET/sharedutils
|
2010-01-30 11:44:28 +01:00
|
|
|
|
|
|
|
if [ "$CONFIG" != "" ]; then
|
|
|
|
printf " Using existing configuration $CONFIG ... "
|
|
|
|
xml " <config>$CONFIG</config>"
|
2011-02-01 11:42:52 +01:00
|
|
|
cp src/mainboard/$VENDOR/$MAINBOARD/$CONFIG ${build_dir}/config.build
|
2010-01-30 11:44:28 +01:00
|
|
|
else
|
|
|
|
printf " Creating config file... "
|
|
|
|
xml " <config>autogenerated</config>"
|
2010-09-02 20:36:29 +02:00
|
|
|
grep "if[\t ]*VENDOR" src/mainboard/$VENDOR/$MAINBOARD/../Kconfig | \
|
2010-12-08 20:58:30 +01:00
|
|
|
sed "s,^.*\(VENDOR_.*\)[^A-Z0-9_]*,CONFIG_\1=y," > ${build_dir}/config.build
|
2010-09-02 20:36:29 +02:00
|
|
|
grep "if[\t ]*BOARD" src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \
|
2010-12-08 20:58:30 +01:00
|
|
|
sed "s,^.*\(BOARD_.*\)[^A-Z0-9_]*,CONFIG_\1=y," >> ${build_dir}/config.build
|
2010-01-30 11:44:28 +01:00
|
|
|
grep "select[\t ]*ARCH" src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \
|
2010-12-08 20:58:30 +01:00
|
|
|
sed "s,^.*\(ARCH_.*\)[^A-Z0-9_]*,CONFIG_\1=y," >> ${build_dir}/config.build
|
|
|
|
echo "CONFIG_MAINBOARD_DIR=\"$VENDOR/$MAINBOARD\"" >> ${build_dir}/config.build
|
2012-10-07 15:05:42 +02:00
|
|
|
if [ "$PAYLOAD" = "none" ]; then
|
|
|
|
echo "CONFIG_PAYLOAD_NONE=y" >> ${build_dir}/config.build
|
|
|
|
elif [ "$PAYLOAD" != "/dev/null" ]; then
|
2010-12-08 20:58:30 +01:00
|
|
|
echo "# CONFIG_PAYLOAD_NONE is not set" >> ${build_dir}/config.build
|
2010-12-30 18:39:50 +01:00
|
|
|
echo "# CONFIG_PAYLOAD_SEABIOS is not set" >> ${build_dir}/config.build
|
2010-12-08 20:58:30 +01:00
|
|
|
echo "CONFIG_PAYLOAD_ELF=y" >> ${build_dir}/config.build
|
2010-12-19 22:20:14 +01:00
|
|
|
echo "CONFIG_PAYLOAD_FILE=\"$PAYLOAD\"" >> ${build_dir}/config.build
|
2010-01-30 11:44:28 +01:00
|
|
|
fi
|
|
|
|
|
2012-05-01 15:14:46 +02:00
|
|
|
printf "($customizing) "
|
|
|
|
printf "$configoptions" >> ${build_dir}/config.build
|
2010-01-30 11:44:28 +01:00
|
|
|
fi
|
|
|
|
|
2012-11-09 02:15:40 +01:00
|
|
|
yes "" 2>/dev/null | $MAKE oldconfig DOTCONFIG=${build_dir}/config.build obj=${build_dir} objutil=$TARGET/sharedutils &> ${build_dir}/config.log
|
2010-01-30 11:44:28 +01:00
|
|
|
ret=$?
|
|
|
|
if [ $ret -eq 0 ]; then
|
2010-03-30 16:02:19 +02:00
|
|
|
printf "ok; "
|
2010-01-30 11:44:28 +01:00
|
|
|
xml " <builddir>ok</builddir>"
|
|
|
|
xml " <log>"
|
|
|
|
xmlfile $build_dir/config.log
|
|
|
|
xml " </log>"
|
|
|
|
xml ""
|
|
|
|
return 0
|
|
|
|
else
|
2010-03-30 16:02:19 +02:00
|
|
|
# Does this ever happen?
|
|
|
|
printf "FAILED!\nLog excerpt:\n"
|
2010-01-30 11:44:28 +01:00
|
|
|
xml " <builddir>failed</builddir>"
|
|
|
|
xml " <log>"
|
|
|
|
xmlfile $build_dir/config.log
|
|
|
|
xml " </log>"
|
|
|
|
xml ""
|
|
|
|
tail -n $CONTEXT $build_dir/config.log 2> /dev/null || tail -$CONTEXT $build_dir/config.log
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2004-10-19 09:00:47 +02:00
|
|
|
function create_buildenv
|
|
|
|
{
|
|
|
|
VENDOR=$1
|
|
|
|
MAINBOARD=$2
|
2009-04-23 01:39:19 +02:00
|
|
|
CONFIG=$3
|
2010-03-30 17:49:14 +02:00
|
|
|
|
2010-02-07 22:43:48 +01:00
|
|
|
create_config $VENDOR $MAINBOARD $CONFIG
|
2010-03-30 17:49:14 +02:00
|
|
|
ret=$?
|
2010-03-25 15:18:57 +01:00
|
|
|
|
|
|
|
# Allow simple "make" in the target directory
|
|
|
|
MAKEFILE=$TARGET/${VENDOR}_${MAINBOARD}/Makefile
|
2010-12-11 23:07:07 +01:00
|
|
|
echo "# autogenerated" > $MAKEFILE
|
2010-03-25 15:18:57 +01:00
|
|
|
echo "TOP=$ROOT" >> $MAKEFILE
|
2010-12-11 23:07:07 +01:00
|
|
|
echo "BUILD=$TARGET" >> $MAKEFILE
|
|
|
|
echo "OBJ=\$(BUILD)/${VENDOR}_${MAINBOARD}" >> $MAKEFILE
|
|
|
|
echo "OBJUTIL=\$(BUILD)/sharedutils" >> $MAKEFILE
|
2010-03-30 16:02:19 +02:00
|
|
|
echo "all:" >> $MAKEFILE
|
2010-12-11 23:07:07 +01:00
|
|
|
echo " @cp -a config.h config.h.bak" >> $MAKEFILE
|
|
|
|
echo " @cd \$(TOP); \$(MAKE) oldconfig DOTCONFIG=\$(OBJ)/config.build objutil=\$(OBJUTIL) obj=\$(OBJ)" >> $MAKEFILE
|
|
|
|
echo " @tail -n+6 config.h > config.new; tail -n+6 config.h.bak > config.old" >> $MAKEFILE
|
|
|
|
echo " @cmp -s config.new config.old && cp -a config.h.bak config.h || echo \"Config file changed\"" >> $MAKEFILE
|
|
|
|
echo " @rm config.h.bak config.new config.old" >> $MAKEFILE
|
|
|
|
echo " @cd \$(TOP); \$(MAKE) DOTCONFIG=\$(OBJ)/config.build objutil=\$(OBJUTIL) obj=\$(OBJ)" >> $MAKEFILE
|
2010-03-30 17:49:14 +02:00
|
|
|
|
|
|
|
return $ret
|
2004-10-19 09:00:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function compile_target
|
2010-04-27 08:56:47 +02:00
|
|
|
{
|
2004-10-19 09:00:47 +02:00
|
|
|
VENDOR=$1
|
|
|
|
MAINBOARD=$2
|
|
|
|
|
2012-05-01 15:14:46 +02:00
|
|
|
printf " Compiling image $cpuconfig .. "
|
2008-05-27 20:29:26 +02:00
|
|
|
|
2004-10-19 09:00:47 +02:00
|
|
|
CURR=$( pwd )
|
2010-03-30 16:02:19 +02:00
|
|
|
#stime=`perl -e 'print time();' 2>/dev/null || date +%s`
|
2010-02-07 22:43:48 +01:00
|
|
|
build_dir=$TARGET/${VENDOR}_${MAINBOARD}
|
2011-11-05 12:55:18 +01:00
|
|
|
eval $MAKE $silent DOTCONFIG=${build_dir}/config.build obj=${build_dir} objutil=$TARGET/sharedutils \
|
2010-02-07 22:43:48 +01:00
|
|
|
&> ${build_dir}/make.log
|
|
|
|
ret=$?
|
2011-11-05 12:47:13 +01:00
|
|
|
cp .xcompile ${build_dir}/xcompile.build
|
2010-02-07 22:43:48 +01:00
|
|
|
cd $TARGET/${VENDOR}_${MAINBOARD}
|
2010-03-30 16:02:19 +02:00
|
|
|
|
2010-02-10 19:08:22 +01:00
|
|
|
etime=`perl -e 'print time();' 2>/dev/null || date +%s`
|
2005-12-04 21:35:56 +01:00
|
|
|
duration=$(( $etime - $stime ))
|
2010-03-30 16:02:19 +02:00
|
|
|
xml " <buildtime>${duration}s</buildtime>"
|
2011-06-03 21:56:13 +02:00
|
|
|
junit " <testcase classname='board' name='$TARCH/$VENDOR/$MAINBOARD' time='$duration' >"
|
2010-03-30 16:02:19 +02:00
|
|
|
|
|
|
|
xml " <log>"
|
|
|
|
xmlfile make.log
|
|
|
|
xml " </log>"
|
|
|
|
|
2005-12-04 21:42:37 +01:00
|
|
|
if [ $ret -eq 0 ]; then
|
2006-05-27 02:22:02 +02:00
|
|
|
xml " <compile>ok</compile>"
|
2011-06-03 21:56:13 +02:00
|
|
|
junit "<system-out>"
|
|
|
|
junitfile make.log
|
|
|
|
junit "</system-out>"
|
2006-10-25 21:02:34 +02:00
|
|
|
printf "ok\n" > compile.status
|
|
|
|
printf "ok. (took ${duration}s)\n"
|
2004-10-19 09:00:47 +02:00
|
|
|
cd $CURR
|
2004-11-04 12:04:33 +01:00
|
|
|
return 0
|
2004-10-19 09:00:47 +02:00
|
|
|
else
|
2006-05-27 02:22:02 +02:00
|
|
|
xml " <compile>failed</compile>"
|
2011-06-03 21:56:13 +02:00
|
|
|
junit "<failure type='BuildFailed'>"
|
|
|
|
junitfile make.log
|
|
|
|
junit "</failure>"
|
2010-03-30 16:02:19 +02:00
|
|
|
printf "FAILED after ${duration}s!\nLog excerpt:\n"
|
2009-05-26 16:03:51 +02:00
|
|
|
tail -n $CONTEXT make.log 2> /dev/null || tail -$CONTEXT make.log
|
2004-10-19 09:00:47 +02:00
|
|
|
cd $CURR
|
2011-06-01 21:29:48 +02:00
|
|
|
failed=1
|
2004-10-19 09:00:47 +02:00
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function build_target
|
|
|
|
{
|
|
|
|
VENDOR=$1
|
|
|
|
MAINBOARD=$2
|
2009-04-23 01:39:19 +02:00
|
|
|
CONFIG=$3
|
2004-10-19 09:00:47 +02:00
|
|
|
TARCH=$( architecture $VENDOR $MAINBOARD )
|
2004-11-05 01:25:19 +01:00
|
|
|
|
2012-11-22 14:19:43 +01:00
|
|
|
if [ "`cat $TOP/$TARGET/${VENDOR}_${MAINBOARD}/compile.status 2>/dev/null`" = "ok" -a \
|
|
|
|
"$buildall" = "false" ]; then
|
|
|
|
printf "Skipping $VENDOR/$MAINBOARD; (already successful)\n"
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2004-11-05 01:25:19 +01:00
|
|
|
# default setting
|
2008-05-27 20:29:26 +02:00
|
|
|
|
2009-03-11 16:00:50 +01:00
|
|
|
CC="${CROSS_COMPILE}gcc"
|
|
|
|
CROSS_COMPILE=""
|
|
|
|
found_crosscompiler=false
|
|
|
|
if which $TARCH-elf-gcc 2>/dev/null >/dev/null; then
|
|
|
|
# i386-elf target needs --divide, for i386-linux, that's the default
|
|
|
|
if [ "$TARCH" = "i386" ]; then
|
|
|
|
CC="$CC -Wa,--divide"
|
|
|
|
fi
|
2008-05-27 20:29:26 +02:00
|
|
|
CROSS_COMPILE="$TARCH-elf-"
|
2009-06-06 09:19:53 +02:00
|
|
|
CC=gcc
|
2010-03-30 16:02:19 +02:00
|
|
|
CROSS_TEXT=", using $CROSS_COMPILE$CC"
|
2009-03-11 16:00:50 +01:00
|
|
|
found_crosscompiler=true
|
2008-05-27 20:29:26 +02:00
|
|
|
fi
|
2009-03-11 16:43:02 +01:00
|
|
|
|
2009-03-11 16:00:50 +01:00
|
|
|
HOSTCC='gcc'
|
2004-11-05 11:48:04 +01:00
|
|
|
|
2010-03-30 16:02:19 +02:00
|
|
|
printf "Building $VENDOR/$MAINBOARD; "
|
2012-05-21 20:10:04 +02:00
|
|
|
mkdir -p $TOP/$TARGET/${VENDOR}_${MAINBOARD}
|
2011-11-05 13:21:14 +01:00
|
|
|
XMLFILE=$TOP/$TARGET/${VENDOR}_${MAINBOARD}/abuild.xml
|
2006-05-27 02:22:02 +02:00
|
|
|
|
|
|
|
xml "<mainboard>"
|
|
|
|
xml ""
|
|
|
|
xml " <vendor>$VENDOR</vendor>"
|
|
|
|
xml " <device>$MAINBOARD</device>"
|
|
|
|
xml ""
|
|
|
|
xml " <architecture>$TARCH</architecture>"
|
|
|
|
xml ""
|
2009-04-11 01:02:48 +02:00
|
|
|
|
2009-03-11 16:00:50 +01:00
|
|
|
if [ "$ARCH" = "$TARCH" -o $found_crosscompiler = true ]; then
|
2010-03-30 16:02:19 +02:00
|
|
|
printf "$TARCH: ok$CROSS_TEXT\n"
|
2004-11-05 01:25:19 +01:00
|
|
|
else
|
2010-03-30 16:02:19 +02:00
|
|
|
# FIXME this is basically the same as above.
|
2004-11-05 01:25:19 +01:00
|
|
|
found_crosscompiler=false
|
|
|
|
if [ "$ARCH" == amd64 -a "$TARCH" == i386 ]; then
|
|
|
|
CC="gcc -m32"
|
|
|
|
found_crosscompiler=true
|
|
|
|
fi
|
|
|
|
if [ "$ARCH" == ppc64 -a "$TARCH" == ppc ]; then
|
|
|
|
CC="gcc -m32"
|
|
|
|
found_crosscompiler=true
|
2004-10-19 09:00:47 +02:00
|
|
|
fi
|
2004-11-06 00:19:46 +01:00
|
|
|
if [ "$found_crosscompiler" == "false" -a "$TARCH" == ppc ];then
|
|
|
|
for prefix in powerpc-eabi- powerpc-linux- ppc_74xx- \
|
2009-03-14 17:33:22 +01:00
|
|
|
powerpc-7450-linux-gnu- powerpc-elf-; do
|
2004-11-05 11:48:04 +01:00
|
|
|
if ${prefix}gcc --version > /dev/null 2> /dev/null ; then
|
|
|
|
found_crosscompiler=true
|
|
|
|
CROSS_COMPILE=$prefix
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2012-12-08 00:38:40 +01:00
|
|
|
if [ "$found_crosscompiler" == "false" -a "$TARCH" == ARMV7 ];then
|
|
|
|
for prefix in armv7a-eabi- armv7a-cros-linux-gnueabi-; do
|
|
|
|
if ${prefix}gcc --version > /dev/null 2> /dev/null ; then
|
|
|
|
found_crosscompiler=true
|
|
|
|
CROSS_COMPILE=$prefix
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2004-11-05 01:25:19 +01:00
|
|
|
# TBD: look for suitable cross compiler suite
|
|
|
|
# cross-$TARCH-gcc and cross-$TARCH-ld
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2004-11-05 01:25:19 +01:00
|
|
|
# Check result:
|
|
|
|
if [ $found_crosscompiler == "false" ]; then
|
2010-03-30 16:02:19 +02:00
|
|
|
printf "$TARCH: skipped, we're $ARCH\n\n"
|
2006-06-26 18:51:06 +02:00
|
|
|
xml " <status>notbuilt</status>"
|
|
|
|
xml ""
|
|
|
|
xml "</mainboard>"
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2012-12-07 22:13:26 +01:00
|
|
|
junit "<testcase classname='board' name='$TARCH/$VENDOR/$MAINBOARD' >"
|
|
|
|
junit " <failure type='NoCrossCompiler'>No cross-compiler for $TARCH found</failure>"
|
|
|
|
junit "</testcase>"
|
2011-06-03 21:56:13 +02:00
|
|
|
|
2004-11-05 01:25:19 +01:00
|
|
|
return 0
|
2004-11-05 11:48:04 +01:00
|
|
|
else
|
2010-03-30 16:02:19 +02:00
|
|
|
printf "$TARCH: ok, $ARCH using ${CROSS_COMPILE}gcc\n"
|
2006-06-26 18:51:06 +02:00
|
|
|
xml " <compiler>"
|
|
|
|
xml " <path>`which ${CROSS_COMPILE}gcc`</path>"
|
|
|
|
xml " <version>`${CROSS_COMPILE}gcc --version | head -1`</version>"
|
|
|
|
xml " </compiler>"
|
|
|
|
xml ""
|
2004-11-05 01:25:19 +01:00
|
|
|
fi
|
|
|
|
fi
|
2004-11-05 20:55:06 +01:00
|
|
|
|
2009-03-15 10:55:17 +01:00
|
|
|
CC=${CROSS_COMPILE}$CC
|
|
|
|
|
2009-03-11 16:43:02 +01:00
|
|
|
if [ "$stackprotect" = "true" ]; then
|
|
|
|
CC="$CC -fno-stack-protector"
|
|
|
|
fi
|
|
|
|
|
2010-03-30 16:02:19 +02:00
|
|
|
stime=`perl -e 'print time();' 2>/dev/null || date +%s`
|
2009-04-23 01:39:19 +02:00
|
|
|
create_buildenv $VENDOR $MAINBOARD $CONFIG
|
2009-03-11 16:00:50 +01:00
|
|
|
if [ $? -eq 0 -a $configureonly -eq 0 ]; then
|
2010-04-19 22:39:22 +02:00
|
|
|
if [ "$scanbuild" = "true" ]; then
|
|
|
|
rm -rf $TARGET/scan-build-results-tmp
|
|
|
|
fi
|
2010-04-27 08:56:47 +02:00
|
|
|
compile_target $VENDOR $MAINBOARD &&
|
2006-10-25 21:02:34 +02:00
|
|
|
xml " <status>ok</status>" ||
|
2006-05-27 02:22:02 +02:00
|
|
|
xml "<status>broken</status>"
|
2009-03-11 16:43:02 +01:00
|
|
|
if [ "$scanbuild" = "true" ]; then
|
2010-04-19 22:39:22 +02:00
|
|
|
rm -rf $TARGET/${VENDOR}_${MAINBOARD}-scanbuild
|
2009-03-11 16:43:02 +01:00
|
|
|
mv `dirname $TARGET/scan-build-results-tmp/*/index.html` $TARGET/${VENDOR}_${MAINBOARD}-scanbuild
|
|
|
|
fi
|
2004-10-19 09:00:47 +02:00
|
|
|
fi
|
2010-03-30 16:02:19 +02:00
|
|
|
# Not calculated here because we still print it in compile_target
|
|
|
|
#etime=`perl -e 'print time();' 2>/dev/null || date +%s`
|
|
|
|
#duration=$(( $etime - $stime ))
|
|
|
|
#xml " <buildtime>${duration}s</buildtime>"
|
2004-11-05 15:06:24 +01:00
|
|
|
|
2006-05-27 02:22:02 +02:00
|
|
|
xml ""
|
|
|
|
xml "</mainboard>"
|
2011-06-03 21:56:13 +02:00
|
|
|
junit "</testcase>"
|
2006-05-27 02:22:02 +02:00
|
|
|
|
2006-10-25 21:02:34 +02:00
|
|
|
printf "\n"
|
|
|
|
}
|
|
|
|
|
|
|
|
function test_target
|
|
|
|
{
|
|
|
|
VENDOR=$1
|
|
|
|
MAINBOARD=$2
|
|
|
|
|
|
|
|
if [ "$hwtest" != "true" ]; then
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# image does not exist. we silently skip the patch.
|
2008-01-18 16:08:58 +01:00
|
|
|
if [ ! -r "$TARGET/${VENDOR}_${MAINBOARD}/coreboot.rom" ]; then
|
2006-10-25 21:02:34 +02:00
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
which curl &> /dev/null
|
|
|
|
if [ $? != 0 ]; then
|
|
|
|
printf "curl is not installed but required for test submission. skipping test.\n\n"
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
CURR=`pwd`
|
|
|
|
if [ -r "$TARGET/${VENDOR}_${MAINBOARD}/tested" ]; then
|
|
|
|
printf "Testing image for board $VENDOR $MAINBOARD skipped (previously submitted).\n\n"
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
# touch $TARGET/${VENDOR}_${MAINBOARD}/tested
|
|
|
|
|
|
|
|
printf "Submitting image for board $VENDOR $MAINBOARD to test system...\n"
|
|
|
|
|
2008-01-18 16:08:58 +01:00
|
|
|
curl -f -F "romfile=@$TARGET/${VENDOR}_${MAINBOARD}/coreboot.rom" \
|
2006-10-25 21:02:34 +02:00
|
|
|
-F "mode=abuild" -F "mainboard=${VENDOR}_${MAINBOARD}" -F "submit=Upload" \
|
2008-01-18 16:08:58 +01:00
|
|
|
"http://qa.coreboot.org/deployment/send.php"
|
2006-10-25 21:02:34 +02:00
|
|
|
|
|
|
|
printf "\n"
|
|
|
|
return 0
|
2004-11-05 15:06:24 +01:00
|
|
|
}
|
2004-10-19 09:00:47 +02:00
|
|
|
|
2009-04-15 18:07:27 +02:00
|
|
|
function remove_target
|
|
|
|
{
|
|
|
|
if [ "$remove" != "true" ]; then
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
VENDOR=$1
|
|
|
|
MAINBOARD=$2
|
|
|
|
|
|
|
|
# Save the generated coreboot.rom file of each board.
|
|
|
|
if [ -r "$TARGET/${VENDOR}_${MAINBOARD}/coreboot.rom" ]; then
|
|
|
|
cp $TARGET/${VENDOR}_${MAINBOARD}/coreboot.rom \
|
|
|
|
${VENDOR}_${MAINBOARD}_coreboot.rom
|
|
|
|
fi
|
|
|
|
|
|
|
|
printf "Removing build dir for board $VENDOR $MAINBOARD...\n"
|
|
|
|
rm -rf $TARGET/${VENDOR}_${MAINBOARD}
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2004-11-05 01:25:19 +01:00
|
|
|
function myhelp
|
|
|
|
{
|
2009-04-15 18:07:27 +02:00
|
|
|
printf "Usage: $0 [-v] [-a] [-b] [-r] [-t <vendor/board>] [-p <dir>] [lbroot]\n"
|
2006-10-25 21:02:34 +02:00
|
|
|
printf " $0 [-V|--version]\n"
|
2006-11-10 14:30:28 +01:00
|
|
|
printf " $0 [-h|--help]\n\n"
|
|
|
|
|
2006-10-25 21:02:34 +02:00
|
|
|
printf "Options:\n"
|
|
|
|
printf " [-v|--verbose] print more messages\n"
|
|
|
|
printf " [-a|--all] build previously succeeded ports as well\n"
|
2009-04-15 18:07:27 +02:00
|
|
|
printf " [-r|--remove] remove output dir after build\n"
|
2006-10-25 21:02:34 +02:00
|
|
|
printf " [-t|--target <vendor/board>] attempt to build target vendor/board only\n"
|
|
|
|
printf " [-p|--payloads <dir>] use payloads in <dir> to build images\n"
|
|
|
|
printf " [-V|--version] print version number and exit\n"
|
|
|
|
printf " [-h|--help] print this help and exit\n"
|
|
|
|
printf " [-x|--xml] write xml log file \n"
|
|
|
|
printf " (defaults to $XMLFILE)\n"
|
2011-06-03 21:56:13 +02:00
|
|
|
printf " [-J|--junit] write JUnit formatted xml log file \n"
|
|
|
|
printf " (defaults to $XMLFILE)\n"
|
2006-10-25 21:02:34 +02:00
|
|
|
printf " [-T|--test] submit image(s) to automated test system\n"
|
2008-05-27 20:29:26 +02:00
|
|
|
printf " [-c|--cpus <numcpus>] build on <numcpus> at the same time\n"
|
|
|
|
printf " [-s|--silent] omit compiler calls in logs\n"
|
2008-09-30 19:09:44 +02:00
|
|
|
printf " [-ns|--nostackprotect] use gcc -fno-stack-protector option\n"
|
2009-03-11 16:43:02 +01:00
|
|
|
printf " [-sb|--scan-build] use clang's static analyzer\n"
|
2010-03-25 22:45:25 +01:00
|
|
|
printf " [-y|--ccache] use ccache\n"
|
2009-03-11 16:00:50 +01:00
|
|
|
printf " [-C|--config] configure-only mode\n"
|
2009-04-23 01:39:19 +02:00
|
|
|
printf " [-l|--loglevel <num>] set loglevel\n"
|
2010-03-30 16:02:19 +02:00
|
|
|
printf " [-u|--update] update existing image\n"
|
|
|
|
printf " [-P|--prefix <name>] file name prefix in CBFS\n"
|
2012-04-30 22:55:28 +02:00
|
|
|
printf " [-B|--blobs] Allow using binary files\n"
|
2012-05-01 15:14:46 +02:00
|
|
|
printf " [cbroot] absolute path to coreboot sources\n"
|
2010-01-30 11:44:28 +01:00
|
|
|
printf " (defaults to $ROOT)\n\n"
|
2004-11-05 01:25:19 +01:00
|
|
|
}
|
|
|
|
|
2010-04-27 08:56:47 +02:00
|
|
|
function myversion
|
2004-11-05 01:25:19 +01:00
|
|
|
{
|
|
|
|
cat << EOF
|
|
|
|
|
2008-01-18 16:08:58 +01:00
|
|
|
coreboot autobuild v$ABUILD_VERSION ($ABUILD_DATE)
|
2004-11-05 01:25:19 +01:00
|
|
|
|
2006-05-27 02:22:02 +02:00
|
|
|
Copyright (C) 2004 by Stefan Reinauer <stepan@openbios.org>
|
2010-01-30 11:44:28 +01:00
|
|
|
Copyright (C) 2006-2010 by coresystems GmbH <info@coresystems.de>
|
2006-10-25 21:02:34 +02:00
|
|
|
|
2004-11-05 01:25:19 +01:00
|
|
|
This program is free software; you may redistribute it under the terms
|
|
|
|
of the GNU General Public License. This program has absolutely no
|
|
|
|
warranty.
|
|
|
|
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
# default options
|
|
|
|
target=""
|
|
|
|
buildall=false
|
2004-11-05 12:57:00 +01:00
|
|
|
verbose=false
|
2004-11-05 01:25:19 +01:00
|
|
|
|
2010-04-08 13:37:43 +02:00
|
|
|
test -f util/sconfig/sconfig.l && ROOT=$( pwd )
|
|
|
|
test -f ../util/sconfig/sconfig.l && ROOT=$( cd ..; pwd )
|
2010-01-30 11:44:28 +01:00
|
|
|
test "$ROOT" = "" && ROOT=$( cd ../..; pwd )
|
2009-07-01 14:26:11 +02:00
|
|
|
|
2012-04-05 11:17:01 +02:00
|
|
|
# Look if we have getopt. If not, build it.
|
|
|
|
export PATH=$PATH:util/abuild
|
|
|
|
getopt - > /dev/null 2>/dev/null || gcc -o util/abuild/getopt util/abuild/getopt.c
|
|
|
|
|
2011-11-05 14:44:41 +01:00
|
|
|
# command line for xargs parallelization. Thus overwrite -c X
|
|
|
|
cmdline="$* -c 1"
|
|
|
|
|
2008-05-27 20:29:26 +02:00
|
|
|
# parse parameters.. try to find out whether we're running GNU getopt
|
2008-05-28 10:40:23 +02:00
|
|
|
getoptbrand="`getopt -V`"
|
|
|
|
if [ "${getoptbrand:0:6}" == "getopt" ]; then
|
|
|
|
# Detected GNU getopt that supports long options.
|
2012-05-31 00:03:48 +02:00
|
|
|
args=`getopt -l version,verbose,help,all,target:,payloads:,test,cpus:,silent,junit,xml,config,loglevel:,remove,prefix:,update,nostackprotect,scan-build,ccache,blobs -o Vvhat:p:Tc:sJxCl:rP:uyB -- "$@"` || exit 1
|
2010-09-27 23:14:19 +02:00
|
|
|
eval set -- $args
|
2008-05-27 20:29:26 +02:00
|
|
|
else
|
|
|
|
# Detected non-GNU getopt
|
2011-06-03 21:56:13 +02:00
|
|
|
args=`getopt Vvhat:bp:Tc:sJxCl:rP:uy $*`
|
2008-05-27 20:29:26 +02:00
|
|
|
set -- $args
|
|
|
|
fi
|
2004-11-05 01:25:19 +01:00
|
|
|
|
|
|
|
if [ $? != 0 ]; then
|
|
|
|
myhelp
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2012-05-01 15:14:46 +02:00
|
|
|
customizing=""
|
|
|
|
configoptions=""
|
2004-11-05 09:50:54 +01:00
|
|
|
while true ; do
|
2004-11-05 12:24:57 +01:00
|
|
|
case "$1" in
|
2006-05-27 02:22:02 +02:00
|
|
|
-x|--xml) shift; mode=xml; rm -f $XMLFILE ;;
|
2011-06-03 21:56:13 +02:00
|
|
|
-J|--junit) shift; mode=junit; rm -f $XMLFILE ;;
|
2004-11-05 15:06:24 +01:00
|
|
|
-t|--target) shift; target="$1"; shift;;
|
2004-11-05 09:50:54 +01:00
|
|
|
-a|--all) shift; buildall=true;;
|
2010-09-27 23:14:19 +02:00
|
|
|
-r|--remove) shift; remove=true;;
|
2010-03-25 20:01:27 +01:00
|
|
|
-v|--verbose) shift; verbose=true; silent='V=1';;
|
2004-11-05 12:47:41 +01:00
|
|
|
-V|--version) shift; myversion; exit 0;;
|
2006-10-25 21:02:34 +02:00
|
|
|
-h|--help) shift; myversion; myhelp; exit 0;;
|
2006-09-15 19:00:11 +02:00
|
|
|
-p|--payloads) shift; payloads="$1"; shift;;
|
2006-10-25 21:02:34 +02:00
|
|
|
-T|--test) shift; hwtest=true;;
|
2012-05-01 15:14:46 +02:00
|
|
|
-c|--cpus) shift
|
|
|
|
export MAKEFLAGS="-j $1"
|
2012-05-31 00:03:48 +02:00
|
|
|
test "$MAKEFLAGS" == "-j max" && export MAKEFLAGS="-j" && cpuconfig="in parallel"
|
2012-05-01 15:14:46 +02:00
|
|
|
test "$1" == "1" && cpuconfig="on 1 cpu"
|
2012-05-31 00:03:48 +02:00
|
|
|
expr "$1" : '-\?[0-9]\+$' > /dev/null && test 0$1 -gt 1 && cpuconfig="on $1 cpus in parallel"
|
2012-05-01 15:14:46 +02:00
|
|
|
shift;;
|
2008-05-27 20:29:26 +02:00
|
|
|
-s|--silent) shift; silent="-s";;
|
2008-09-30 19:09:44 +02:00
|
|
|
-ns|--nostackprotect) shift; stackprotect=true;;
|
2012-05-01 15:14:46 +02:00
|
|
|
-sb|--scan-build) shift
|
|
|
|
scanbuild=true
|
|
|
|
customizing="${customizing}, scan-build"
|
|
|
|
configoptions="${configoptions}CONFIG_SCANBUILD_ENABLE=y\nCONFIG_SCANBUILD_REPORT_LOCATION=\"$TARGET/scan-build-results-tmp\""
|
|
|
|
;;
|
|
|
|
-y|--ccache) shift
|
|
|
|
customizing="${customizing}, ccache"
|
|
|
|
configoptions="${configoptions}CONFIG_CCACHE=y\n"
|
|
|
|
;;
|
2009-03-11 16:00:50 +01:00
|
|
|
-C|--config) shift; configureonly=1;;
|
2012-05-01 15:14:46 +02:00
|
|
|
-l|--loglevel) shift
|
|
|
|
customizing="${customizing}, loglevel $1"
|
|
|
|
configoptions="${configoptions}CONFIG_DEFAULT_CONSOLE_LOGLEVEL_$1=y\n"
|
|
|
|
configoptions="${configoptions}CONFIG_DEFAULT_CONSOLE_LOGLEVEL=$1\n"
|
|
|
|
shift;;
|
|
|
|
-u|--update) shift
|
|
|
|
customizing="${customizing}, update"
|
|
|
|
configoptions="${configoptions}CONFIG_UPDATE_IMAGE=y\n"
|
|
|
|
;;
|
|
|
|
-P|--prefix) shift
|
|
|
|
customizing="${customizing}, cbfs prefix $1"
|
|
|
|
configoptions="${configoptions}CONFIG_CBFS_PREFIX=\"$1\""
|
|
|
|
shift;;
|
|
|
|
-B|--blobs) shift
|
|
|
|
customizing="${customizing}, blobs"
|
|
|
|
configoptions="${configoptions}CONFIG_USE_BLOBS=y\n"
|
|
|
|
;;
|
2004-11-05 09:50:54 +01:00
|
|
|
--) shift; break;;
|
2006-10-25 21:02:34 +02:00
|
|
|
-*) printf "Invalid option\n\n"; myhelp; exit 1;;
|
2004-11-05 12:24:57 +01:00
|
|
|
*) break;;
|
2004-11-05 09:50:54 +01:00
|
|
|
esac
|
2004-11-05 01:25:19 +01:00
|
|
|
done
|
|
|
|
|
2012-05-01 15:14:46 +02:00
|
|
|
customizing=`echo $customizing |cut -c3-`
|
|
|
|
if [ "$customizing" = "" ]; then
|
|
|
|
customizing="default configuration"
|
|
|
|
fi
|
|
|
|
|
2011-11-05 14:44:41 +01:00
|
|
|
USE_XARGS=0
|
2011-11-05 12:55:18 +01:00
|
|
|
if [ "$cpus" != "1" ]; then
|
2011-11-05 14:44:41 +01:00
|
|
|
if [ "$target" = "" ]; then
|
|
|
|
# Test if xargs supports the non-standard -P flag
|
2012-05-21 20:10:04 +02:00
|
|
|
# FIXME: disabled until we managed to eliminate all the make(1) quirks
|
2012-05-31 00:03:48 +02:00
|
|
|
echo | xargs -P 0$cpus -n 1 echo 2>/dev/null >/dev/null # && USE_XARGS=1
|
2011-11-05 14:44:41 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$USE_XARGS" = "0" ]; then
|
2012-05-31 00:03:48 +02:00
|
|
|
test "$MAKEFLAGS" == "" && test "$cpus" != "" && export MAKEFLAGS="-j $cpus"
|
2011-11-05 14:44:41 +01:00
|
|
|
build_all_targets()
|
|
|
|
{
|
|
|
|
for VENDOR in $( vendors ); do
|
|
|
|
for MAINBOARD in $( mainboards $VENDOR ); do
|
|
|
|
build_target $VENDOR $MAINBOARD
|
|
|
|
test_target $VENDOR $MAINBOARD
|
|
|
|
remove_target $VENDOR $MAINBOARD
|
|
|
|
done
|
|
|
|
done
|
|
|
|
}
|
|
|
|
else
|
|
|
|
# Limit to 32 parallel builds for now.
|
|
|
|
# Thrashing all caches because we run
|
|
|
|
# 160 abuilds in parallel is no fun.
|
|
|
|
if [ "$cpus" = "" ]; then
|
|
|
|
cpus=32
|
|
|
|
fi
|
|
|
|
build_all_targets()
|
|
|
|
{
|
|
|
|
# seed shared utils
|
|
|
|
TMPCFG=`mktemp`
|
|
|
|
if [ "$enable_blobs" = "true" ]; then
|
|
|
|
echo "CONFIG_USE_BLOBS=y" > $TMPCFG
|
|
|
|
fi
|
|
|
|
make -j $cpus DOTCONFIG=$TMPCFG obj=coreboot-builds/temp objutil=coreboot-builds/sharedutils tools
|
|
|
|
rm -rf coreboot-builds/temp $TMPCFG
|
|
|
|
for VENDOR in $( vendors ); do
|
|
|
|
for MAINBOARD in $( mainboards $VENDOR ); do
|
|
|
|
echo $VENDOR/$MAINBOARD
|
|
|
|
done
|
|
|
|
done | xargs -P 0$cpus -n 1 $0 $cmdline -t
|
|
|
|
}
|
2011-11-05 12:55:18 +01:00
|
|
|
fi
|
|
|
|
|
2010-01-30 11:44:28 +01:00
|
|
|
test -z "$1" || ROOT=$1
|
2004-11-05 01:25:19 +01:00
|
|
|
|
2010-01-30 11:44:28 +01:00
|
|
|
debug "ROOT=$ROOT"
|
2004-11-05 01:25:19 +01:00
|
|
|
|
2006-05-27 02:22:02 +02:00
|
|
|
xml '<?xml version="1.0" encoding="utf-8"?>'
|
|
|
|
xml '<abuild>'
|
|
|
|
|
2011-06-03 21:56:13 +02:00
|
|
|
junit '<?xml version="1.0" encoding="utf-8"?>'
|
|
|
|
junit '<testsuite>'
|
|
|
|
|
2004-11-05 01:26:31 +01:00
|
|
|
if [ "$target" != "" ]; then
|
2004-11-05 11:48:04 +01:00
|
|
|
# build a single board
|
2006-10-25 21:02:34 +02:00
|
|
|
VENDOR=`printf $target|cut -f1 -d/`
|
|
|
|
MAINBOARD=`printf $target|cut -f2 -d/`
|
2009-04-23 01:39:19 +02:00
|
|
|
CONFIG=`printf $target|cut -f3 -d/`
|
2010-03-29 18:23:42 +02:00
|
|
|
if [ ! -r $ROOT/src/mainboard/$target ]; then
|
|
|
|
printf "No such target: $target\n"
|
2011-11-05 14:44:41 +01:00
|
|
|
failed=1
|
|
|
|
else
|
|
|
|
build_target $VENDOR $MAINBOARD $CONFIG
|
|
|
|
test_target $VENDOR $MAINBOARD
|
|
|
|
test "$mode" != "text" && cat $TARGET/${VENDOR}_${MAINBOARD}/abuild.xml >> $REAL_XMLFILE
|
|
|
|
XMLFILE=$REAL_XMLFILE
|
2010-03-29 18:23:42 +02:00
|
|
|
fi
|
2004-11-05 01:25:19 +01:00
|
|
|
else
|
2011-11-05 14:44:41 +01:00
|
|
|
build_all_targets
|
|
|
|
rm -f $REAL_XMLFILE
|
2012-05-21 20:10:04 +02:00
|
|
|
XMLFILE=$REAL_XMLFILE
|
2011-11-05 14:44:41 +01:00
|
|
|
xml '<?xml version="1.0" encoding="utf-8"?>'
|
|
|
|
xml '<abuild>'
|
|
|
|
|
|
|
|
junit '<?xml version="1.0" encoding="utf-8"?>'
|
|
|
|
junit '<testsuite>'
|
2011-11-07 19:01:54 +01:00
|
|
|
if [ "$mode" != "text" ]; then
|
|
|
|
for xmlfile in $TARGET/*_*/abuild.xml; do
|
|
|
|
cat $xmlfile >> $REAL_XMLFILE
|
|
|
|
done
|
|
|
|
fi
|
2011-11-05 13:21:14 +01:00
|
|
|
XMLFILE=$REAL_XMLFILE
|
2004-11-05 01:25:19 +01:00
|
|
|
fi
|
2006-05-27 02:22:02 +02:00
|
|
|
xml '</abuild>'
|
2011-06-03 21:56:13 +02:00
|
|
|
junit '</testsuite>'
|
2004-10-19 09:00:47 +02:00
|
|
|
|
2011-06-01 21:29:48 +02:00
|
|
|
exit $failed
|