Skip to contentSkip to conversation

fdt: send all dtc output to stderr

PATCH New Stephen Warren 3 participants 3 messages Jun 8, 2012 – Jul 9, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fdt: send all dtc output to stderr

From: Stephen Warren <[email protected]>

Commit 896bbb5 "fdt: avoid bad MAKEALL status" added logic to capture the result code from dtc by echoing $? to stdout and capturing it using $(). However, dtc emits some diagnostics to stderr and some to stdout. The diagnostics send to stdout ended up getting captured via $() rather than being echo'd to the user. This caused those diagnostics to be passed to the exit command, which would then fail with the following cryptic error message:

/bin/sh: line 1: exit: too many arguments

Solve this by redirecting all dtc output to stderr so that $() does not capture it. This allows the user to see the actual error message from dtc.

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc albert.u.boot at aribaud.net
Cc Tom Warren <[email protected]>
---
 dts/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
dts/Makefile +1 -1
index 914e479..402dfe1 100644
@@ -51,7 +51,7 @@ $(DT_BIN): $(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts
 		{ { $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} - 2>&1 ; \
 		    echo $$? >&3 ; } | \
 		  grep -v '^DTC: dts->dtb  on file' ; \
-	        } 3>&1 ) ; \
+	        } 3>&1 1>&2 ) ; \
 	exit $$rc
 
 process_lds = \
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/1 fdt: send all dtc output to stderr

Hi Stephen,

Quoted 12 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Commit 896bbb5 "fdt: avoid bad MAKEALL status" added logic to capture the result code from dtc by echoing $? to stdout and capturing it using $(). However, dtc emits some diagnostics to stderr and some to stdout. The diagnostics send to stdout ended up getting captured via $() rather than being echo'd to the user. This caused those diagnostics to be passed to the exit command, which would then fail with the following cryptic error message:

/bin/sh: line 1: exit: too many arguments

Quoted 9 lines

Solve this by redirecting all dtc output to stderr so that $() does not capture it. This allows the user to see the actual error message from dtc.

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc albert.u.boot at aribaud.net
Cc Tom Warren <[email protected]>
Quoted 22 lines
---
 dts/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
dts/Makefile +0 -0
index 914e479..402dfe1 100644
@@ -51,7 +51,7 @@ $(DT_BIN):

$(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts

               { { $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} - 2>&1 ; \
                   echo $$? >&3 ; } | \
                 grep -v '^DTC: dts->dtb  on file' ; \
dts/Makefile +1 -2
-               } 3>&1 ) ; \
+               } 3>&1 1>&2 ) ; \
       exit $$rc
 
 process_lds = \
--

1.7.0.4

#2 lore raw

PATCH 1/1 fdt: send all dtc output to stderr

In reply to Stephen Warren

Dear Stephen Warren,

Quoted 15 lines · In message <[email protected]> you wrote:

From: Stephen Warren <[email protected]>

Commit 896bbb5 "fdt: avoid bad MAKEALL status" added logic to capture the result code from dtc by echoing $? to stdout and capturing it using $(). However, dtc emits some diagnostics to stderr and some to stdout. The diagnostics send to stdout ended up getting captured via $() rather than being echo'd to the user. This caused those diagnostics to be passed to the exit command, which would then fail with the following cryptic error message:

/bin/sh: line 1: exit: too many arguments

Solve this by redirecting all dtc output to stderr so that $() does not capture it. This allows the user to see the actual error message from dtc.

Quoted 8 lines
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc albert.u.boot at aribaud.net
Cc Tom Warren <[email protected]>
---
 dts/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

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: wd at denx.de
Be wiser than other people if you can, but do not tell them so.
                                       -- Philip Earl of Chesterfield