Files
kata-containers/tools/packaging/kernel/configs
Fabiano Fidêncio 9ff10c0830 kernel: Add CONFIG_EFI=y as part of the TDX fragments
Otherwise `./build-kernel.sh -x tdx setup` will fail with the following
error:
```
$ ./build-kernel.sh -x tdx setup
INFO: Config version: 92
INFO: Kernel version: tdx-guest-v5.15-4
INFO: kernel path does not exist, will download kernel
INFO: Apply patches from
/home/ffidenci/go/src/github.com/kata-containers/kata-containers/tools/packaging/kernel/patches/tdx-guest-v5.15-4.x
INFO: Found 0 patches
INFO: Enabling config for 'tdx' confidential guest protection
INFO: Constructing config from fragments:
/home/ffidenci/go/src/github.com/kata-containers/kata-containers/tools/packaging/kernel/configs/fragments/x86_64/.config

WARNING: unmet direct dependencies detected for UNACCEPTED_MEMORY
  Depends on [n]: EFI [=n] && EFI_STUB [=n]
  Selected by [y]:
  - INTEL_TDX_GUEST [=y] && HYPERVISOR_GUEST [=y] && X86_64 [=y] &&
    CPU_SUP_INTEL [=y] && PARAVIRT [=y] && SECURITY [=y] &&
     X86_X2APIC[=y]
INFO: Some CONFIG elements failed to make the final .config:
INFO: Value requested for CONFIG_EFI_STUB not in final .config
INFO: Generated config file can be found in
/home/ffidenci/go/src/github.com/kata-containers/kata-containers/tools/packaging/kernel/configs/fragments/x86_64/.config
ERROR: Failed to construct requested .config file
ERROR: failed to find default config
```

Fixes: #4510

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-22 15:21:30 +02:00
..

Kata Containers kernel config files

This directory contains Linux Kernel config files used to configure Kata Containers VM kernels.

Types of config files

This directory holds config files for the Kata Linux Kernel in two forms:

  • A tree of config file fragments in the fragments sub-folder, that are constructed into a complete config file using the kernel scripts/kconfig/merge_config.sh script.
  • As complete config files that can be used as-is.

Kernel config fragments are the preferred method of constructing .config files to build Kata Containers kernels, due to their improved clarity and ease of maintenance over single file monolithic .configs.

How to use config files

The recommended way to set up a kernel tree, populate it with a relevant .config file, and build a kernel, is to use the build_kernel.sh script. For example:

$ ./build-kernel.sh setup

The build-kernel.sh script understands both full and fragment based config files.

Run ./build-kernel.sh help for more information.

How to modify config files

Complete config files can be modified either with an editor, or preferably using the kernel Kconfig configuration tools, for example:

$ cp x86_kata_kvm_4.14.x linux-4.14.22/.config
$ pushd linux-4.14.22
$ make menuconfig
$ popd
$ cp linux-4.14.22/.config x86_kata_kvm_4.14.x

Kernel fragments are best constructed using an editor. Tools such as grep and diff can help find the differences between two config files to be placed into a fragment.

If adding config entries for a new subsystem or feature, consider making a new fragment with an appropriately descriptive name.

If you want to disable an entire fragment for a specific architecture, you can add the tag # !${arch} in the first line of the fragment. You can also exclude multiple architectures on the same line. Note the # at the beginning of the line, this is required to avoid that the tag is interpreted as a configuration. Example of valid exclusion:

# !s390x !ppc64le

The fragment gathering tool performs some basic sanity checks, and the build-kernel.sh will fail and report the error in the cases of:

  • A duplicate CONFIG symbol appearing.
  • A CONFIG symbol being in a fragment, but not appearing in the final .config
    • which indicates that CONFIG variable is not a part of the kernel Kconfig setup, which can indicate a typing mistake in the name of the symbol.
  • A CONFIG symbol appearing in the fragments with multiple different values.