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

Theodore Ts'o
2021-11-04T03:33:31Z

> +_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.

Thanks,

- Ted