From b275dcd327e9d85121d20e684911177a36ec490c Mon Sep 17 00:00:00 2001 From: nico Date: Mon, 18 Apr 2005 06:12:00 +0000 Subject: Add an rscript shell script to recursively find strippable binaries and strip unstripped ones git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@660 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/rstrip.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 scripts/rstrip.sh (limited to 'scripts/rstrip.sh') diff --git a/scripts/rstrip.sh b/scripts/rstrip.sh new file mode 100755 index 000000000..d9d3ad21b --- /dev/null +++ b/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 +) -- cgit v1.2.3 From afa7fb8ebe6cfd924a968c3618aa597a2fdc5ae1 Mon Sep 17 00:00:00 2001 From: wbx Date: Thu, 21 Apr 2005 08:32:28 +0000 Subject: try to add with correct permissions later git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@697 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/rstrip.sh | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100755 scripts/rstrip.sh (limited to 'scripts/rstrip.sh') diff --git a/scripts/rstrip.sh b/scripts/rstrip.sh deleted file mode 100755 index d9d3ad21b..000000000 --- a/scripts/rstrip.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/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 -) -- cgit v1.2.3 From 6b3623eac2eddbbccdaec44d96bd86b1f156bb28 Mon Sep 17 00:00:00 2001 From: wbx Date: Thu, 21 Apr 2005 08:33:23 +0000 Subject: try to add with correct permissions git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@698 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/rstrip.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 scripts/rstrip.sh (limited to 'scripts/rstrip.sh') diff --git a/scripts/rstrip.sh b/scripts/rstrip.sh new file mode 100755 index 000000000..d9d3ad21b --- /dev/null +++ b/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 +) -- cgit v1.2.3 From 376671b487d255b4620d190958ea710e2f106a62 Mon Sep 17 00:00:00 2001 From: nbd Date: Wed, 31 May 2006 14:29:33 +0000 Subject: don't try to strip kernel modules git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3859 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/rstrip.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/rstrip.sh') diff --git a/scripts/rstrip.sh b/scripts/rstrip.sh index d9d3ad21b..023ae4e54 100755 --- a/scripts/rstrip.sh +++ b/scripts/rstrip.sh @@ -15,7 +15,7 @@ TARGETS=$* exit 1 } -find $TARGETS -type f -a -exec file {} \; | \ +find $TARGETS -type f -not -name \*.o -not -name \*.ko -a -exec file {} \; | \ sed -n -e 's/^\(.*\):.*ELF.*\(executable\|relocatable\|shared object\).*, not stripped/\1:\2/p' | \ ( IFS=":" -- cgit v1.2.3 From f2a0915886fd9ac1781f79efd90b63c0292e32e2 Mon Sep 17 00:00:00 2001 From: nbd Date: Wed, 31 May 2006 20:06:46 +0000 Subject: strip kernel modules automatically as well git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3870 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/rstrip.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts/rstrip.sh') diff --git a/scripts/rstrip.sh b/scripts/rstrip.sh index 023ae4e54..f71aaaf4f 100755 --- a/scripts/rstrip.sh +++ b/scripts/rstrip.sh @@ -15,12 +15,14 @@ TARGETS=$* exit 1 } -find $TARGETS -type f -not -name \*.o -not -name \*.ko -a -exec file {} \; | \ +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" + [ "${F##*\.}" = "o" -o "${F##*\.}" = "ko" ] && \ + eval "$STRIP_KMOD $F" || \ + eval "$STRIP $F" done ) -- cgit v1.2.3 From 10161b7a90cf7592af544f11884c49b24164f9c2 Mon Sep 17 00:00:00 2001 From: nbd Date: Thu, 22 Jun 2006 00:07:36 +0000 Subject: sstrip binaries that have been stripped by the regular strip before git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4047 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/rstrip.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/rstrip.sh') diff --git a/scripts/rstrip.sh b/scripts/rstrip.sh index f71aaaf4f..619af00d5 100755 --- a/scripts/rstrip.sh +++ b/scripts/rstrip.sh @@ -16,7 +16,7 @@ TARGETS=$* } find $TARGETS -type f -a -exec file {} \; | \ - sed -n -e 's/^\(.*\):.*ELF.*\(executable\|relocatable\|shared object\).*, not stripped/\1:\2/p' | \ + sed -n -e 's/^\(.*\):.*ELF.*\(executable\|relocatable\|shared object\).*,.* stripped/\1:\2/p' | \ ( IFS=":" while read F S; do -- cgit v1.2.3 From 02cdebbb91a33d8e24da1c94a9d93ac39be168a7 Mon Sep 17 00:00:00 2001 From: mbm Date: Tue, 27 Jun 2006 00:35:46 +0000 Subject: credit where credit is due git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4091 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/rstrip.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts/rstrip.sh') diff --git a/scripts/rstrip.sh b/scripts/rstrip.sh index 619af00d5..e63ccf089 100755 --- a/scripts/rstrip.sh +++ b/scripts/rstrip.sh @@ -1,4 +1,11 @@ #!/bin/sh +# +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + SELF=${0##*/} -- cgit v1.2.3 From b1c736c4bd275c085525f32dd18221ea9d5cc1fb Mon Sep 17 00:00:00 2001 From: nbd Date: Tue, 10 Oct 2006 22:38:29 +0000 Subject: run rstrip in bash git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@5044 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/rstrip.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/rstrip.sh') diff --git a/scripts/rstrip.sh b/scripts/rstrip.sh index e63ccf089..09a2f9f55 100755 --- a/scripts/rstrip.sh +++ b/scripts/rstrip.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # # Copyright (C) 2006 OpenWrt.org # -- cgit v1.2.3