diff options
author | Nicolas Thill <nico@openwrt.org> | 2005-04-18 06:12:00 +0000 |
---|---|---|
committer | Nicolas Thill <nico@openwrt.org> | 2005-04-18 06:12:00 +0000 |
commit | 4c04076fc525fae0af936fdcba8e8b8938f5b5ed (patch) | |
tree | 904f61682895a736cc413a7c6a90b9fc76ab1d5f /openwrt/scripts | |
parent | 13c34ded17fcd3bb3398c584751ed744f46d4c11 (diff) | |
download | mtk-20170518-4c04076fc525fae0af936fdcba8e8b8938f5b5ed.zip mtk-20170518-4c04076fc525fae0af936fdcba8e8b8938f5b5ed.tar.gz mtk-20170518-4c04076fc525fae0af936fdcba8e8b8938f5b5ed.tar.bz2 |
Add an rscript shell script to recursively find strippable binaries and strip unstripped ones
SVN-Revision: 660
Diffstat (limited to 'openwrt/scripts')
-rwxr-xr-x | openwrt/scripts/rstrip.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/openwrt/scripts/rstrip.sh b/openwrt/scripts/rstrip.sh new file mode 100755 index 0000000..d9d3ad2 --- /dev/null +++ b/openwrt/scripts/rstrip.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +SELF=${0##*/} + +[ -z "$STRIP" ] && { + echo "$SELF: strip command not defined (STRIP variable not set)" + exit 1 +} + +TARGETS=$* + +[ -z "$TARGETS" ] && { + echo "$SELF: no directories / files specified" + echo "usage: $SELF [PATH...]" + exit 1 +} + +find $TARGETS -type f -a -exec file {} \; | \ + sed -n -e 's/^\(.*\):.*ELF.*\(executable\|relocatable\|shared object\).*, not stripped/\1:\2/p' | \ +( + IFS=":" + while read F S; do + echo "$SELF: $F:$S" + eval "$STRIP $F" + done +) |