source: freewrt/scripts/rstrip.sh@ 621d5d2

freewrt_2_0
Last change on this file since 621d5d2 was 10bd4f3, checked in by Thorsten Glaser <tg@…>, 19 years ago

strip the .comment section too, shaves some bytes off the executables
also add licence boilerplate

git-svn-id: svn://www.freewrt.org/trunk/freewrt@735 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100755
File size: 690 bytes
Line 
1#!/bin/sh
2# $FreeWRT$
3#-
4# This file is part of the FreeWRT project. FreeWRT is copyrighted
5# material, please see the LICENCE file in the top-level directory
6# or at http://www.freewrt.org/licence for details.
7
8SELF=${0##*/}
9
10[ -z "$STRIP" ] && {
11 echo "$SELF: strip command not defined (STRIP variable not set)"
12 exit 1
13}
14
15TARGETS=$*
16
17[ -z "$TARGETS" ] && {
18 echo "$SELF: no directories / files specified"
19 echo "usage: $SELF [PATH...]"
20 exit 1
21}
22
23find $TARGETS -type f -a -exec file {} \; | \
24 sed -n -e 's/^\(.*\):.*ELF.*\(executable\|relocatable\|shared object\).*, not stripped/\1:\2/p' | \
25(
26 IFS=":"
27 while read F S; do
28 echo "$SELF: $F:$S"
29 eval "$STRIP $F"
30 done
31)
Note: See TracBrowser for help on using the repository browser.