mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch] search a little harder for mkimage
@ 2006-12-19  5:20 Mike Frysinger
  2006-12-19 20:21 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Frysinger @ 2006-12-19  5:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

[-- Attachment #1: Type: text/plain, Size: 278 bytes --]

this small patch checks to see if `${CROSS_COMPILE}mkimage` exists and
if not, fall back to the standard `mkimage`

the Blackfin toolchain includes mkimage, but we dont want to namespace
collide with any of the user's system setup, so we prefix it with our
toolchain name
-mike

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: check-cross-compile-mkimage.patch --]
[-- Type: text/x-patch; name="check-cross-compile-mkimage.patch", Size: 708 bytes --]

Check to see if the mkimage tool is part of the cross-compile toolchain.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

--- a/linux-2.6/scripts/mkuboot.sh
+++ b/linux-2.6/scripts/mkuboot.sh
@@ -4,12 +4,15 @@
 # Build U-Boot image when `mkimage' tool is available.
 #
 
-MKIMAGE=$(type -path mkimage)
+MKIMAGE=$(type -path ${CROSS_COMPILE}mkimage)
 
 if [ -z "${MKIMAGE}" ]; then
-	# Doesn't exist
-	echo '"mkimage" command not found - U-Boot images will not be built' >&2
-	exit 0;
+	MKIMAGE=$(type -path mkimage)
+	if [ -z "${MKIMAGE}" ]; then
+		# Doesn't exist
+		echo '"mkimage" command not found - U-Boot images will not be built' >&2
+		exit 0;
+	fi
 fi
 
 # Call "mkimage" to create U-Boot image

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] search a little harder for mkimage
  2006-12-19  5:20 [patch] search a little harder for mkimage Mike Frysinger
@ 2006-12-19 20:21 ` Andrew Morton
  2006-12-19 22:05   ` Mike Frysinger
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2006-12-19 20:21 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: linux-kernel

On Tue, 19 Dec 2006 00:20:42 -0500
"Mike Frysinger" <vapier.adi@gmail.com> wrote:

> this small patch checks to see if `${CROSS_COMPILE}mkimage` exists and
> if not, fall back to the standard `mkimage`
> 
> the Blackfin toolchain includes mkimage, but we dont want to namespace
> collide with any of the user's system setup, so we prefix it with our
> toolchain name
> -mike
> 
> 
> [check-cross-compile-mkimage.patch  text/x-patch (708B)]
> Check to see if the mkimage tool is part of the cross-compile toolchain.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> 
> --- a/linux-2.6/scripts/mkuboot.sh
> +++ b/linux-2.6/scripts/mkuboot.sh
> @@ -4,12 +4,15 @@
>  # Build U-Boot image when `mkimage' tool is available.
>  #
>  
> -MKIMAGE=$(type -path mkimage)
> +MKIMAGE=$(type -path ${CROSS_COMPILE}mkimage)

Do all bash versions support `type -path'?

Perhaps /usr/bin/which would be safer, dunno.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] search a little harder for mkimage
  2006-12-19 20:21 ` Andrew Morton
@ 2006-12-19 22:05   ` Mike Frysinger
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2006-12-19 22:05 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

On 12/19/06, Andrew Morton <akpm@osdl.org> wrote:
> > -MKIMAGE=$(type -path mkimage)
> > +MKIMAGE=$(type -path ${CROSS_COMPILE}mkimage)
>
> Do all bash versions support `type -path'?

i've just always used `type -p` myself ...

but, bash-2.05 supports it for sure and that was released back in 2001 ...

> Perhaps /usr/bin/which would be safer, dunno.

which can be tricky as it behaves a little differently on some
platforms and may not always even be installed ... OS X for example is
notorious for being a piece of crap ... `which asdfasdf` will echo the
error to stdout and exit with a status of 0 even though the test
obviously failed
-mike

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-12-19 22:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-19  5:20 [patch] search a little harder for mkimage Mike Frysinger
2006-12-19 20:21 ` Andrew Morton
2006-12-19 22:05   ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®