Re: [PATCH] m68k: Add target for lz4 compressed vmlinux
From: Thomas Weißschuh
Date: Sat Aug 09 2025 - 08:29:23 EST
Hi Daniel,
On 2025-08-09 20:35:39+0900, Daniel Palmer wrote:
> On Sat, 9 Aug 2025 at 16:50, Thomas Weißschuh <linux@xxxxxxxxxxxxxx> wrote:
> > Splitting the vmlinux.tmp creation into a dedicated target would make
> > all the compressor targets simpler. It will need a bit more disk space,
> > but there are a bunch of vmlinux copies already in any case.
> >
>
> That's true. I think a target for vmlinux.stripped and then use that
> in the compressed image targets.
>
> How about this?:
>
> vmlinux.stripped: vmlinux
> cp $< $@
> $(STRIP) $@
>
> vmlinux.gz: vmlinux.stripped
>
> ifndef CONFIG_KGDB
> $(KGZIP) -9c vmlinux.stripped >vmlinux.gz
> else
> $(KGZIP) -9c vmlinux >vmlinux.gz
> endif
>
> <snip>
I would continue with vmlinux.tmp. It might not actually be stripped.
quiet_cmd_precompress = PRECOMPRESS $@
ifndef CONFIG_KGDB
cmd_precompress = cp $< $@
else
cmd_precompress = $(STRIP) $< -o $@
endif
vmlinux.tmp: vmlinux FORCE
$(call if_changed,precompress)
targets += vmlinux.tmp
This will also correctly handle CONFIG_KGDB changing.
(Maybe the naming can be improved)
And for the compressor invocations we already have predefined commands:
vmlinux.gz: vmlinux.tmp FORCE
$(call if_changed,gzip)
targets += vmlinux.gz
> > > +
> > > CLEAN_FILES += vmlinux.gz vmlinux.bz2
> >
> > CLEAN_FILES also needs to be updated.
>
> Noted. Will fix for v2.
If you use $(call if_changed) as explained above, the "targets += ..."
will make the CLEAN_FILES unnecessary.