Re: [PATCH v4] ext4: add test for all ext4/ext3/ext2 mount options

Lukas Czerner
2021-11-04T08:43:26Z

On Wed, Nov 03, 2021 at 11:33:18PM -0400, Theodore Ts'o wrote:
> > +_has_kernel_config()
> > +{
> > + option=$1
> > + config="/lib/modules/$(uname -r)/build/.config"
> > + grep -qE "^${option}=[my]" $config
> > +}
>
> In my test infrastructure, /lib/modules/$Kver/build/.config doesn't
> exist. That's because I build the kernel without any modules, and
> then launch kvm using its --kernel command-line option. This really
> helps with development velocity, since the developer doesn't need to
> waste time installing the kernel, and/or building a kernel rpm or
> dpkg. Instead, kvm can just launch the kernel directly out of the
> build tree:
>
> /usr/bin/kvm ... --kernel /build/ext4/arch/x86/boot/bzImage ..
>
> So it would be nice if _has_kernel_config also checks to see if
> /proc/config.gz exists, and if so, tries to use it.

Good point. Of course it would only work if kernel is configured to have
/proc/config.gz, but I don't know of any other reliable way to checking
the kernel config.

Thanks!
-Lukas

>
> Thanks,
>
> - Ted
>