Re: [PATCH] kbuild: save ARCH & CROSS_COMPILE when building akernel

From: Sam Ravnborg
Date: Mon Jul 20 2009 - 16:05:31 EST


On Mon, Jul 20, 2009 at 07:12:00PM +0200, Sam Ravnborg wrote:
> On Mon, Jul 20, 2009 at 02:00:43PM +0200, Peter Zijlstra wrote:
> > On Mon, 2009-07-20 at 13:51 +0200, Sam Ravnborg wrote:
> > > -if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi
> > > -if [ -x /sbin/${CROSS_COMPILE}installkernel ]; then exec /sbin/${CROSS_COMPILE}installkernel "$@"; fi
> > > +for INSTALL in ~/bin/${CROSS_COMPILE} /sbin/${CROSS_COMPILE} ~/bin /sbin/; do
> > > + if [ -x ${INSTALL}installkernel ]; then
> > > + exec ${INSTALL}installkernel "$@"
> > > + fi
> > > +done
> >
> > Won't that still get upset if CROSS_COMPILE has whitespace in it, which
> > would form weird filenames etc.. or worse, it might match ~/bin/distcc
>
> The root cause of this is the use of CROSS_COMPILE for the installkernel
> script.
> We know that the CROSS_COMPILE prefix changes with the toolcahin and
> likely is a very personal thing.
> So rather than using CROSS_COMPILE we should let the user override
> the installkernel script used.
>
> The simplest replacement is the following patch which solves this and
> only people relying on the use of CROSS_COMPILE for installkernel
> needs to change anything.
>
> Needs to change the other ~20 uses of installkernel if we agree on
> this change.


This is the patch I have cooked up.
I will push that to kbuild-next soon if there is no futher comments.

Sam