public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] scripts/make_fit: Print DT name before libfdt errors
@ 2025-02-09 16:55 J. Neuschäfer via B4 Relay
  2025-03-25 20:05 ` Rob Herring
  0 siblings, 1 reply; 2+ messages in thread
From: J. Neuschäfer via B4 Relay @ 2025-02-09 16:55 UTC (permalink / raw)
  To: Simon Glass
  Cc: linux-arm-kernel, linux-kernel, devicetree, J. Neuschäfer

From: "J. Neuschäfer" <j.ne@posteo.net>

This makes it easier to pinpoint where the error happened. For example:

  FIT     arch/powerpc/boot/image.fit
Error processing arch/powerpc/boot/dts/microwatt.dtb:
Traceback (most recent call last):
  File "/home/jn/dev/linux/linux-git/build-mpc83xx/../scripts/make_fit.py", line 335, in <module>
    sys.exit(run_make_fit())
             ^^^^^^^^^^^^^^
  File "/home/jn/dev/linux/linux-git/build-mpc83xx/../scripts/make_fit.py", line 309, in run_make_fit
    out_data, count, size = build_fit(args)
                            ^^^^^^^^^^^^^^^
  File "/home/jn/dev/linux/linux-git/build-mpc83xx/../scripts/make_fit.py", line 286, in build_fit
    raise e
  File "/home/jn/dev/linux/linux-git/build-mpc83xx/../scripts/make_fit.py", line 283, in build_fit
    (model, compat, files) = process_dtb(fname, args)
                             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jn/dev/linux/linux-git/build-mpc83xx/../scripts/make_fit.py", line 231, in process_dtb
    model = fdt.getprop(0, 'model').as_str()
            ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/libfdt.py", line 448, in getprop
    pdata = check_err_null(fdt_getprop(self._fdt, nodeoffset, prop_name),
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/libfdt.py", line 153, in check_err_null
    raise FdtException(val)
libfdt.FdtException: pylibfdt error -1: FDT_ERR_NOTFOUND

Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
---
The example is from a different series which I will release soon, which
enables FIT on powerpc.
---
 scripts/make_fit.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/make_fit.py b/scripts/make_fit.py
index 4a1bb2f55861adfce07959528e175260bc503593..1683e5ec6e6754dff3383dfec89df78b9c2fa896 100755
--- a/scripts/make_fit.py
+++ b/scripts/make_fit.py
@@ -279,7 +279,11 @@ def build_fit(args):
         if os.path.splitext(fname)[1] != '.dtb':
             continue
 
-        (model, compat, files) = process_dtb(fname, args)
+        try:
+            (model, compat, files) = process_dtb(fname, args)
+        except Exception as e:
+            sys.stderr.write(f"Error processing {fname}:\n")
+            raise e
 
         for fn in files:
             if fn not in fdts:

---
base-commit: 4bbf9020becbfd8fc2c3da790855b7042fad455b
change-id: 20241224-makefit-31f789b9ee4f

Best regards,
-- 
J. Neuschäfer <j.ne@posteo.net>



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-03-25 20:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-09 16:55 [PATCH RESEND] scripts/make_fit: Print DT name before libfdt errors J. Neuschäfer via B4 Relay
2025-03-25 20:05 ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox