Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] kernel.bbclass: add gzip-native to DEPENDS
@ 2026-10-29 12:47 Vinicius Pedrosa
  2026-10-29 13:11 ` Bruce Ashfield
  0 siblings, 1 reply; 2+ messages in thread
From: Vinicius Pedrosa @ 2026-10-29 12:47 UTC (permalink / raw)
  To: openembedded-core; +Cc: Bruce Ashfield, Vinicius Pedrosa

gzip-native is only in do_deploy[depends]. On a fresh work directory,
do_compile runs the host gzip to create kernel/config_data.gz and,
with CONFIG_KERNEL_GZIP, the compressed kernel payload.

do_unpack cleans ${B} but not the recipe sysroot. After do_deploy has
run once, a rebuild from do_unpack picks up pigz from gzip-native
instead. Same .config, same uncompressed IKCONFIG data, but
config_data.gz and the kernel image come out different.

Add gzip-native to DEPENDS so the same compressor is used from the
first do_compile.

Signed-off-by: Vinicius Pedrosa <vinicius.eduardo.pedrosa@gmail.com>
---
Reproduced on master (fa83da7), nodistro, qemux86-64, linux-yocto
7.2.8: build linux-yocto, rerun do_unpack without touching the kernel
sources or config (I added an unused file to SRC_URI), build again.
A plain `-c compile -f` doesn't show it, kbuild doesn't regenerate
the .gz files.

- before do_deploy: host gzip 1.12, config_data.gz 38639 bytes
- after do_deploy: sysroot pigz 2.8, config_data.gz 38702 bytes,
  bzImage 14844928 -> 14832640 bytes
- with gzip-native in DEPENDS: pigz in both builds, same output

Two fresh builds, and a rebuild without do_deploy in between, gave
identical output.

Bruce, you sent "[8/8] linux-yocto: add gzip-native to DEPENDS" in
2023 (patchwork 29990) and withdrew it. This one puts the dependency
in the class instead.

 meta/classes-recipe/kernel.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index 0a6d754..99d652b 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -19,7 +19,7 @@ KERNEL_PACKAGE_NAME ??= "kernel"
 KERNEL_DEPLOYSUBDIR ??= "${@ "" if (d.getVar("KERNEL_PACKAGE_NAME") == "kernel") else d.getVar("KERNEL_PACKAGE_NAME") }"
 
 PROVIDES += "virtual/kernel"
-DEPENDS += "virtual/cross-binutils virtual/cross-cc kmod-native bc-native bison-native"
+DEPENDS += "virtual/cross-binutils virtual/cross-cc kmod-native bc-native bison-native gzip-native"
 DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lzo", "lzop-native", "", d)}"
 DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lz4", "lz4-native", "", d)}"
 DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.zst", "zstd-native", "", d)}"
-- 
2.43.0


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

* Re: [PATCH] kernel.bbclass: add gzip-native to DEPENDS
  2026-10-29 12:47 [PATCH] kernel.bbclass: add gzip-native to DEPENDS Vinicius Pedrosa
@ 2026-10-29 13:11 ` Bruce Ashfield
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Ashfield @ 2026-10-29 13:11 UTC (permalink / raw)
  To: Vinicius Pedrosa; +Cc: openembedded-core

On Thu, Oct 29, 2026 at 8:47 AM Vinicius Pedrosa <vinicius.eduardo.pedrosa@gmail.com> wrote:
>
> gzip-native is only in do_deploy[depends]. On a fresh work directory,
> do_compile runs the host gzip to create kernel/config_data.gz and,
> with CONFIG_KERNEL_GZIP, the compressed kernel payload.
>
> do_unpack cleans ${B} but not the recipe sysroot. After do_deploy has
> run once, a rebuild from do_unpack picks up pigz from gzip-native
> instead. Same .config, same uncompressed IKCONFIG data, but
> config_data.gz and the kernel image come out different.
>
> Add gzip-native to DEPENDS so the same compressor is used from the
> first do_compile.
>
[...]
>
> Bruce, you sent "[8/8] linux-yocto: add gzip-native to DEPENDS" in
> 2023 (patchwork 29990) and withdrew it. This one puts the dependency
> in the class instead.

For the record, I withdrew that one because the motivation didn't hold
up. I was chasing a "gzip: abort: zlib version less than 1.2.3" failure
in do_compile. Richard pointed out that it looked like a stale zlib in
the sysroot that an existing kernel build didn't notice, rather than a
missing dependency. That made sense, so I dropped it and carried it
locally to see if it came back (it didn't).

Your reason is different, and a better one: the task-level dependency
from do_deploy leaks into do_compile through the recipe sysroot, so the
compressor (and the output) depends on whether do_deploy has already
run.

Class vs linux-yocto.inc is a wash, but having it in the class is
of course preferable.

>
>  meta/classes-recipe/kernel.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
> index 0a6d754..99d652b 100644
> --- a/meta/classes-recipe/kernel.bbclass
> +++ b/meta/classes-recipe/kernel.bbclass
> @@ -19,7 +19,7 @@ KERNEL_PACKAGE_NAME ??= "kernel"
>  KERNEL_DEPLOYSUBDIR ??= "${@ "" if (d.getVar("KERNEL_PACKAGE_NAME") == "kernel") else d.getVar("KERNEL_PACKAGE_NAME") }"
>
>  PROVIDES += "virtual/kernel"
> -DEPENDS += "virtual/cross-binutils virtual/cross-cc kmod-native bc-native bison-native"
> +DEPENDS += "virtual/cross-binutils virtual/cross-cc kmod-native bc-native bison-native gzip-native"

With this in DEPENDS, the gzip-native entry in do_deploy[depends] is now
redundant. It doesn't hurt anything, so either drop it in a v2 or leave
it. Up to you.

Acked-by: Bruce Ashfield <bruce.ashfield@gmail.com>

Bruce

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

end of thread, other threads:[~2026-10-29 13:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-29 12:47 [PATCH] kernel.bbclass: add gzip-native to DEPENDS Vinicius Pedrosa
2026-10-29 13:11 ` Bruce Ashfield

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