Skip to contentSkip to conversation

powerpc: Do not fail build if mkimage is not available

PATCH In review Michael Buesch 3 participants 7 messages Dec 26, 2007 – Dec 27, 2007 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 powerpc: Do not fail build if mkimage is not available

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.

---

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.

arch/powerpc/boot/wrapper +6 -0
Index: wireless-2.6/arch/powerpc/boot/wrapper
===================================================================
@@ -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"
#1 lore raw

arch/powerpc/boot/wrapper fi · line 204

Quoted 5 lines · Michael Buesch
arch/powerpc/boot/wrapper +3 -0
+    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.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
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."
#2 lore raw
Quoted 9 lines · On Wednesday 26 December 2007 17:03:43 Andreas Schwab wrote:

arch/powerpc/boot/wrapper fi · line 204

Quoted 5 lines · Michael Buesch
arch/powerpc/boot/wrapper +3 -0
+    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?

Signature · 1 line
Greetings Michael.
#3 lore raw
Quoted 9 lines · Michael Buesch
Quoted 8 lines · On Wednesday 26 December 2007 17:03:43 Andreas Schwab wrote:
Quoted 5 lines · Michael Buesch
arch/powerpc/boot/wrapper +3 -0
+    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
Quoted 4 lines
Quoted 1 line

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.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
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."
#4 lore raw
In reply to Michael Buesch
Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 8 lines · On Wednesday 26 December 2007 17:03:43 Andreas Schwab wrote:
Quoted 5 lines · Michael Buesch
arch/powerpc/boot/wrapper +3 -0
+    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
Quoted 4 lines
Quoted 1 line

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

Signature · 5 lines
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: [email protected]
Success in marriage is not so much finding the right person as it  is
being the right person.
#5 lore raw
Quoted 10 lines · Wolfgang Denk
Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 8 lines · On Wednesday 26 December 2007 17:03:43 Andreas Schwab wrote:
Quoted 5 lines · Michael Buesch
arch/powerpc/boot/wrapper +3 -0
+    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
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

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.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
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."
#6 lore raw
In reply to Wolfgang Denk
Quoted 15 lines · On Thursday 27 December 2007 11:14:04 Wolfgang Denk wrote:
Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 8 lines · On Wednesday 26 December 2007 17:03:43 Andreas Schwab wrote:
Quoted 5 lines · Michael Buesch
arch/powerpc/boot/wrapper +3 -0
+    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
Quoted 4 lines
Quoted 1 line

mkimage ... || exit 0

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

Quoted 7 lines

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.

Signature · 1 line
Greetings Michael.