# HG changeset patch # User "Yann E. MORIN" # Date 1265920090 -3600 # Node ID 2c0ed9ec9a8ce08c34b6c9c6438e8fe8e8ce4862 # Parent cb9e664f758b2672a1092c04b8bf19138377d34d scripts: add action to extract config from a build.log file That got removed quite some time ago, but is really usefull to get the configuration from a build.log file of a failing build. diff -r cb9e664f758b -r 2c0ed9ec9a8c ct-ng.comp --- a/ct-ng.comp Thu Feb 11 19:21:56 2010 +0100 +++ b/ct-ng.comp Thu Feb 11 21:28:10 2010 +0100 @@ -14,7 +14,7 @@ start_steps=$(echo "${steps}" |sed -r -e 's/($| )/\1+/;') stop_steps=$(echo "${steps}" |sed -r -e 's/(^| )/+\1/;') - actions='help menuconfig oldconfig saveconfig + actions='help menuconfig oldconfig saveconfig extractconfig build build. build-all build-all. list-samples list-steps show-tuple show-all show-config clean distclean wiki-samples updatetools diff -r cb9e664f758b -r 2c0ed9ec9a8c docs/overview.txt --- a/docs/overview.txt Thu Feb 11 19:21:56 2010 +0100 +++ b/docs/overview.txt Thu Feb 11 21:28:10 2010 +0100 @@ -331,11 +331,20 @@ to create a new toolchain. That needs a very little bit of effort on your side but is quite easy. The options to build a toolchain are saved with the toolchain, and you can retrieve this configuration by running: - ${CT_TARGET}-config + ${CT_TARGET}-ct-ng.config -This will dump the configuration to stdout, so to rebuild a toolchain with this -configuration, the following is all you need to do: - ${CT_TARGET}-config >.config +An alternate method is to extract the configuration from a build.log file. +This will be necessary if your toolchain was build with crosstool-NG prior +to 1.4.0, but can be used with build.log files from any version: + ct-ng extractconfig .config + +Or, if your build.log file is compressed (most probably!): + bzcat build.log.bz2 |ct-ng extractconfig >.config + +The above commands will dump the configuration to stdout, so to rebuild a +toolchain with this configuration, just redirect the output to the +.config file: + ${CT_TARGET}-ct-ng.config >.config ct-ng oldconfig Then, you can review and change the configuration by running: diff -r cb9e664f758b -r 2c0ed9ec9a8c kconfig/kconfig.mk --- a/kconfig/kconfig.mk Thu Feb 11 19:21:56 2010 +0100 +++ b/kconfig/kconfig.mk Thu Feb 11 21:28:10 2010 +0100 @@ -24,12 +24,29 @@ @$(ECHO) " CONF $(KCONFIG_TOP)" $(SILENT)$< -s $(KCONFIG_TOP) +# Always be silent, the stdout an be >.config +extractconfig: + @awk 'BEGIN { dump=0; } \ + dump==1 && $$0~/^\[.....\][[:space:]]+(# |)CT_/ { \ + $$1=""; \ + gsub("^[[:space:]]",""); \ + print; \ + } \ + $$0~/Dumping user-supplied crosstool-NG configuration: done in/ { \ + dump=0; \ + } \ + $$0~/Dumping user-supplied crosstool-NG configuration$$/ { \ + dump=1; \ + }' + #----------------------------------------------------------- # Help text used by make help help-config:: @echo ' menuconfig - Update current config using a menu based program' @echo ' oldconfig - Update current config using a provided .config as base' + @echo ' extractconfig - Extract to stdout the configuration items from a' + @echo ' build.log file piped to stdin' #----------------------------------------------------------- # Hmmm! Cheesy build!