linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] powerpc: Do not fail build if mkimage is not available
@ 2007-12-26 15:55 Michael Buesch
  2007-12-26 16:03 ` Andreas Schwab
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Buesch @ 2007-12-26 15:55 UTC (permalink / raw)
  To: Andrew Morton; +Cc: paulus, linuxppc-dev

This fixes the boot image wrapper script to not fail the kernel
build if mkimage is not available.
As some distributions don't ship the mkimage program and some people are not
interested in uboot images anyway, we don't want to fail the whole kernel
build process because of this unneeded dependency.

Simply drop an error message, but don't fail the build.

Signed-off-by: Michael Buesch <mb@bu3sch.de>

---

Josh Boyer is working on merging mkimage into the kernel tree.
Until that happened, please merge the patch below into the mainline kernel
to avoid build breakage for people without installed uboot tools.

Index: wireless-2.6/arch/powerpc/boot/wrapper
===================================================================
--- wireless-2.6.orig/arch/powerpc/boot/wrapper	2007-12-26 16:48:47.000000000 +0100
+++ wireless-2.6/arch/powerpc/boot/wrapper	2007-12-26 16:52:58.000000000 +0100
@@ -197,8 +197,11 @@ fi
 case "$platform" in
 uboot)
     rm -f "$ofile"
+    set +e
     mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \
 	$uboot_version -d "$vmz" "$ofile"
+    [ $? -eq 0 ] || exit 0
+    set -e
     if [ -z "$cacheit" ]; then
 	rm -f "$vmz"
     fi
@@ -254,8 +257,11 @@ coff)
     ;;
 cuboot*)
     gzip -f -9 "$ofile"
+    set +e
     mkimage -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \
             $uboot_version -d "$ofile".gz "$ofile"
+    [ $? -eq 0 ] || exit 0
+    set -e
     ;;
 treeboot*)
     mv "$ofile" "$ofile.elf"

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

* Re: [PATCH v2] powerpc: Do not fail build if mkimage is not available
  2007-12-26 15:55 [PATCH v2] powerpc: Do not fail build if mkimage is not available Michael Buesch
@ 2007-12-26 16:03 ` Andreas Schwab
  2007-12-26 16:08   ` Michael Buesch
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2007-12-26 16:03 UTC (permalink / raw)
  To: Michael Buesch; +Cc: Andrew Morton, paulus, linuxppc-dev

Michael Buesch <mb@bu3sch.de> writes:

> +    set +e
>      mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \
>  	$uboot_version -d "$vmz" "$ofile"
> +    [ $? -eq 0 ] || exit 0
> +    set -e

mkimage ... || exit 0

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [PATCH v2] powerpc: Do not fail build if mkimage is not available
  2007-12-26 16:03 ` Andreas Schwab
@ 2007-12-26 16:08   ` Michael Buesch
  2007-12-26 16:19     ` Andreas Schwab
  2007-12-27 10:14     ` Wolfgang Denk
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Buesch @ 2007-12-26 16:08 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Andrew Morton, paulus, linuxppc-dev

On Wednesday 26 December 2007 17:03:43 Andreas Schwab wrote:
> Michael Buesch <mb@bu3sch.de> writes:
> 
> > +    set +e
> >      mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \
> >  	$uboot_version -d "$vmz" "$ofile"
> > +    [ $? -eq 0 ] || exit 0
> > +    set -e
> 
> mkimage ... || exit 0

Could you PLEASE increase your verbosity?
Why is mkimage || exit 0 any better than my test?

-- 
Greetings Michael.

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

* Re: [PATCH v2] powerpc: Do not fail build if mkimage is not available
  2007-12-26 16:08   ` Michael Buesch
@ 2007-12-26 16:19     ` Andreas Schwab
  2007-12-27 10:14     ` Wolfgang Denk
  1 sibling, 0 replies; 7+ messages in thread
From: Andreas Schwab @ 2007-12-26 16:19 UTC (permalink / raw)
  To: Michael Buesch; +Cc: Andrew Morton, paulus, linuxppc-dev

Michael Buesch <mb@bu3sch.de> writes:

> On Wednesday 26 December 2007 17:03:43 Andreas Schwab wrote:
>> Michael Buesch <mb@bu3sch.de> writes:
>> 
>> > +    set +e
>> >      mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \
>> >  	$uboot_version -d "$vmz" "$ofile"
>> > +    [ $? -eq 0 ] || exit 0
>> > +    set -e
>> 
>> mkimage ... || exit 0
>
> Could you PLEASE increase your verbosity?
> Why is mkimage || exit 0 any better than my test?

Many roads lead to Rome.  Take the one you like most.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [PATCH v2] powerpc: Do not fail build if mkimage is not available
  2007-12-26 16:08   ` Michael Buesch
  2007-12-26 16:19     ` Andreas Schwab
