On Tue, Sep 15, 2026 at 06:06:05PM -0700, Kees Cook wrote:
> On Mon, Sep 14, 2026 at 10:22:20AM +0100, Lorenzo Stoakes (ARM) wrote:
> > diff --git a/Makefile b/Makefile
> > index 790ef23c5e8a..38c0cdc9f591 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -561,7 +561,7 @@ PERL            = perl
> >  PYTHON3            = python3
> >  CHECK              = sparse
> >  BASH               = bash
> > -KGZIP              = gzip
> > +KGZIP              := $(if $(shell command -v pigz 2>/dev/null),pigz,gzip)
> >  KBZIP2             = bzip2
> >  KLZOP              = lzop
> >  LZMA               = lzma
>
> I had another idea that I think solves both my concerns (limits
> to parallelism, new surprise users) and your concerns (complexity,
> single-threaded when needed)... how about:
>
> Makefile:
>
> KPGZIP        := $(if $(shell command -v pigz 2>/dev/null),$(PYTHON3) 
> $(abs_srctree)/scripts/jobserver-exec 
> $(abs_srctree)/scripts/parallel-gzip,gzip)

That's nice :) Keeps things simple, separates out the jobserver-exec execution
(which it turns out is no big deal also), and abstracts the idea of 'parallel
gzip'.

Let's do this.

>
> and the same scripts/parallel-gzip:
>
>       #!/bin/sh
>       exec pigz -p ${PARALLELISM:-1} "$@"
>
> And then replace the /boot/ KGZIP uses with KPGZIP. Then we don't need
> to change modules, config_data, new users, nor cmd_gzip, etc, which all
> continue to use the regular KGZIP and the "use python" part for the
> KPGZIP case becomes is a 1-time cost?

Yeah that's really nice.

This is clearly the way forward, will do that in v3, thanks! :)

[Oh and on precedent, it seems the arm64 FIT image builder,
 scripts/make_fit.py, uses pigz already if available :>)]

>
> -Kees
>
> --
> Kees Cook

--
Cheers, Lorenzo

Reply via email to