diff mbox series

[2/5] kbuild: drop $(size_append) from cmd_zstd

Message ID 20220109181529.351420-2-masahiroy@kernel.org (mailing list archive)
State New, archived
Headers show
Series [1/5] sh: rename suffix-y to suffix_y | expand

Commit Message

Masahiro Yamada Jan. 9, 2022, 6:15 p.m. UTC
The appended file size is only used by the decompressors, which some
architectures support.

As the comment "zstd22 is used for kernel compression" says, cmd_zstd22
is used in arch/{mips,s390,x86}/boot/compressed/Makefile.

On the other hand, there is no good reason to append the file size to
cmd_zstd since it is used for other purposes.

Actually cmd_zstd is only used in usr/Makefile, where the appended file
size is rather harmful.

The initramfs with its file size appended is considered as corrupted
data, so commit 65e00e04e5ae ("initramfs: refactor the initramfs build
rules") added 'override size_append := :' to make it no-op.

As a conclusion, this $(size_append) should not exist here.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/Makefile.lib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nicolas Schier Jan. 10, 2022, 11:32 a.m. UTC | #1
On Mon, Jan 10, 2022 at 03:15:26AM +0900, Masahiro Yamada wrote:
> The appended file size is only used by the decompressors, which some
> architectures support.
> 
> As the comment "zstd22 is used for kernel compression" says, cmd_zstd22
> is used in arch/{mips,s390,x86}/boot/compressed/Makefile.
> 
> On the other hand, there is no good reason to append the file size to
> cmd_zstd since it is used for other purposes.
> 
> Actually cmd_zstd is only used in usr/Makefile, where the appended file
> size is rather harmful.
> 
> The initramfs with its file size appended is considered as corrupted
> data, so commit 65e00e04e5ae ("initramfs: refactor the initramfs build
> rules") added 'override size_append := :' to make it no-op.
> 
> As a conclusion, this $(size_append) should not exist here.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---

Reviewed-by: Nicolas Schier <n.schier@avm.de>


> 
>  scripts/Makefile.lib | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index d1f865b8c0cb..5366466ea0e4 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -473,7 +473,7 @@ quiet_cmd_xzmisc = XZMISC  $@
>  # be used because it would require zstd to allocate a 128 MB buffer.
>  
>  quiet_cmd_zstd = ZSTD    $@
> -      cmd_zstd = { cat $(real-prereqs) | $(ZSTD) -19; $(size_append); } > $@
> +      cmd_zstd = cat $(real-prereqs) | $(ZSTD) -19 > $@
>  
>  quiet_cmd_zstd22 = ZSTD22  $@
>        cmd_zstd22 = { cat $(real-prereqs) | $(ZSTD) -22 --ultra; $(size_append); } > $@
> -- 
> 2.32.0
>
diff mbox series

Patch

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index d1f865b8c0cb..5366466ea0e4 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -473,7 +473,7 @@  quiet_cmd_xzmisc = XZMISC  $@
 # be used because it would require zstd to allocate a 128 MB buffer.
 
 quiet_cmd_zstd = ZSTD    $@
-      cmd_zstd = { cat $(real-prereqs) | $(ZSTD) -19; $(size_append); } > $@
+      cmd_zstd = cat $(real-prereqs) | $(ZSTD) -19 > $@
 
 quiet_cmd_zstd22 = ZSTD22  $@
       cmd_zstd22 = { cat $(real-prereqs) | $(ZSTD) -22 --ultra; $(size_append); } > $@