@ 2007-12-27 10:14     ` Wolfgang Denk
  2007-12-27 10:17       ` Andreas Schwab
  2007-12-27 18:13       ` Michael Buesch
  1 sibling, 2 replies; 7+ messages in thread
From: Wolfgang Denk @ 2007-12-27 10:14 UTC (permalink / raw)
  To: Michael Buesch; +Cc: Andrew Morton, paulus, linuxppc-dev

In message <200712261708.51432.mb@bu3sch.de> you wrote:
> On Wednesday 26 December 2007 17:03:43 Andreas Schwab wrote:
> > Michael Buesch <mb@bu3sch.de> writes:
> > 
> > > +    set +e
> > >      mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \
> > >  	$uboot_version -d "$vmz" "$ofile"
> > > +    [ $? -eq 0 ] || exit 0
> > > +    set -e
> > 
> > mkimage ... || exit 0
> 
> Could you PLEASE increase your verbosity?
> Why is mkimage || exit 0 any better than my test?

Because it works, while your's doesn't.

Make runs each command in a new shell. Your "set +e" is in vain,  and
so is your test of the return code.

Um... doesn't make throw  an  error  anyway  when  the  execution  of
mkimage fails?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Success in marriage is not so much finding the right person as it  is
being the right person.

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

* Re: [PATCH v2] powerpc: Do not fail build if mkimage is not available
  2007-12-27 10:14     ` Wolfgang Denk
@ 2007-12-27 10:17       ` Andreas Schwab
  2007-12-27 18:13       ` Michael Buesch
  1 sibling, 0 replies; 7+ messages in thread
From: Andreas Schwab @ 2007-12-27 10:17 UTC (permalink / raw)
  To: Wolfgang Denk; +Cc: Andrew Morton, linuxppc-dev, paulus

Wolfgang Denk <wd@denx.de> writes:

> In message <200712261708.51432.mb@bu3sch.de> you wrote:
>> On Wednesday 26 December 2007 17:03:43 Andreas Schwab wrote:
>> > Michael Buesch <mb@bu3sch.de> writes:
>> > 
>> > > +    set +e
>> > >      mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \
>> > >  	$uboot_version -d "$vmz" "$ofile"
>> > > +    [ $? -eq 0 ] || exit 0
>> > > +    set -e
>> > 
>> > mkimage ... || exit 0
>> 
>> Could you PLEASE increase your verbosity?
>> Why is mkimage || exit 0 any better than my test?
>
> Because it works, while your's doesn't.
>
> Make runs each command in a new shell.

This is a shell script, not a makefile.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [PATCH v2] powerpc: Do not fail build if mkimage is not available
  2007-12-27 10:14     ` Wolfgang Denk
  2007-12-27 10:17       ` Andreas Schwab
@ 2007-12-27 18:13       ` Michael Buesch
  1 sibling, 0 replies; 7+ messages in thread
From: Michael Buesch @ 2007-12-27 18:13 UTC (permalink / raw)
  To: Wolfgang Denk; +Cc: Andrew Morton, paulus, linuxppc-dev

On Thursday 27 December 2007 11:14:04 Wolfgang Denk wrote:
> In message <200712261708.51432.mb@bu3sch.de> you wrote:
> > On Wednesday 26 December 2007 17:03:43 Andreas Schwab wrote:
> > > Michael Buesch <mb@bu3sch.de> writes:
> > > 
> > > > +    set +e
> > > >      mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \
> > > >  	$uboot_version -d "$vmz" "$ofile"
> > > > +    [ $? -eq 0 ] || exit 0
> > > > +    set -e
> > > 
> > > mkimage ... || exit 0
> > 
> > Could you PLEASE increase your verbosity?
> > Why is mkimage || exit 0 any better than my test?
> 
> Because it works, while your's doesn't.
> 
> Make runs each command in a new shell. Your "set +e" is in vain,  and
> so is your test of the return code.
> 
> Um... doesn't make throw  an  error  anyway  when  the  execution  of
> mkimage fails?

I'm not sure what you are talking about at all, sorry.
set +e simply disables the abortion of the shell script if
the mkimage command fails. The test after that checks whether it failed
and returns success in that event, so the calling makefile does
_not_ interrupt. It only gives you a mkimage not found message.

I did test this patch on my machine where there is no mkimage
and it correctly aborts the shell script and throws an error,
while it does not abort the makefile process. And that is what we want.

-- 
Greetings Michael.

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

end of thread, other threads:[~2007-12-27 18:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-26 15:55 [PATCH v2] powerpc: Do not fail build if mkimage is not available Michael Buesch
2007-12-26 16:03 ` Andreas Schwab
2007-12-26 16:08   ` Michael Buesch
2007-12-26 16:19     ` Andreas Schwab
2007-12-27 10:14     ` Wolfgang Denk
2007-12-27 10:17       ` Andreas Schwab
2007-12-27 18:13       ` Michael Buesch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).