mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hamdy Abou El Anein <info@daylightlinux.ch>
To: sjg@chromium.org
Cc: hamdy.aea@protonmail.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] scripts: make_fit: propagate compressor failures
Date: Tue,  3 Nov 2026 17:42:06 +0100	[thread overview]
Message-ID: <20261103164206.129723-1-info@daylightlinux.ch> (raw)

From: Hamdy Abou El Anein <hamdy.aea@protonmail.com>

compress_data() ignores the compressor exit status and marks the
operation successful even if the tool wrote only partial output.
build_fit() can then place that truncated data into a FIT image.

Use check_call() so compressor failures abort image generation.
FileNotFoundError still allows trying the next supported executable.

Tested a compressor that writes partial output and exits with status
23: compression raises CalledProcessError and the CLI creates no FIT.
Also generated uncompressed and gzip FIT images with a real DTB and
ramdisk, and verified their payloads through libfdt and gzip.

AI assistance: ChatGPT/Codex identified the issue and prepared the
change, commit message and executable regression tests.

Fixes: 7a23b027ec17 ("arm64: boot: Support Flat Image Tree")
Signed-off-by: Hamdy Abou El Anein <hamdy.aea@protonmail.com>
---
 scripts/make_fit.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/make_fit.py b/scripts/make_fit.py
index 9bd35aa7211..1a63364388c 100755
--- a/scripts/make_fit.py
+++ b/scripts/make_fit.py
@@ -214,7 +214,7 @@ def compress_data(inf, compress):
                     if tool in ('zstd', 'xz'):
                         cmd.extend(['-T0'])  # Use all available cores
                     cmd.append('-c')
-                    subprocess.call(cmd, stdin=inf, stdout=outf)
+                    subprocess.check_call(cmd, stdin=inf, stdout=outf)
                     done = True
                     break
                 except FileNotFoundError:

                 reply	other threads:[~2026-11-03 16:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261103164206.129723-1-info@daylightlinux.ch \
    --to=info@daylightlinux.ch \
    --cc=hamdy.aea@protonmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sjg@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®