scripts/saveSample.sh.in
changeset 3325 069f43a215cc
parent 2937 e94b6f607b05
     1.1 --- a/scripts/saveSample.sh.in	Mon Apr 09 11:19:51 2012 +0200
     1.2 +++ b/scripts/saveSample.sh.in	Wed Jun 25 23:33:01 2014 +0200
     1.3 @@ -72,15 +72,16 @@
     1.4  samp_dir="samples/${samp_name}"
     1.5  mkdir -p "${samp_dir}"
     1.6  
     1.7 -# Save the crosstool-NG config file
     1.8 -# We need to save the real .config with kconfig's values,
     1.9 -# not our mangled .config.2 with arrays
    1.10 +# Tweak the .config file
    1.11 +# We need to be based on the real .config with kconfig's values,
    1.12 +# not our mangled .config.2 with shell arrays
    1.13 +cp .config .defconfig
    1.14  "${sed}" -r -e 's|^(CT_PREFIX_DIR)=.*|\1="${HOME}/x-tools/${CT_TARGET}"|;'      \
    1.15              -e 's|^# CT_LOG_TO_FILE is not set$|CT_LOG_TO_FILE=y|;'             \
    1.16              -e 's|^# CT_LOG_FILE_COMPRESS is not set$|CT_LOG_FILE_COMPRESS=y|;' \
    1.17              -e 's|^(CT_LOCAL_TARBALLS_DIR)=.*|\1="${HOME}/src"|;'               \
    1.18           <.config                                                               \
    1.19 -    >"${samp_dir}/crosstool.config"
    1.20 +         >.defconfig
    1.21  
    1.22  # Function to copy a file to the sample directory
    1.23  # Needed in case the file is already there (think of a previously available sample)
    1.24 @@ -106,7 +107,7 @@
    1.25      # We save the file, and then point the saved sample to this file
    1.26      CT_DoAddFileToSample "${CT_LIBC_UCLIBC_CONFIG_FILE}" "${samp_dir}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
    1.27      "${sed}" -r -i -e 's|^(CT_LIBC_UCLIBC_CONFIG_FILE)=.+$|\1="'"${samp_top_dir}"'/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"|;' \
    1.28 -             "${samp_dir}/crosstool.config"
    1.29 +             .defconfig
    1.30  else
    1.31      # remove any dangling files
    1.32      for f in "${samp_dir}/${CT_LIBC}-"*.config; do
    1.33 @@ -114,6 +115,11 @@
    1.34      done
    1.35  fi
    1.36  
    1.37 +# Now, actually save the defconfig
    1.38 +export KCONFIG_CONFIG="$(pwd)/.defconfig"
    1.39 +${CONF} --savedefconfig="${samp_dir}/crosstool.config" "${KCONFIG_TOP}"
    1.40 +rm -f .defconfig
    1.41 +
    1.42  # Restore stdout now, to be interactive
    1.43  exec >&7
    1.44