Hi David, On Fri, 13 Mar 2015 14:18:10 +0000 David Laight <[email protected]> wrote: > > From: Stephen Rothwell > > This runs a bit faster and removes another use of perl from > > the kernel build. > ... > > diff --git a/arch/powerpc/relocs_check.sh b/arch/powerpc/relocs_check.sh > > new file mode 100755 > > index 000000000000..182eae9cc40d > > --- /dev/null > > +++ b/arch/powerpc/relocs_check.sh > > @@ -0,0 +1,59 @@ > > +#!/bin/sh > ... > > +if [ ${#*} -lt 2 ]; then > > + echo "$0 [path to objdump] [path to vmlinux]" 1>&2 > > + exit 1 > > +fi > > + > > +# Have Kbuild supply the path to objdump so we handle cross compilation. > > +objdump="$1" > > +vmlinux="$2" > > I'm not 100% sure of the requirements on /bin/sh for kernel builds. > But ${#*} is probably not completely portable (and may not be safe > if there are embedded spaces in the arguments).
Oops, that is just wrong :-( ${#*} is undefined in Posix but is the
same as $# in bash. It needs to be just $#.
> Might be better to check:
> if [ -z "$objdump" -o -z "$vmlinux" ]
> instead.
>
> Or even:
> if [ ! -x "$objdump" -o ! -r "$vmlinux" ]
That last is a good idea as well.
I will do another version.
Thanks for catching that.
--
Cheers,
Stephen Rothwell [email protected]
pgppLTkjqJzL7.pgp
Description: OpenPGP digital signature
_______________________________________________ Linuxppc-dev mailing list [email protected] https://lists.ozlabs.org/listinfo/linuxppc-dev
