Changeset 5066
- Timestamp:
- Jan 30, 2010 11:44:28 AM (3 years ago)
- Location:
- trunk/util
- Files:
-
- 2 edited
-
abuild/abuild (modified) (20 diffs)
-
kbuildall/kbuildall (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/util/abuild/abuild
r4712 r5066 6 6 # 7 7 # (C) 2004 by Stefan Reinauer <stepan@openbios.org> 8 # (C) 2006-20 09by coresystems GmbH <info@coresystems.de>8 # (C) 2006-2010 by coresystems GmbH <info@coresystems.de> 9 9 # 10 10 # This file is subject to the terms and conditions of the GNU General … … 15 15 #set -x # Turn echo on.... 16 16 17 ABUILD_DATE=" April 10th, 2009"18 ABUILD_VERSION="0. 8.1"17 ABUILD_DATE="January 29th, 2010" 18 ABUILD_VERSION="0.9" 19 19 20 20 # Where shall we place all the build trees? … … 35 35 # Configure-only mode 36 36 configureonly=0 37 # use old config method "newconfig" 38 oldconfig=0 37 39 38 40 # One might want to adjust these in case of cross compiling … … 104 106 # make this a function so we can easily select 105 107 # without breaking readability 106 ls -1 "$ LBROOT/src/mainboard" | grep -v Kconfig | grep -v Makefile108 ls -1 "$ROOT/src/mainboard" | grep -v Kconfig | grep -v Makefile 107 109 } 108 110 … … 114 116 VENDOR=$1 115 117 116 ls -1 $ LBROOT/src/mainboard/$VENDOR | grep -v Kconfig118 ls -1 $ROOT/src/mainboard/$VENDOR | grep -v Kconfig 117 119 } 118 120 … … 121 123 VENDOR=$1 122 124 MAINBOARD=$2 123 ARCH=`cat $LBROOT/src/mainboard/$VENDOR/$MAINBOARD/Config.lb | \ 124 grep ^arch | cut -f 2 -d\ ` 125 echo $ARCH | sed s/ppc/powerpc/ 126 } 127 128 function create_config 125 if [ $oldconfig -eq 1 ]; then 126 ARCH=`cat $ROOT/src/mainboard/$VENDOR/$MAINBOARD/Config.lb | \ 127 grep ^arch | cut -f 2 -d\ ` 128 echo $ARCH | sed s/ppc/powerpc/ 129 else 130 ARCH=`cat $ROOT/src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \ 131 grep "select ARCH_"|cut -f2- -d_` 132 echo $ARCH | sed s/X86/i386/ 133 fi 134 } 135 136 function create_config_old 129 137 { 130 138 VENDOR=$1 … … 132 140 CONFIG=$3 133 141 TARCH=$( architecture $VENDOR $MAINBOARD ) 134 TARGCONFIG=$ LBROOT/targets/$VENDOR/$MAINBOARD/Config-abuild.lb142 TARGCONFIG=$ROOT/targets/$VENDOR/$MAINBOARD/Config-abuild.lb 135 143 136 144 if [ "$CONFIG" != "" ]; then 137 TARGCONFIG=$ LBROOT/targets/$VENDOR/$MAINBOARD/$CONFIG145 TARGCONFIG=$ROOT/targets/$VENDOR/$MAINBOARD/$CONFIG 138 146 fi 139 147 … … 156 164 xml " <config>$TARGCONFIG</config>" 157 165 else 158 159 166 printf " Creating config file..." 160 167 xml " <config>autogenerated</config>" … … 229 236 } 230 237 231 function create_builddir 232 { 233 VENDOR=$1 234 MAINBOARD=$2 235 236 printf " Creating builddir..." 237 238 target_dir=$TARGET 239 config_dir=$LBROOT/util/newconfig 240 yapps2_py=$config_dir/yapps2.py 241 config_g=$config_dir/config.g 242 config_lb=Config-${VENDOR}_${MAINBOARD}.lb 243 244 cd $target_dir 245 246 build_dir=${VENDOR}_${MAINBOARD} 247 config_py=$build_dir/config.py 248 249 if [ ! -d $build_dir ] ; then 250 mkdir -p $build_dir 251 fi 252 if [ ! -f $config_py ]; then 253 $PYTHON $yapps2_py $config_g $config_py &> $build_dir/py.log 254 fi 255 256 # make sure config.py is up-to-date 257 258 export PYTHONPATH=$config_dir 259 $PYTHON $config_py $config_lb $LBROOT &> $build_dir/config.log 260 if [ $? -eq 0 ]; then 238 function create_config 239 { 240 VENDOR=$1 241 MAINBOARD=$2 242 CONFIG=$3 243 244 build_dir=$TARGET/${VENDOR}_${MAINBOARD} 245 246 # get a working payload for the board if we have one. 247 # the --payload option expects a directory containing 248 # a shell script payload.sh 249 # Usage: payload.sh [VENDOR] [DEVICE] 250 # the script returns an absolute path to the payload binary. 251 252 if [ -f $payloads/payload.sh ]; then 253 PAYLOAD=`sh $payloads/payload.sh $VENDOR $MAINBOARD` 254 printf "Using payload $PAYLOAD\n" 255 fi 256 257 $MAKE distclean obj=${build_dir} 258 mkdir -p ${build_dir} 259 260 if [ "$CONFIG" != "" ]; then 261 printf " Using existing configuration $CONFIG ... " 262 xml " <config>$CONFIG</config>" 263 cp $CONFIG .config 264 else 265 printf " Creating config file... " 266 xml " <config>autogenerated</config>" 267 grep "depends[\t ]on[\t ]*VENDOR" src/mainboard/$VENDOR/$MAINBOARD/../Kconfig | \ 268 sed "s,^.*\(VENDOR_.*\)[^A-Z0-9_]*,CONFIG_\1=y," > .config 269 grep "config[\t ]*BOARD" src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \ 270 sed "s,^.*\(BOARD_.*\)[^A-Z0-9_]*,CONFIG_\1=y," >> .config 271 grep "select[\t ]*ARCH" src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \ 272 sed "s,^.*\(ARCH_.*\)[^A-Z0-9_]*,CONFIG_\1=y," >> .config 273 echo "CONFIG_MAINBOARD_DIR=\"$VENDOR/$MAINBOARD\"" >> .config 274 if [ "$PAYLOAD" != "/dev/null" ]; then 275 echo "# CONFIG_PAYLOAD_NONE is not set" >> .config 276 echo "CONFIG_PAYLOAD_ELF=\"$PAYLOAD\"" >> .config 277 fi 278 279 if [ "$loglevel" != "default" ]; then 280 printf "(loglevel override) " 281 echo "CONFIG_MAXIMUM_CONSOLE_LOGLEVEL_$loglevel=y" 282 echo "CONFIG_MAXIMUM_CONSOLE_LOGLEVEL=$loglevel" 283 echo "CONFIG_DEFAULT_CONSOLE_LOGLEVEL_$loglevel=y" 284 echo "CONFIG_DEFAULT_CONSOLE_LOGLEVEL=$loglevel" 285 fi 286 fi 287 288 yes "" | $MAKE oldconfig obj=${build_dir} > ${build_dir}/config.log 289 ret=$? 290 mv .config.old $TARGET/${VENDOR}_${MAINBOARD}/config.in 291 if [ $ret -eq 0 ]; then 261 292 printf "ok\n" 262 293 xml " <builddir>ok</builddir>" … … 278 309 } 279 310 311 function create_builddir 312 { 313 VENDOR=$1 314 MAINBOARD=$2 315 316 printf " Creating builddir..." 317 318 target_dir=$TARGET 319 config_dir=$ROOT/util/newconfig 320 yapps2_py=$config_dir/yapps2.py 321 config_g=$config_dir/config.g 322 config_lb=Config-${VENDOR}_${MAINBOARD}.lb 323 324 cd $target_dir 325 326 build_dir=${VENDOR}_${MAINBOARD} 327 config_py=$build_dir/config.py 328 329 if [ ! -d $build_dir ] ; then 330 mkdir -p $build_dir 331 fi 332 if [ ! -f $config_py ]; then 333 $PYTHON $yapps2_py $config_g $config_py &> $build_dir/py.log 334 fi 335 336 # make sure config.py is up-to-date 337 338 export PYTHONPATH=$config_dir 339 $PYTHON $config_py $config_lb $ROOT &> $build_dir/config.log 340 if [ $? -eq 0 ]; then 341 printf "ok\n" 342 xml " <builddir>ok</builddir>" 343 xml " <log>" 344 xmlfile $build_dir/config.log 345 xml " </log>" 346 xml "" 347 return 0 348 else 349 printf "FAILED! Log excerpt:\n" 350 xml " <builddir>failed</builddir>" 351 xml " <log>" 352 xmlfile $build_dir/config.log 353 xml " </log>" 354 xml "" 355 tail -n $CONTEXT $build_dir/config.log 2> /dev/null || tail -$CONTEXT $build_dir/config.log 356 return 1 357 fi 358 } 359 280 360 function create_buildenv 281 361 { … … 283 363 MAINBOARD=$2 284 364 CONFIG=$3 285 create_config $VENDOR $MAINBOARD $CONFIG 286 create_builddir $VENDOR $MAINBOARD 365 if [ $oldconfig -eq 1 ]; then 366 create_config_old $VENDOR $MAINBOARD $CONFIG 367 create_builddir $VENDOR $MAINBOARD 368 else 369 create_config $VENDOR $MAINBOARD $CONFIG 370 cp .config $TARGET/${VENDOR}_${MAINBOARD}/coreboot.config 371 fi 287 372 } 288 373 … … 298 383 299 384 CURR=$( pwd ) 300 cd $TARGET/${VENDOR}_${MAINBOARD}301 385 stime=`perl -e 'print time();'` 302 eval $MAKE $silent -j $cpus &> make.log 303 ret=$? 386 if [ $oldconfig -eq 1 ]; then 387 cd $TARGET/${VENDOR}_${MAINBOARD} 388 eval $MAKE $silent -j $cpus &> make.log 389 ret=$? 390 else 391 build_dir=$TARGET/${VENDOR}_${MAINBOARD} 392 eval $MAKE $silent -j $cpus obj=${build_dir} \ 393 &> ${build_dir}/make.log 394 ret=$? 395 mv .config ${build_dir}/config.build 396 mv .xcompile ${build_dir}/xcompile.build 397 mv ..config.tmp ${build_dir}/config.deps 398 cd $TARGET/${VENDOR}_${MAINBOARD} 399 fi 304 400 etime=`perl -e 'print time();'` 305 401 duration=$(( $etime - $stime )) … … 346 442 CURR=`pwd` 347 443 status="yes" 348 [ -r "$ LBROOT/src/mainboard/${VENDOR}/${MAINBOARD}/BROKEN" ] && status="no"444 [ -r "$ROOT/src/mainboard/${VENDOR}/${MAINBOARD}/BROKEN" ] && status="no" 349 445 [ "$buildbroken" == "true" -o "$status" == "yes" ] 350 446 } … … 360 456 # This is used for the Motorola Sandpoint, which is not a real target 361 457 # but a skeleton target for the Sandpoint X3. 362 [ -r "$ LBROOT/src/mainboard/${VENDOR}/${MAINBOARD}/abuild.info" ] && \363 source $ LBROOT/src/mainboard/${VENDOR}/${MAINBOARD}/abuild.info458 [ -r "$ROOT/src/mainboard/${VENDOR}/${MAINBOARD}/abuild.info" ] && \ 459 source $ROOT/src/mainboard/${VENDOR}/${MAINBOARD}/abuild.info 364 460 365 461 # default setting … … 574 670 printf " [-l|--loglevel <num>] set loglevel\n" 575 671 printf " [lbroot] absolute path to coreboot sources\n" 576 printf " (defaults to $ LBROOT)\n\n"672 printf " (defaults to $ROOT)\n\n" 577 673 } 578 674 … … 584 680 585 681 Copyright (C) 2004 by Stefan Reinauer <stepan@openbios.org> 586 Copyright (C) 2006-20 08by coresystems GmbH <info@coresystems.de>682 Copyright (C) 2006-2010 by coresystems GmbH <info@coresystems.de> 587 683 588 684 This program is free software; you may redistribute it under the terms … … 598 694 verbose=false 599 695 600 test -f util/newconfig/config.g && LBROOT=$( pwd )601 test -f ../util/newconfig/config.g && LBROOT=$( cd ..; pwd )602 test "$ LBROOT" = "" && LBROOT=$( cd ../..; pwd )696 test -f util/newconfig/config.g && ROOT=$( pwd ) 697 test -f ../util/newconfig/config.g && ROOT=$( cd ..; pwd ) 698 test "$ROOT" = "" && ROOT=$( cd ../..; pwd ) 603 699 604 700 # parse parameters.. try to find out whether we're running GNU getopt … … 606 702 if [ "${getoptbrand:0:6}" == "getopt" ]; then 607 703 # Detected GNU getopt that supports long options. 608 args=`getopt -l version,verbose,help,all,target:,broken,payloads:,test,cpus:,silent,xml,config,loglevel Vvhat:bp:Tc:sxCl:-- "$@"`704 args=`getopt -l version,verbose,help,all,target:,broken,payloads:,test,cpus:,silent,xml,config,loglevel:,oldconfig Vvhat:bp:Tc:sxCl:o -- "$@"` 609 705 eval set "$args" 610 706 else 611 707 # Detected non-GNU getopt 612 args=`getopt Vvhat:bp:Tc:sxCl: $*`708 args=`getopt Vvhat:bp:Tc:sxCl:o $*` 613 709 set -- $args 614 710 fi … … 637 733 -C|--config) shift; configureonly=1;; 638 734 -l|--loglevel) shift; loglevel="$1"; shift;; 735 -o|--oldconfig) shift; oldconfig=1;; 639 736 --) shift; break;; 640 737 -*) printf "Invalid option\n\n"; myhelp; exit 1;; … … 644 741 645 742 # /path/to/freebios2/ 646 test -z "$1" || LBROOT=$1647 648 debug " LBROOT=$LBROOT"743 test -z "$1" || ROOT=$1 744 745 debug "ROOT=$ROOT" 649 746 650 747 xml '<?xml version="1.0" encoding="utf-8"?>' -
trunk/util/kbuildall/kbuildall
r4982 r5066 62 62 echo "$result." 63 63 if [ "$result" = "ok" ]; then 64 util/abuild/abuild - C -t $dir64 util/abuild/abuild -o -C -t $dir 65 65 sh util/compareboard/compareboard $dir | tee $TARGETDIR/$name.variables.txt 66 66 fi
Note: See TracChangeset
for help on using the changeset viewer.
