# This script builds LinuxBIOS images for all available targets.
#
# (C) 2004 by Stefan Reinauer <stepan@openbios.org>
+# (C) 2006 by coresystems GmbH <info@coresystems.de>
#
# 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
# Where shall we place all the build trees?
TARGET=$( pwd )/linuxbios-builds
+XMLFILE=$( pwd )/abuild.xml
# path to payload. Should be more generic
PAYLOAD=/dev/null
MAKE="make"
PYTHON=python
+# this can be changed to xml by -x
+mode=text
+
ARCH=`uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
-e s/arm.*/arm/ -e s/sa110/arm/ -e s/x86_64/amd64/ \
-e "s/Power Macintosh/ppc/"`
test "$verbose" == "true" && echo $*
}
+function xml
+{
+ test "$mode" == "xml" && echo "$*" >> $XMLFILE
+}
+
+function xmlfile
+{
+ test "$mode" == "xml" && { echo '<![CDATA['; cat $1; echo ']]>'; } >> $XMLFILE
+}
+
+
+
function vendors
{
# make this a function so we can easily select
if [ -f $TARGCONFIG ]; then
cp $TARGCONFIG $TARGET/Config-${VENDOR}_${MAINBOARD}.lb
echo "Used existing test target $TARGCONFIG"
+ xml " <config>$TARGCONFIG</config>"
return
fi
echo -n " Creating config file..."
+ xml " <config>autogenerated</config>"
( cat << EOF
# This will make a target directory of ./VENDOR_MAINBOARD
$PYTHON $config_py $config_lb $LBROOT &> $build_dir/config.log
if [ $? -eq 0 ]; then
echo "ok"
+ xml " <builddir>ok</builddir>"
+ xml ""
+ return 0
else
echo "FAILED! Log excerpt:"
+ xml " <builddir>failed</builddir>"
+ xml " <log>"
+ xmlfile $build_dir/config.log
+ xml " </log>"
+ xml ""
tail -n $CONTEXT $build_dir/config.log
return 1
fi
etime=`date +%s`
duration=$(( $etime - $stime ))
if [ $ret -eq 0 ]; then
+ xml " <compile>ok</compile>"
+ xml " <compiletime>${duration}s</compiletime>"
echo "ok" > compile.status
echo "ok. (took ${duration}s)"
cd $CURR
return 0
else
+ xml " <compile>failed</compile>"
+ xml " <compiletime>${duration}s</compiletime>"
+ xml " <log>"
+ xmlfile make.log
+ xml " </log>"
+
echo "FAILED after ${duration}s! Log excerpt:"
tail -n $CONTEXT make.log
cd $CURR
CROSS_COMPILE=''
echo -n "Processing mainboard/$VENDOR/$MAINBOARD"
+
+ xml "<mainboard>"
+ xml ""
+ xml " <vendor>$VENDOR</vendor>"
+ xml " <device>$MAINBOARD</device>"
+ xml ""
+ xml " <architecture>$TARCH</architecture>"
+ xml ""
[ -r "$LBROOT/src/mainboard/${VENDOR}/${MAINBOARD}/abuild.info" ] && \
source $LBROOT/src/mainboard/${VENDOR}/${MAINBOARD}/abuild.info
done
fi
+ xml " <compiler>"
+ xml " <path>`which ${CROSS_COMPILE}gcc`</path>"
+ xml " <version>`${CROSS_COMPILE}gcc --version | head -1`</version>"
+ xml " </compiler>"
+ xml ""
+
# TBD: look for suitable cross compiler suite
# cross-$TARCH-gcc and cross-$TARCH-ld
{
echo " ( mainboard/$VENDOR/$MAINBOARD previously ok )"
echo
+ xml " <status>previouslyok</status>"
+ xml ""
+ xml "</mainboard>"
return 0
}
{
echo " ( broken mainboard/$VENDOR/$MAINBOARD skipped )"
echo
+ xml " <status>knownbroken</status>"
+ xml ""
+ xml "</mainboard>"
return 0
}
create_buildenv $VENDOR $MAINBOARD
if [ $? -eq 0 ]; then
- compile_target $VENDOR $MAINBOARD
+ compile_target $VENDOR $MAINBOARD &&
+ xml "<status>ok</status>" ||
+ xml "<status>broken</status>"
fi
+ xml ""
+ xml "</mainboard>"
+
echo
}
echo " [-t|--target <vendor/board>] attempt to build target vendor/board only"
echo " [-V|--version] print version number and exit"
echo " [-h|--help] print this help and exit"
+ echo " [-x|--xml] write xml log file $XMLFILE"
echo " [lbroot] absolute path to LinuxBIOS sources"
echo " (defaults to $LBROOT)"
echo
{
cat << EOF
-LinuxBIOS autobuild: V0.1.
+LinuxBIOS autobuild: V0.2.
-Copyright (C) 2004 by Stefan Reinauer, <stepan@openbios.org>
+Copyright (C) 2004 by Stefan Reinauer <stepan@openbios.org>
+Copyright (C) 2006 by coresystems GmbH <info@coresystems.de>
This program is free software; you may redistribute it under the terms
of the GNU General Public License. This program has absolutely no
warranty.
eval set "$args"
while true ; do
case "$1" in
+ -x|--xml) shift; mode=xml; rm -f $XMLFILE ;;
-t|--target) shift; target="$1"; shift;;
-a|--all) shift; buildall=true;;
-b|--broken) shift; buildbroken=true;;
debug "LBROOT=$LBROOT"
+xml '<?xml version="1.0" encoding="utf-8"?>'
+xml '<abuild>'
+
if [ "$target" != "" ]; then
# build a single board
VENDOR=`echo $target|cut -f1 -d/`
done
done
fi
+xml '</abuild>'