* [PATCH 1/2] bootwrapper: Allow wrapper script to execute verbosely
@ 2007-10-16 21:31 Grant Likely
2007-10-16 21:31 ` [PATCH 2/2] bootwrapper: Bail from script if any command fails Grant Likely
2007-10-16 22:29 ` [PATCH 1/2] bootwrapper: Allow wrapper script to execute verbosely Andreas Schwab
0 siblings, 2 replies; 7+ messages in thread
From: Grant Likely @ 2007-10-16 21:31 UTC (permalink / raw)
To: linuxppc-dev, paulus, David Gibson, Scott Wood
From: Grant Likely <grant.likely@secretlab.ca>
Allow wrapper script to print verbose progress when the V is set in the
environment.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/powerpc/boot/wrapper | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 39b27e5..8323ea4 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -21,6 +21,11 @@
# (default ./arch/powerpc/boot)
# -W dir specify working directory for temporary files (default .)
+# Allow for verbose output
+if [ "$V" == "1" ]; then
+ set -x
+fi
+
# defaults
kernel=
ofile=zImage
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] bootwrapper: Bail from script if any command fails
2007-10-16 21:31 [PATCH 1/2] bootwrapper: Allow wrapper script to execute verbosely Grant Likely
@ 2007-10-16 21:31 ` Grant Likely
2007-10-17 0:33 ` David Gibson
2007-10-16 22:29 ` [PATCH 1/2] bootwrapper: Allow wrapper script to execute verbosely Andreas Schwab
1 sibling, 1 reply; 7+ messages in thread
From: Grant Likely @ 2007-10-16 21:31 UTC (permalink / raw)
To: linuxppc-dev, paulus, David Gibson, Scott Wood
From: Grant Likely <grant.likely@secretlab.ca>
Add the 'set -e' command to the wrapper script so that if any command
fails then the script will automatically exit
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/powerpc/boot/wrapper | 27 ++++++++++-----------------
1 files changed, 10 insertions(+), 17 deletions(-)
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 8323ea4..da5fcfa 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -21,6 +21,9 @@
# (default ./arch/powerpc/boot)
# -W dir specify working directory for temporary files (default .)
+# Stop execution if any command fails
+set -e
+
# Allow for verbose output
if [ "$V" == "1" ]; then
set -x
@@ -116,7 +119,7 @@ if [ -n "$dts" ]; then
if [ -z "$dtb" ]; then
dtb="$platform.dtb"
fi
- dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts" || exit 1
+ dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts"
fi
if [ -z "$kernel" ]; then
@@ -287,23 +290,13 @@ ps3)
rm -f "$object/otheros.bld"
- msg=$(dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
- skip=$overlay_dest seek=$system_reset_kernel \
- count=$overlay_size bs=1 2>&1)
-
- if [ $? -ne "0" ]; then
- echo $msg
- exit 1
- fi
+ dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
+ skip=$overlay_dest seek=$system_reset_kernel \
+ count=$overlay_size bs=1
- msg=$(dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
- skip=$system_reset_overlay seek=$overlay_dest \
- count=$overlay_size bs=1 2>&1)
-
- if [ $? -ne "0" ]; then
- echo $msg
- exit 2
- fi
+ dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
+ skip=$system_reset_overlay seek=$overlay_dest \
+ count=$overlay_size bs=1
gzip --force -9 --stdout "$ofile.bin" > "$object/otheros.bld"
;;
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] bootwrapper: Bail from script if any command fails
2007-10-16 21:31 ` [PATCH 2/2] bootwrapper: Bail from script if any command fails Grant Likely
@ 2007-10-17 0:33 ` David Gibson
2007-10-17 2:10 ` Grant Likely
2007-10-18 20:19 ` Grant Likely
0 siblings, 2 replies; 7+ messages in thread
From: David Gibson @ 2007-10-17 0:33 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, paulus
On Tue, Oct 16, 2007 at 03:31:07PM -0600, Grant Likely wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
>
> Add the 'set -e' command to the wrapper script so that if any command
> fails then the script will automatically exit
Ah.. this will conflict with my patch to merge dtc (because that
touches the line invoking dtc to change the path to it).
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] bootwrapper: Bail from script if any command fails
2007-10-17 0:33 ` David Gibson
@ 2007-10-17 2:10 ` Grant Likely
2007-10-18 20:19 ` Grant Likely
1 sibling, 0 replies; 7+ messages in thread
From: Grant Likely @ 2007-10-17 2:10 UTC (permalink / raw)
To: Grant Likely, linuxppc-dev, paulus, Scott Wood
On 10/16/07, David Gibson <david@gibson.dropbear.id.au> wrote:
> On Tue, Oct 16, 2007 at 03:31:07PM -0600, Grant Likely wrote:
> > From: Grant Likely <grant.likely@secretlab.ca>
> >
> > Add the 'set -e' command to the wrapper script so that if any command
> > fails then the script will automatically exit
>
> Ah.. this will conflict with my patch to merge dtc (because that
> touches the line invoking dtc to change the path to it).
No worries; I can respin this one easily after the dtc stuff is sorted out.
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] bootwrapper: Bail from script if any command fails
2007-10-17 0:33 ` David Gibson
2007-10-17 2:10 ` Grant Likely
@ 2007-10-18 20:19 ` Grant Likely
1 sibling, 0 replies; 7+ messages in thread
From: Grant Likely @ 2007-10-18 20:19 UTC (permalink / raw)
To: Grant Likely, linuxppc-dev, paulus, Scott Wood
On 10/16/07, David Gibson <david@gibson.dropbear.id.au> wrote:
> On Tue, Oct 16, 2007 at 03:31:07PM -0600, Grant Likely wrote:
> > From: Grant Likely <grant.likely@secretlab.ca>
> >
> > Add the 'set -e' command to the wrapper script so that if any command
> > fails then the script will automatically exit
>
> Ah.. this will conflict with my patch to merge dtc (because that
> touches the line invoking dtc to change the path to it).
>From comments I've seen on the list, it looks like if the dtc patch
goes in there still needs to be a couple of review cycles. Are you
okay with this patch getting merged in the mean time?
Thanks,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] bootwrapper: Allow wrapper script to execute verbosely
2007-10-16 21:31 [PATCH 1/2] bootwrapper: Allow wrapper script to execute verbosely Grant Likely
2007-10-16 21:31 ` [PATCH 2/2] bootwrapper: Bail from script if any command fails Grant Likely
@ 2007-10-16 22:29 ` Andreas Schwab
2007-10-16 23:08 ` Grant Likely
1 sibling, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2007-10-16 22:29 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, paulus, David Gibson
Grant Likely <grant.likely@secretlab.ca> writes:
> +# Allow for verbose output
> +if [ "$V" == "1" ]; then
The correct syntax is [ a = b ] (and the quotes around 1 are not needed,
btw.).
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
end of thread, other threads:[~2007-10-18 20:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-16 21:31 [PATCH 1/2] bootwrapper: Allow wrapper script to execute verbosely Grant Likely
2007-10-16 21:31 ` [PATCH 2/2] bootwrapper: Bail from script if any command fails Grant Likely
2007-10-17 0:33 ` David Gibson
2007-10-17 2:10 ` Grant Likely
2007-10-18 20:19 ` Grant Likely
2007-10-16 22:29 ` [PATCH 1/2] bootwrapper: Allow wrapper script to execute verbosely Andreas Schwab
2007-10-16 23:08 ` Grant Likely
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).