mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scripts/make_fit: Ignore schema checks when decomposing DTBs
@ 2026-10-06 15:19 Ting-Han Hou
  2026-10-09  7:13 ` Simon Glass
  2026-10-09 20:41 ` Nathan Chancellor
  0 siblings, 2 replies; 4+ messages in thread
From: Ting-Han Hou @ 2026-10-06 15:19 UTC (permalink / raw)
  To: Simon Glass; +Cc: Chen-Yu Tsai, linux-arm-kernel, linux-kernel

With CHECK_DTBS enabled, Kbuild appends a schema validation command to
the fdtoverlay command saved in a composite DTB's .cmd file. When DTB
decomposition is requested, process_dtb() treats every word after -i as
an input file, including the semicolon and the validator arguments.
FIT generation then fails with FileNotFoundError while opening or
checking the size of those words as files.

Limit the input list to the fdtoverlay command before extracting its
arguments. This preserves the base DTB and overlay order and ignores
the subsequent schema validation command.

Fixes: 17c31aded9a1 ("scripts/make_fit: Support decomposing DTBs")
Assisted-by: LLM
Signed-off-by: Ting-Han Hou <ue081723@gmail.com>
---
Reproduced with DTBs and saved commands generated by the current Kbuild
rules. Verified uncompressed and gzip FIT payloads, shared-base reuse,
and the non-decomposed mode. The schema checker was a success-only
stub; no hardware boot tests were run.

 scripts/make_fit.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/make_fit.py b/scripts/make_fit.py
index 15ba269..9bd35aa 100755
--- a/scripts/make_fit.py
+++ b/scripts/make_fit.py
@@ -292,7 +292,8 @@ def process_dtb(fname, args):

         if 'scripts/dtc/fdtoverlay' in cmd:
             # This depends on the structure of the composite DTB command
-            files = cmd.split()
+            # Ignore any subsequent commands, such as schema validation
+            files = cmd.split(';', 1)[0].split()
             files = files[files.index('-i') + 1:]
         else:
             files = [fname]

base-commit: 69f80fef3153299d9c72c53d1d71eef6354b6926
-- 
2.52.0.windows.1

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

* Re: [PATCH] scripts/make_fit: Ignore schema checks when decomposing DTBs
  2026-10-06 15:19 [PATCH] scripts/make_fit: Ignore schema checks when decomposing DTBs Ting-Han Hou
@ 2026-10-09  7:13 ` Simon Glass
  2026-10-09 17:50   ` Ting-Han Hou
  2026-10-09 20:41 ` Nathan Chancellor
  1 sibling, 1 reply; 4+ messages in thread
From: Simon Glass @ 2026-10-09  7:13 UTC (permalink / raw)
  To: Ting-Han Hou; +Cc: Chen-Yu Tsai, linux-arm-kernel, linux-kernel

On Tue, 6 Oct 2026 at 16:19, Ting-Han Hou <ue081723@gmail.com> wrote:
>
> With CHECK_DTBS enabled, Kbuild appends a schema validation command to
> the fdtoverlay command saved in a composite DTB's .cmd file. When DTB
> decomposition is requested, process_dtb() treats every word after -i as
> an input file, including the semicolon and the validator arguments.
> FIT generation then fails with FileNotFoundError while opening or
> checking the size of those words as files.
>
> Limit the input list to the fdtoverlay command before extracting its
> arguments. This preserves the base DTB and overlay order and ignores
> the subsequent schema validation command.
>
> Fixes: 17c31aded9a1 ("scripts/make_fit: Support decomposing DTBs")
> Assisted-by: LLM
> Signed-off-by: Ting-Han Hou <ue081723@gmail.com>
> ---
> Reproduced with DTBs and saved commands generated by the current Kbuild
> rules. Verified uncompressed and gzip FIT payloads, shared-base reuse,
> and the non-decomposed mode. The schema checker was a success-only
> stub; no hardware boot tests were run.
>
>  scripts/make_fit.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

>
> diff --git a/scripts/make_fit.py b/scripts/make_fit.py
> index 15ba269..9bd35aa 100755
> --- a/scripts/make_fit.py
> +++ b/scripts/make_fit.py
> @@ -292,7 +292,8 @@ def process_dtb(fname, args):
>
>          if 'scripts/dtc/fdtoverlay' in cmd:
>              # This depends on the structure of the composite DTB command
> -            files = cmd.split()
> +            # Ignore any subsequent commands, such as schema validation
> +            files = cmd.split(';', 1)[0].split()
>              files = files[files.index('-i') + 1:]
>          else:
>              files = [fname]
>
> base-commit: 69f80fef3153299d9c72c53d1d71eef6354b6926
> --
> 2.52.0.windows.1

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

* Re: [PATCH] scripts/make_fit: Ignore schema checks when decomposing DTBs
  2026-10-09  7:13 ` Simon Glass
@ 2026-10-09 17:50   ` Ting-Han Hou
  0 siblings, 0 replies; 4+ messages in thread
From: Ting-Han Hou @ 2026-10-09 17:50 UTC (permalink / raw)
  To: Nathan Chancellor, Nicolas Schier
  Cc: Simon Glass, Chen-Yu Tsai, linux-kbuild, linux-arm-kernel, linux-kernel

On Fri, 9 Oct 2026 at 08:13, Simon Glass <sjg@chromium.org> wrote:
> Reviewed-by: Simon Glass <sjg@chromium.org>

Thanks for the review, Simon.

Nathan, Nicolas: recent scripts/make_fit.py changes have gone through
the kbuild tree, but I did not Cc you or linux-kbuild on the original
posting, sorry about that. Would you be able to pick this up, or would
you prefer that I resend it with linux-kbuild on Cc?

The patch is here:

  https://lore.kernel.org/all/CA+NtrhQBK8uW32qO3dXxVxO1GSN-0EJfyJ16tnyx0o52T17WtQ@mail.gmail.com/

Thanks,
Ting-Han

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

* Re: [PATCH] scripts/make_fit: Ignore schema checks when decomposing DTBs
  2026-10-06 15:19 [PATCH] scripts/make_fit: Ignore schema checks when decomposing DTBs Ting-Han Hou
  2026-10-09  7:13 ` Simon Glass
@ 2026-10-09 20:41 ` Nathan Chancellor
  1 sibling, 0 replies; 4+ messages in thread
From: Nathan Chancellor @ 2026-10-09 20:41 UTC (permalink / raw)
  To: Simon Glass, Ting-Han Hou; +Cc: Chen-Yu Tsai, linux-arm-kernel, linux-kernel

On Tue, 06 Oct 2026 08:19:54 -0700, Ting-Han Hou wrote:
> scripts/make_fit: Ignore schema checks when decomposing DTBs

Applied to

  https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git kbuild-next-unstable

Thanks!

[1/1] scripts/make_fit: Ignore schema checks when decomposing DTBs
      https://git.kernel.org/kbuild/c/3bf2237f59af8

Please look out for regression or issue reports or other follow up
comments, as they may result in the patch/series getting dropped or
reverted. Patches applied to an "unstable" branch are accepted pending
wider testing in -next and any post-commit review; they will generally
be moved to the main branch in a week if no issues are found.

Best regards,
-- 
Cheers,
Nathan



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

end of thread, other threads:[~2026-10-09 20:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-06 15:19 [PATCH] scripts/make_fit: Ignore schema checks when decomposing DTBs Ting-Han Hou
2026-10-09  7:13 ` Simon Glass
2026-10-09 17:50   ` Ting-Han Hou
2026-10-09 20:41 ` Nathan Chancellor

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

all inboxes | Powered by JetHome®