Index: targets/iwill/dk8_htx/Config-abuild.lb
===================================================================
--- targets/iwill/dk8_htx/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/iwill/dk8_htx/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "normal"
 	option USE_FAILOVER_IMAGE=0
Index: targets/bcom/winnetp680/Config-abuild.lb
===================================================================
--- targets/bcom/winnetp680/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/bcom/winnetp680/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 option ROM_SIZE=512*1024
 
Index: targets/thomson/ip1000/Config-abuild.lb
===================================================================
--- targets/thomson/ip1000/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/thomson/ip1000/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -26,6 +26,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "fallback"
 	option USE_FALLBACK_IMAGE = 1
Index: targets/supermicro/h8dmr/Config-abuild.lb
===================================================================
--- targets/supermicro/h8dmr/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/supermicro/h8dmr/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "normal"
         option USE_FAILOVER_IMAGE=0
Index: targets/supermicro/h8dme/Config-abuild.lb
===================================================================
--- targets/supermicro/h8dme/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/supermicro/h8dme/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "normal"
         option USE_FAILOVER_IMAGE=0
Index: targets/kontron/986lcd-m/Config-abuild.lb
===================================================================
--- targets/kontron/986lcd-m/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/kontron/986lcd-m/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,20 +8,21 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 option ROM_SIZE=1024*(1024-64)
 option FALLBACK_SIZE=1024*512
 
 romimage "normal"
 	option USE_FALLBACK_IMAGE=0
 	option ROM_IMAGE_SIZE=0x19000
 	option COREBOOT_EXTRA_VERSION=".0-normal"
 	payload __PAYLOAD__
 end
 
 romimage "fallback" 
 	option USE_FALLBACK_IMAGE=1
 	option ROM_IMAGE_SIZE=0x19000
 	option COREBOOT_EXTRA_VERSION=".0-fallback"
 	payload __PAYLOAD__
 end
Index: targets/gigabyte/m57sli/Config-abuild.lb
===================================================================
--- targets/gigabyte/m57sli/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/gigabyte/m57sli/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "normal"
 	option USE_FAILOVER_IMAGE=0
Index: targets/gigabyte/ga_2761gxdk/Config-abuild.lb
===================================================================
--- targets/gigabyte/ga_2761gxdk/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/gigabyte/ga_2761gxdk/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -27,6 +27,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 option ROM_SIZE = 512*1024
 
Index: targets/digitallogic/msm586seg/Config-abuild.lb
===================================================================
--- targets/digitallogic/msm586seg/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/digitallogic/msm586seg/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -6,6 +6,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "fallback" 
 	option FALLBACK_SIZE = 256 * 1024
Index: targets/emulation/qemu-x86/Config-abuild.lb
===================================================================
--- targets/emulation/qemu-x86/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/emulation/qemu-x86/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -6,6 +6,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 option ROM_SIZE=256*1024
 
Index: targets/technologic/ts5300/Config-abuild.lb
===================================================================
--- targets/technologic/ts5300/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/technologic/ts5300/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -6,6 +6,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "fallback" 
 	option FALLBACK_SIZE = 256 * 1024
Index: targets/amd/pistachio/Config-abuild.lb
===================================================================
--- targets/amd/pistachio/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/amd/pistachio/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 option ROM_SIZE=1024*1024
 romimage "normal"
Index: targets/amd/dbm690t/Config-abuild.lb
===================================================================
--- targets/amd/dbm690t/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/amd/dbm690t/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 option ROM_SIZE=1024*1024
 romimage "normal"
Index: targets/amd/serengeti_cheetah/Config-abuild.lb
===================================================================
--- targets/amd/serengeti_cheetah/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/amd/serengeti_cheetah/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "normal"
 	option USE_FAILOVER_IMAGE=0
Index: targets/amd/serengeti_cheetah_fam10/Config-abuild.lb
===================================================================
--- targets/amd/serengeti_cheetah_fam10/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/amd/serengeti_cheetah_fam10/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 option ROM_SIZE=1024*1024
 
Index: targets/rca/rm4100/Config-abuild.lb
===================================================================
--- targets/rca/rm4100/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/rca/rm4100/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -26,6 +26,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "fallback"
 	option USE_FALLBACK_IMAGE = 1
Index: targets/iei/juki-511p/Config-abuild.lb
===================================================================
--- targets/iei/juki-511p/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/iei/juki-511p/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -6,6 +6,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 option ROM_SIZE=256*1024
 ###
Index: targets/tyan/s2912/Config-abuild.lb
===================================================================
--- targets/tyan/s2912/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/tyan/s2912/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "normal"
 	option USE_FAILOVER_IMAGE=0
Index: targets/tyan/s2912_fam10/Config-abuild.lb
===================================================================
--- targets/tyan/s2912_fam10/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/tyan/s2912_fam10/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -26,6 +26,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "normal"
 	option USE_FAILOVER_IMAGE=0
Index: targets/tyan/s2895/Config-abuild.lb
===================================================================
--- targets/tyan/s2895/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/tyan/s2895/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "normal"
 	option USE_FAILOVER_IMAGE=0
Index: targets/via/epia-m/Config-abuild.lb
===================================================================
--- targets/via/epia-m/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/via/epia-m/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -6,6 +6,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 option ROM_SIZE=256*1024
 
Index: targets/via/epia-cn/Config-abuild.lb
===================================================================
--- targets/via/epia-cn/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/via/epia-cn/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 option ROM_SIZE=512*1024
 
Index: targets/via/pc2500e/Config-abuild.lb
===================================================================
--- targets/via/pc2500e/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/via/pc2500e/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -26,6 +26,7 @@
 option HOSTCC = "CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 option ROM_SIZE = 512 * 1024
 
