From: Michael Tremer Date: Thu, 8 Apr 2010 14:27:37 +0000 (+0200) Subject: toolchain: Stip toolchain. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89cdd936d71b6dc477457b836ebbc7c78403f04a;p=ipfire-3.x.git toolchain: Stip toolchain. --- diff --git a/tools/toolchain b/tools/toolchain index bfbd88e00..2714776f0 100755 --- a/tools/toolchain +++ b/tools/toolchain @@ -1,5 +1,7 @@ #!/bin/sh +. $(dirname ${0})/common-functions + case "${1}" in adjust) TARGET_PATH=${2} @@ -47,10 +49,26 @@ case "${1}" in TARGET=${2} COMPRESS_PATH=${3} - # TODO: stripping/remove unneeded files + target=$(mktemp) + + # Remove unneeded files rm -rf ${COMPRESS_PATH}/{info,man,share/{doc,info,locale,man}} + rm -rf ${COMPRESS_PATH}/usr/src/* + + # Strip all files + for file in $(find_elf_files ${COMPRESS_PATH}); do + strip --strip-debug ${file} + done + + # Strip executeable files + for file in $(find_elf_files ${COMPRESS_PATH}/bin ${COMPRESS_PATH}/*/bin); do + strip --stip-all ${file} + done + + cd ${COMPRESS_PATH} && tar --posix -czf ${target} -p -S * || exit 1 - cd ${COMPRESS_PATH} && tar --posix -czf ${TARGET} * + cat ${target} > ${TARGET} + rm -f ${target} ;; extract)