diff options
5 files changed, 24 insertions, 20 deletions
diff --git a/ct-ng.comp b/ct-ng.comp
index 0d959e9..365007f 100644
--- a/ct-ng.comp
+++ b/ct-ng.comp
@@ -13,7 +13,7 @@ _ct-ng () {
start_steps=$(echo "${steps}" |sed -r -e 's/(^| )/\1+/;')
stop_steps=$(echo "${steps}" |sed -r -e 's/(^| )/+\1/;')
- actions='config menuconfig oldconfig saveconfig extractconfig
+ actions='config menuconfig oldconfig saveconfig
list-samples build list-steps regtest regtest-local
regtest-global clean distclean wiki-samples updatetools
diff --git a/docs/overview.txt b/docs/overview.txt
index cd704aa..5e06afa 100644
--- a/docs/overview.txt
+++ b/docs/overview.txt
@@ -283,19 +283,16 @@ Re-building an existing toolchain |
If you have an existing toolchain, you can re-use the options used to build it
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 in the build log
-file that is saved within the toolchain. crosstool-NG can extract those options
-to recreate a new configuration:
- ct-ng extractconfig </path/to/your/build.log >.config
+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
-will extract those options, prompt you for the new ones, which you can later
-edit with menuconfig.
+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
-Of course, if your build log was compressed, you'd have to use something like:
- bzcat /path/to/your/build.log.bz2 |ct-ng extractconfig >.config
-Then, once the configuration has been extracted, run:
- ct-ng oldconfig
+Then, you can review and change the configuration by running:
+ ct-ng menuconfig
diff --git a/kconfig/ b/kconfig/
index 4aae796..be8f61d 100644
--- a/kconfig/
+++ b/kconfig/
@@ -7,7 +7,7 @@ export PROJECTVERSION=$(CT_VERSION)
KCONFIG_TOP = config/
obj = $(CT_TOP_DIR)/kconfig
-PHONY += clean help oldconfig menuconfig config defoldconfig extractconfig
+PHONY += clean help oldconfig menuconfig config defoldconfig
# Darwin (MacOS-X) does not have proper libintl support
ifeq ($(shell uname -s),Darwin)
@@ -114,7 +114,7 @@ $(CT_TOP_DIR)/config.gen/ $(TOOLS_CONFIG_FILES)
echo "endmenu"; \
) >$@
-config menuconfig oldconfig defoldconfig extractconfig: $(KCONFIG_TOP)
+config menuconfig oldconfig defoldconfig: $(KCONFIG_TOP)
@ln -sf $(CT_LIB_DIR)/config config
@@ -131,16 +131,11 @@ oldconfig: $(CONFIG_FILES) $(obj)/conf
defoldconfig: $(CONFIG_FILES) $(obj)/conf
@yes "" |$(obj)/conf -s $(KCONFIG_TOP)
-extractconfig: $(CONFIG_FILES) $(obj)/conf
- @$(CT_LIB_DIR)/tools/ >.config
- @$(obj)/conf -s $(KCONFIG_TOP)
# Help text used by make help
@echo ' config - Update current config using a line-oriented program'
@echo ' menuconfig - Update current config using a menu based program'
@echo ' oldconfig - Update current config using a provided .config as base'
- @echo ' extractconfig - Create a new config using options extracted from a'
@echo ' build log piped into stdin'
# Cheesy build
diff --git a/scripts/ b/scripts/
index 35aa247..ad2c104 100755
--- a/scripts/
+++ b/scripts/
@@ -36,7 +36,7 @@ CT_DoLog INFO "Build started ${CT_STAR_DATE_HUMAN}"
# renice oursleves
CT_DoExecLog DEBUG renice ${CT_NICE} $$
-CT_DoStep DEBUG "Dumping crosstool-NG configuration"
+CT_DoStep DEBUG "Dumping user-supplied crosstool-NG configuration"
cat "${CT_TOP_DIR}/.config" |egrep '^(# |)CT_' |CT_DoLog DEBUG
@@ -341,6 +341,10 @@ if [ -z "${CT_RESTART}" ]; then
+ CT_DoLog EXTRA "Installing user-supplied crosstool-NG configuration"
+ CT_DoExecLog DEBUG install -m 0755 "${CT_LIB_DIR}/tools/" "${CT_PREFIX_DIR}/bin/${CT_TARGET}.ct-ng.config"
+ bzip2 -c -9 .config >>"${CT_PREFIX_DIR}/bin/${CT_TARGET}.ct-ng.config"
CT_DoStep EXTRA "Dumping internal crosstool-NG configuration"
CT_DoLog EXTRA "Building a toolchain for:"
CT_DoLog EXTRA " build = ${CT_BUILD}"
diff --git a/tools/ b/tools/
new file mode 100644
index 0000000..d8a4df3
--- /dev/null
+++ b/tools/
@@ -0,0 +1,8 @@
+SKIP_ME="### CT_NG SKIP ME ###"
+skip_me=$(($(cat "${0}" |grep --binary-files=text -o -b -E "^${SKIP_ME}$" |cut -d : -f 1)+${#SKIP_ME}+1))
+dd if="${0}" bs=${skip_me} skip=1 2>/dev/null |bzcat
+exit 0
+### CT_NG SKIP ME ###