]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
toolchain: Stip toolchain.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 8 Apr 2010 14:27:37 +0000 (16:27 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 8 Apr 2010 14:27:37 +0000 (16:27 +0200)
tools/toolchain

index bfbd88e005f65d18526cce185f2f8a8777b5c183..2714776f00d92e55e114e42c46189709d48c803d 100755 (executable)
@@ -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)