On Thu, Feb 08, 2007 at 07:18:49PM +0100, [EMAIL PROTECTED] wrote:
> Modified: trunk/freewrt/scripts/rstrip.sh
> ===================================================================
> --- trunk/freewrt/scripts/rstrip.sh   2007-02-08 17:50:21 UTC (rev 1917)
> +++ trunk/freewrt/scripts/rstrip.sh   2007-02-08 18:18:49 UTC (rev 1918)
> @@ -8,10 +8,10 @@
>
>  SELF=${0##*/}
>
> -[ -z "$STRIP" ] && {
> -  echo "$SELF: strip command not defined (STRIP variable not set)"
> -  exit 1
> -}
> +if [[ -n $prefix ]]; then
> +     echo >&2 "$SELF: strip command not defined ('prefix' variable not set)"
> +     exit 1
> +fi
>
>  TARGETS=$*
>
> @@ -24,18 +24,13 @@
>  find $TARGETS -type f -a -exec file {} \; | \
>      sed -n -e 's/^\(.*\):.*ELF.*\(executable\|relocatable\|shared 
> object\).*, not stripped/\1:\2/p' |
>      while IFS=: read F S; do
> -     if [[ $F = */lib/modules/2.* ]]; then
> +     T="${prefix}strip -R .comment"
> +     if [[ $F = */lib/modules/2.*.@(o|ko) ]]; then
>               S="kernel module $S"
> -
> -             # find the __module_parm_* symbols in the kernel module, and 
> exclude them from
> -             # being stripped (which would be the default, leading to 
> modules not taking params
> -             # anymore).
> -             T="$($NM $F | cut -f3- -d' ' | sed -n -e 
> 's/__module_parm_\(.*\)/-K \1/p' | xargs)"
> -
> -             T="$T --strip-unneeded"
> -     else
> -             T=
> +             # kernel module parametres must not be stripped off
> +             T="--strip-unneeded $T$(${prefix}nm $F | sed -n \
> +                 '/__module_parm_/s/^.*__module_parm_/ -K /p' | tr -d '\n')"
>       fi
>       echo "$SELF: $F:$S"
> -     eval "$STRIP $T $F"
> +     eval "$T $F"
>  done

What was the reason for this again? What was wrong with the script
before your commit? (Besides better cross-support, which is not the
point here.)
Your changes introduce two obvious bugs, one of them was already
corrected by Dirk. Also I doubt if your params to sed do the same as
intended by the script I took from OpenWrt.
In my opinion the best thing to do is to revert it.

Greetings, Phil

_______________________________________________
freewrt-developers mailing list
[email protected]
https://www.freewrt.org/lists/listinfo/freewrt-developers

Reply via email to