Linux kbuild/kconfig development
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: linux-efi@vger.kernel.org, Nicolas Schier <nsc@kernel.org>,
	linux-kbuild@vger.kernel.org
Subject: Re: [PATCH 1/2] scripts/Makefile.lib: Capture decompressed size in ZSTD22 metadata
Date: Sat, 28 Nov 2026 13:14:10 -0700	[thread overview]
Message-ID: <20261128201410.GA2897137@ax162> (raw)
In-Reply-To: <20261126224400.10147-5-ardb@kernel.org>

On Thu, Nov 26, 2026 at 11:44:02PM +0100, Ard Biesheuvel wrote:
> Tweak the [unused] ZSTD22 compression rule so that the combined size of
> the uncompressed input is recorded in the ZSTD metadata. This allows
> ZSTD standard tooling to query it.
> 
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

Unless Nicolas has any objections, I think you can take this via the EFI
tree. I doubt there will be conflicts in this area.

Acked-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  scripts/Makefile.lib | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 19e96b30a122f..5b58577b158af 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -344,13 +344,17 @@ quiet_cmd_gzip = GZIP    $@
>  
>  # Bzip2 and LZMA do not include size in file... so we have to fake that;
>  # append the size as a 32-bit littleendian number as gzip does.
> -size_append = printf $(shell						\
> +total_file_size = $(shell						\
>  dec_size=0;								\
>  for F in $(real-prereqs); do					\
>  	fsize=$$($(CONFIG_SHELL) $(srctree)/scripts/file-size.sh $$F);	\
>  	dec_size=$$(expr $$dec_size + $$fsize);				\
>  done;									\
> -printf "%08x\n" $$dec_size |						\
> +printf "%d\n" $$dec_size						\
> +)
> +
> +size_append = printf $(shell						\
> +printf "%08x\n" $(total_file_size) |					\
>  	sed 's/\(..\)/\1 /g' | {					\
>  		read ch0 ch1 ch2 ch3;					\
>  		for ch in $$ch3 $$ch2 $$ch1 $$ch0; do			\
> @@ -479,7 +483,7 @@ quiet_cmd_zstd = ZSTD    $@
>        cmd_zstd = cat $(real-prereqs) | $(ZSTD) -19 > $@
>  
>  quiet_cmd_zstd22 = ZSTD22  $@
> -      cmd_zstd22 = cat $(real-prereqs) | $(ZSTD) -22 --ultra > $@
> +      cmd_zstd22 = cat $(real-prereqs) | $(ZSTD) -22 --ultra --stream-size=$(total_file_size) > $@
>  
>  quiet_cmd_zstd22_with_size = ZSTD22  $@
>        cmd_zstd22_with_size = { cat $(real-prereqs) | $(ZSTD) -22 --ultra; $(size_append); } > $@
> -- 
> 2.47.3
> 

-- 
Cheers,
Nathan

  reply	other threads:[~2026-11-28 20:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 22:44 [PATCH 0/2] efi/zboot: Put ZSTD output size where it belongs Ard Biesheuvel
2026-11-26 22:44 ` [PATCH 1/2] scripts/Makefile.lib: Capture decompressed size in ZSTD22 metadata Ard Biesheuvel
2026-11-28 20:14   ` Nathan Chancellor [this message]
2026-11-26 22:44 ` [PATCH 2/2] efi/zboot: Use ZSTD frame header for uncompressed payload size Ard Biesheuvel

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=20261128201410.GA2897137@ax162 \
    --to=nathan@kernel.org \
    --cc=ardb@kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=nsc@kernel.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