]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
fdt: send all dtc output to stderr
authorStephen Warren <swarren@nvidia.com>
Fri, 8 Jun 2012 12:28:17 +0000 (12:28 +0000)
committerWolfgang Denk <wd@denx.de>
Mon, 9 Jul 2012 07:05:24 +0000 (09:05 +0200)
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 <wd@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: albert.u.boot@aribaud.net
Cc: Tom Warren <twarren@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
dts/Makefile

index 914e479fb2aa6a765d09baef84174f04e2404718..402dfe1dced33d2c3087791947420626557aba34 100644 (file)
@@ -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 = \