Re: [PATCH] initramfs: do not show compression mode choice if INITRAMFS_SOURCE is empty

From: Masahiro Yamada
Date: Wed Feb 05 2020 - 20:55:06 EST


Hi Linus,

On Tue, Feb 4, 2020 at 2:35 AM Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Mon, Feb 3, 2020 at 4:47 PM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
> >
> > This commit hides the Kconfig choice in that case. The default cpio
> > is embedded without compression, which was the original behavior.
>
> Btw, is there any way to figure out automatically what the initrd
> compression is (for the external case)?
>
> Because I think it would be lovely to be able to have sane defaults
> for the CONFIG_RD_xyz things.
>
> I'm assuming the answer is "no", simply because it comes from distro
> installs, but I thought I'd check.

I think the answer is no.

For external initrd, it is up to distros,
and we have no way to know the compression type beforehand.

We know it after booting.

init/initramfs.c has the following line:
pr_debug("Detected %s compressed data\n", compress_name);



--
Best Regards
Masahiro Yamada