Index: targets/msi/ms7135/Config-abuild.lb
===================================================================
--- targets/msi/ms7135/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/msi/ms7135/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "normal"
 	option USE_FAILOVER_IMAGE=0
Index: targets/msi/ms9282/Config-abuild.lb
===================================================================
--- targets/msi/ms9282/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/msi/ms9282/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "normal"
 	option USE_FALLBACK_IMAGE=0
Index: targets/msi/ms9185/Config-abuild.lb
===================================================================
--- targets/msi/ms9185/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/msi/ms9185/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "normal"
 	option USE_FALLBACK_IMAGE=0
Index: targets/msi/ms7260/Config-abuild.lb
===================================================================
--- targets/msi/ms7260/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/msi/ms7260/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -26,6 +26,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "normal"
 	option USE_FAILOVER_IMAGE = 0
Index: targets/arima/hdama/Config-abuild.lb
===================================================================
--- targets/arima/hdama/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/arima/hdama/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 option ROM_SIZE=512*1024
 
Index: targets/jetway/j7f24/Config-abuild.lb
===================================================================
--- targets/jetway/j7f24/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/jetway/j7f24/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 option ROM_SIZE=512*1024
 
Index: targets/technexion/tim8690/Config-abuild.lb
===================================================================
--- targets/technexion/tim8690/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/technexion/tim8690/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "normal"
 	option USE_FALLBACK_IMAGE=0
Index: targets/ibm/e326/Config-abuild.lb
===================================================================
--- targets/ibm/e326/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/ibm/e326/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 option ROM_SIZE=512*1024
 
Index: targets/nvidia/l1_2pvv/Config-abuild.lb
===================================================================
--- targets/nvidia/l1_2pvv/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/nvidia/l1_2pvv/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "normal"
 	option USE_FAILOVER_IMAGE=0
Index: targets/asus/a8n_e/Config-abuild.lb
===================================================================
--- targets/asus/a8n_e/Config-abuild.lb	(.../branches/upstream/coreboot-v2)	
+++ targets/asus/a8n_e/Config-abuild.lb	(.../trunk/coreboot-v2)	
@@ -8,6 +8,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 romimage "normal"
 	option USE_FAILOVER_IMAGE=0
Index: util/abuild/abuild
===================================================================
--- util/abuild/abuild	(.../branches/upstream/coreboot-v2)	
+++ util/abuild/abuild	(.../trunk/coreboot-v2)	
@@ -52,6 +52,9 @@
 # stackprotect mode enabled by -ns option.
 stackprotect=false
 
+# loglevel changed with -l / --loglevel option
+loglevel=default
+
 ARCH=`uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
 	-e s/i86pc/i386/ \
 	-e s/arm.*/arm/ -e s/sa110/arm/ -e s/x86_64/amd64/ \
@@ -154,6 +157,7 @@
 option HOSTCC="CROSS_HOSTCC"
 
 __COMPRESSION__
+__LOGLEVEL__
 
 EOF
 		if [ "$TARCH" == i386 ] ; then
@@ -185,6 +189,14 @@
 		) > $TARGET/Config-${VENDOR}_${MAINBOARD}.lb
 	fi
 
+	if [ "$loglevel" != "default" ]; then
+		LOGLEVEL1="option MAXIMUM_CONSOLE_LOGLEVEL=$loglevel"
+		LOGLEVEL2="option DEFAULT_CONSOLE_LOGLEVEL=$loglevel"
+	else
+		LOGLEVEL1="# no loglevel override"
+		LOGLEVEL2=""
+	fi
+
 	if [ "`which lzma`" != "" -a "$PAYLOAD" != /dev/null ]; then
 		COMPRESSION="option CONFIG_COMPRESSED_PAYLOAD_LZMA=1"
 	else
@@ -199,6 +211,8 @@
 		-e s:CROSS_PREFIX:"$CROSS_COMPILE":g \
 		-e s:CROSS_HOSTCC:"$HOSTCC":g \
 		-e s:__COMPRESSION__:"$COMPRESSION":g \
+		-e s:__LOGLEVEL__:"$LOGLEVEL1"\
+"$LOGLEVEL2":g \
 		$TARGET/Config-${VENDOR}_${MAINBOARD}.lb.pre > $TARGET/Config-${VENDOR}_${MAINBOARD}.lb
 	printf " ok\n"
 }
@@ -573,11 +587,11 @@
 getoptbrand="`getopt -V`"
 if [ "${getoptbrand:0:6}" == "getopt" ]; then
 	# Detected GNU getopt that supports long options.
-	args=`getopt -l version,verbose,help,all,target:,broken,payloads:,test,cpus:,silent,xml,config Vvhat:bp:Tc:sxC -- "$@"`
+	args=`getopt -l version,verbose,help,all,target:,broken,payloads:,test,cpus:,silent,xml,config,loglevel Vvhat:bp:Tc:sxCl: -- "$@"`
 	eval set "$args"
 else
 	# Detected non-GNU getopt
-	args=`getopt Vvhat:bp:Tc:sxC $*`
+	args=`getopt Vvhat:bp:Tc:sxCl: $*`
 	set -- $args
 fi
 
@@ -603,6 +617,7 @@
 		-ns|--nostackprotect) shift; stackprotect=true;;
 		-sb|--scan-build) shift; scanbuild=true;;
 		-C|--config)    shift; configureonly=1;;
+		-l|--loglevel)  shift; loglevel="$1"; shift;;
 		--)		shift; break;;
 		-*)		printf "Invalid option\n\n"; myhelp; exit 1;;
 		*)		break;;

