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 | |
| 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
| -rw-r--r-- | helper/fileutil.inc | 5 | ||||
| -rwxr-xr-x | remote/setup_target | 13 |
2 files changed, 9 insertions, 9 deletions
diff --git a/helper/fileutil.inc b/helper/fileutil.inc index 6a4f5486..18f1db4e 100644 --- a/helper/fileutil.inc +++ b/helper/fileutil.inc @@ -98,7 +98,6 @@ calc_size() { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break } } }') - TARGET_BUILD_SIZE=$CURRENT_BUILD_SIZE } # @@ -118,7 +117,7 @@ generate_initramfs() { [ "x${PS[1]}" != "x0" ] && perror "cpio create failed." [ "x${PS[2]}" != "x0" ] && perror "gzip to '$3' failed." cd - &> /dev/null - pinfo "Created initramfs of $1 at $3" + pinfo "Created initramfs of $1 at $3. Size: $(du -bc "$3" | awk 'END {print $1}')" } # generates squashfs of directory @@ -129,5 +128,5 @@ generate_squashfs() { [ -d "$1" ] || perror "$1 is not a directory." mksquashfs "$1" "$2" -comp xz -b 1M -no-recovery >&6 \ || perror "mksquashfs failed ($?)." - pinfo "Created squashfs of $1 at $2" + pinfo "Created squashfs of $1 at $2. Size: $(du -bc "$2" | awk 'END {print $1}')" } 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 } |
