Hi David, On Fri, 13 Mar 2015 14:18:10 +0000 David Laight <david.lai...@aculab.com> 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 s...@canb.auug.org.au
pgppLTkjqJzL7.pgp
Description: OpenPGP digital signature
_______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev