From 192b7bc44570f7b4268141f81ffca7a6b5f6fe21 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Sat, 27 May 2006 00:22:02 +0000 Subject: add full xml logging to abuild to work on the complete information git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2314 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/abuild/abuild.sh | 73 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 70 insertions(+), 3 deletions(-) (limited to 'util/abuild') diff --git a/util/abuild/abuild.sh b/util/abuild/abuild.sh index b0ccf666fb..87986b21f7 100755 --- a/util/abuild/abuild.sh +++ b/util/abuild/abuild.sh @@ -5,6 +5,7 @@ # This script builds LinuxBIOS images for all available targets. # # (C) 2004 by Stefan Reinauer +# (C) 2006 by coresystems GmbH # # 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 @@ -15,6 +16,7 @@ # 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 @@ -26,6 +28,9 @@ CONTEXT=5 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/"` @@ -35,6 +40,18 @@ function debug test "$verbose" == "true" && echo $* } +function xml +{ + test "$mode" == "xml" && echo "$*" >> $XMLFILE +} + +function xmlfile +{ + test "$mode" == "xml" && { echo ''; } >> $XMLFILE +} + + + function vendors { # make this a function so we can easily select @@ -72,10 +89,12 @@ function create_config if [ -f $TARGCONFIG ]; then cp $TARGCONFIG $TARGET/Config-${VENDOR}_${MAINBOARD}.lb echo "Used existing test target $TARGCONFIG" + xml " $TARGCONFIG" return fi echo -n " Creating config file..." + xml " autogenerated" ( cat << EOF # This will make a target directory of ./VENDOR_MAINBOARD @@ -154,8 +173,16 @@ function create_builddir $PYTHON $config_py $config_lb $LBROOT &> $build_dir/config.log if [ $? -eq 0 ]; then echo "ok" + xml " ok" + xml "" + return 0 else echo "FAILED! Log excerpt:" + xml " failed" + xml " " + xmlfile $build_dir/config.log + xml " " + xml "" tail -n $CONTEXT $build_dir/config.log return 1 fi @@ -183,11 +210,19 @@ function compile_target etime=`date +%s` duration=$(( $etime - $stime )) if [ $ret -eq 0 ]; then + xml " ok" + xml " ${duration}s" echo "ok" > compile.status echo "ok. (took ${duration}s)" cd $CURR return 0 else + xml " failed" + xml " ${duration}s" + xml " " + xmlfile make.log + xml " " + echo "FAILED after ${duration}s! Log excerpt:" tail -n $CONTEXT make.log cd $CURR @@ -229,6 +264,14 @@ function build_target CROSS_COMPILE='' echo -n "Processing mainboard/$VENDOR/$MAINBOARD" + + xml "" + xml "" + xml " $VENDOR" + xml " $MAINBOARD" + xml "" + xml " $TARCH" + xml "" [ -r "$LBROOT/src/mainboard/${VENDOR}/${MAINBOARD}/abuild.info" ] && \ source $LBROOT/src/mainboard/${VENDOR}/${MAINBOARD}/abuild.info @@ -255,6 +298,12 @@ function build_target done fi + xml " " + xml " `which ${CROSS_COMPILE}gcc`" + xml " `${CROSS_COMPILE}gcc --version | head -1`" + xml " " + xml "" + # TBD: look for suitable cross compiler suite # cross-$TARCH-gcc and cross-$TARCH-ld @@ -272,6 +321,9 @@ function build_target { echo " ( mainboard/$VENDOR/$MAINBOARD previously ok )" echo + xml " previouslyok" + xml "" + xml "" return 0 } @@ -279,14 +331,22 @@ function build_target { echo " ( broken mainboard/$VENDOR/$MAINBOARD skipped )" echo + xml " knownbroken" + xml "" + xml "" return 0 } create_buildenv $VENDOR $MAINBOARD if [ $? -eq 0 ]; then - compile_target $VENDOR $MAINBOARD + compile_target $VENDOR $MAINBOARD && + xml "ok" || + xml "broken" fi + xml "" + xml "" + echo } @@ -303,6 +363,7 @@ function myhelp echo " [-t|--target ] 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 @@ -312,9 +373,10 @@ function myversion { cat << EOF -LinuxBIOS autobuild: V0.1. +LinuxBIOS autobuild: V0.2. -Copyright (C) 2004 by Stefan Reinauer, +Copyright (C) 2004 by Stefan Reinauer +Copyright (C) 2006 by coresystems GmbH This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty. @@ -340,6 +402,7 @@ fi 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;; @@ -357,6 +420,9 @@ test -z "$1" || LBROOT=$1 debug "LBROOT=$LBROOT" +xml '' +xml '' + if [ "$target" != "" ]; then # build a single board VENDOR=`echo $target|cut -f1 -d/` @@ -370,4 +436,5 @@ else done done fi +xml '' -- cgit v1.2.3