diff options
author | Michael Neves | 2013-04-04 14:59:23 +0200 |
---|---|---|
committer | sr | 2013-04-12 19:11:40 +0200 |
commit | ad08ab331908838f9b25be17a731971ffee81914 (patch) | |
tree | 561564288438f37ee3a5dc7511069e4bbc2781fd /remote/setup_target | |
parent | required/optional packages. consolekit for rpm. (diff) | |
download | tm-scripts-ad08ab331908838f9b25be17a731971ffee81914.tar.gz tm-scripts-ad08ab331908838f9b25be17a731971ffee81914.tar.xz tm-scripts-ad08ab331908838f9b25be17a731971ffee81914.zip |
Size calculation fixed
Diffstat (limited to 'remote/setup_target')
-rwxr-xr-x | remote/setup_target | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/remote/setup_target b/remote/setup_target index ade57c8b..a7e25406 100755 --- a/remote/setup_target +++ b/remote/setup_target @@ -115,7 +115,7 @@ copy_files_with_deps () { get_dynamic_dependencies -l "${MODULE_BUILD_DIR}" "${BIN}" >> "${COPYFILES_LIST}" done done - + [ ! -z "${REQUIRED_FILES}" ] && pinfo "Gathering required files from config file..." for ENTRY in ${REQUIRED_FILES} do @@ -123,7 +123,6 @@ copy_files_with_deps () { get_dynamic_dependencies -l "${MODULE_BUILD_DIR}" "${MODULE_BUILD_DIR}/.${ENTRY}" >> "${COPYFILES_LIST}" done - #copy to initramfsdir pdebug "File list generated at ${MODULE_BUILD_DIR}/${COPYFILES_LIST}." if [ -s "$COPYFILES_LIST" ]; then @@ -131,6 +130,7 @@ copy_files_with_deps () { pinfo "Copying $CLISTCOUNT files to '${TARGET_BUILD_DIR}'." tarcopy "$(cat "$COPYFILES_LIST"|sort -u)" "${TARGET_BUILD_DIR}" fi + } generate_target() { @@ -141,7 +141,6 @@ generate_target() { TARGET=$1 && shift TARGET_DIR="${MODE_DIR}/targets/${TARGET}" TARGET_BUILD_DIR="${MODE_DIR}/builds/${TARGET}" - [ -d "$TARGET_BUILD_DIR" ] && TARGET_BUILD_SIZE=$(du -bc "${TARGET_BUILD_DIR}" | awk 'END {print $1}') || TARGET_BUILD_SIZE=0 [ -e "${ROOT_DIR}/logs/${TARGET}.size" ] && . "${ROOT_DIR}/logs/${TARGET}.size" || echo "declare -A BUILD_SIZE" >> "${ROOT_DIR}/logs/${TARGET}.size" [ -d $TARGET_DIR ] || perror "Given target directory does not exist: $TARGET_DIR" @@ -167,6 +166,7 @@ generate_target() { pinfo "Copying libc and ld-linux used by ${SHELL}" tarcopy "$(list_basic_libs)" "${TARGET_BUILD_DIR}" + [ -d "$TARGET_BUILD_DIR" ] && TARGET_BUILD_SIZE=$(du -bc "${TARGET_BUILD_DIR}" | awk 'END {print $1}') || TARGET_BUILD_SIZE=0 # now iterate over given tools and copy them while (( "$#" )); do process_module "$1" @@ -216,6 +216,7 @@ process_module() { [ -e "${MODULE_DIR}/.built" ] || { build && touch "${MODULE_DIR}/.built"; } # remove *.la files as they might confuse libtool/linker of other tool packages find "${MODULE_BUILD_DIR}" -name '*.la' -exec rm -f {} \; + [ -d "$TARGET_BUILD_DIR" ] && TARGET_BUILD_SIZE=$(du -bc "${TARGET_BUILD_DIR}" | awk 'END {print $1}') || TARGET_BUILD_SIZE=0 pinfo "## Copying files with dependencies" copy_files_with_deps pinfo "## Copying static module files" @@ -225,7 +226,7 @@ process_module() { # reset pipes #[ "x$DEBUG" != "x1" ] && exec 1>&6 6>&- # TODO - calc_size #sets MODULE_BUILD_SIZE and TARGET_BUILD_SIZE + calc_size #sets MODULE_BUILD_SIZE pinfo "Module completed. Total size: ${MODULE_BUILD_SIZE}" else pwarning "Module directory for '$MODULE' not found." @@ -276,7 +277,7 @@ clean_module() { if [ -e ${MODULE_DIR}/list_binaries_and_files ]; then rm "${MODULE_DIR}/list_binaries_and_files" || perror "Could not delete list_binaries_and_files" fi - if [ -e ${MODULE_DIR}/stage32.log ]; then - rm "${MODULE_DIR}/stage32.log" || perror "Could not delete stage32.log" + if [ -e ${ROOT_DIR}/logs/${TARGET}.size ]; then + rm "${ROOT_DIR}/logs/${TARGET}.size" || perror "Could not delete logs/${TARGET}.size" fi } |