Skip to contentSkip to conversation

fdt: avoid bad MAKEALL status

PATCH New Wolfgang Denk 2 participants 5 messages Apr 19, 2012 – Apr 21, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fdt: avoid bad MAKEALL status

Current versions of dtc always print a message like

	DTC: dts->dtb  on file "dt.dtb.tmp"

which cannot even be suppressed with "-qqq". To avoid incorrect MAKEALL status, we manually filter out this message. This is a bit complicated, as we have to make sure to set a correct return code.

Also, get rid of the temp file: dtc accepts "-" for stdin.

---
 dts/Makefile |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
dts/Makefile +7 -3
index 8b13b23..914e479 100644
@@ -46,9 +46,13 @@ all:	$(obj).depend $(LIB)
 DT_BIN	:= $(obj)dt.dtb
 
 $(DT_BIN): $(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts
-	cat $< | $(CPP) -P $(DTS_CPPFLAGS) - >[email protected]
-	$(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} [email protected]
-	rm [email protected]
+	rc=$$( \
+		cat $< | $(CPP) -P $(DTS_CPPFLAGS) - | \
+		{ { $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} - 2>&1 ; \
+		    echo $$? >&3 ; } | \
+		  grep -v '^DTC: dts->dtb  on file' ; \
+	        } 3>&1 ) ; \
+	exit $$rc
 
 process_lds = \
 	$(1) | sed -r -n 's/^OUTPUT_$(2)[ ("]*([^")]*).*/\1/p'
Signature · 1 line
1.7.7.6
#1 lore raw

PATCH 1/1 fdt: avoid bad MAKEALL status

Hi Wolfgang,

Quoted 7 lines · Wolfgang Denk

Current versions of ?dtc ?always print a message like

? ? ? ?DTC: dts->dtb ?on file "dt.dtb.tmp"

which cannot even be suppressed with "-qqq". ?To avoid incorrect MAKEALL status, we manually filter out this message. ?This is a bit complicated, as we have to make sure to set a correct return code.

See the discussion on this patch:

http://patchwork.ozlabs.org/patch/149833/

A patch to fix this has now been accepted to dtc. So if you update dtc you should find this message goes away.

3cbf829 dtc: Remove spurious output on stderr

Quoted 28 lines

Also, get rid of the temp file: dtc accepts "-" for stdin.

---
?dts/Makefile | ? 10 +++++++---
?1 files changed, 7 insertions(+), 3 deletions(-)

dts/Makefile +0 -0
index 8b13b23..914e479 100644
@@ -46,9 +46,13 @@ all: $(obj).depend $(LIB)

?DT_BIN := $(obj)dt.dtb

?$(DT_BIN): $(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts
- ? ? ? cat $< | $(CPP) -P $(DTS_CPPFLAGS) - >[email protected]
- ? ? ? $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} [email protected]
- ? ? ? rm [email protected]
+ ? ? ? rc=$$( \
+ ? ? ? ? ? ? ? cat $< | $(CPP) -P $(DTS_CPPFLAGS) - | \
+ ? ? ? ? ? ? ? { { $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} - 2>&1 ; \
+ ? ? ? ? ? ? ? ? ? echo $$? >&3 ; } | \
+ ? ? ? ? ? ? ? ? grep -v '^DTC: dts->dtb ?on file' ; \
+ ? ? ? ? ? ? ? } 3>&1 ) ; \
+ ? ? ? exit $$rc

Quoted 5 lines

?process_lds = \
? ? ? ?$(1) | sed -r -n 's/^OUTPUT_$(2)[ ("]*([^")]*).*/\1/p' --
1.7.7.6

Regards,
Simon

#2 lore raw

PATCH 1/1 fdt: avoid bad MAKEALL status

Dear Simon,

Quoted 5 lines · In message <CAPnjgZ1=Q0=T_vZDZD47h3J65FHitO+0giUkX7pUrECYp=BOkQ@mail.gmail.com>…

A patch to fix this has now been accepted to dtc. So if you update dtc you should find this message goes away.

3cbf829 dtc: Remove spurious output on stderr

There are many systems out there in the field which are subject to a rigid policy, and only distribution provided packages get provided. Many of the "interesting" distributions don't have this fix yet; for example, Fedora 16 (dtc-1.3.0-2.fc16.x86_64) or Debian Wheezy (device-tree-compiler 1.3.0-2) bundle DTC version 1.3.0, which is not fixed yet.

For the sake of those people I would like to apply this patch.

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
The number you have dialed is imaginary. Please divide by 0  and  try
again.
#3 lore raw

PATCH 1/1 fdt: avoid bad MAKEALL status

Quoted 9 lines · Wolfgang Denk

Dear Simon,

Quoted 5 lines · In message <CAPnjgZ1=Q0=T_vZDZD47h3J65FHitO+0giUkX7pUrECYp=BOkQ@mail.gmail.com>…

A patch to fix this has now been accepted to dtc. So if you update dtc you should find this message goes away.

3cbf829 dtc: Remove spurious output on stderr

Quoted 8 lines

There are many systems out there in the field which are subject to a rigid policy, and only distribution provided packages get provided. Many of the "interesting" distributions don't have this fix yet; for example, Fedora 16 (dtc-1.3.0-2.fc16.x86_64) or Debian Wheezy (device-tree-compiler 1.3.0-2) bundle DTC version 1.3.0, which is not fixed yet.

For the sake of those people I would like to apply this patch.

Quoted 11 lines

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 at denx.de The number you have dialed is imaginary. Please divide by 0 ?and ?try again.

author Applied
#4 lore raw

PATCH 1/1 fdt: avoid bad MAKEALL status

In reply to Wolfgang Denk

Dear Wolfgang Denk,

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

Current versions of dtc always print a message like

	DTC: dts->dtb  on file "dt.dtb.tmp"

which cannot even be suppressed with "-qqq". To avoid incorrect MAKEALL status, we manually filter out this message. This is a bit complicated, as we have to make sure to set a correct return code.

Quoted 7 lines

Also, get rid of the temp file: dtc accepts "-" for stdin.

---
 dts/Makefile |   10 +++++++---
 1 files changed, 7 insertions(+), 3 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
Gods don't like people not doing much work. People  who  aren't  busy
all the time might start to _think_.  - Terry Pratchett, _Small Gods_