troubleshoot icon indicating copy to clipboard operation
troubleshoot copied to clipboard

Allow kernelConfig analyser to check kernel capability is either built in or loaded

Open banjoh opened this issue 1 year ago • 1 comments

Describe the rationale for the suggested feature.

When we define an analyser to check for the availability of a kernel config, it would look something like this

- kernelConfigs:
    selectedConfigs:
      - CONFIG_CGROUP_FREEZER=y
      - CONFIG_NETFILTER_XTABLES=m
    outcomes:
      - pass:
          message: "required kernel configs are available"
      - fail:
          message: "missing kernel config(s): {{ .ConfigsNotFound }}"

Values in the selectedConfigs list are checked using an AND operation i.e they all need to exist or not. In some environments, a kernel configuration may have been loaded as a module (m) or built into the kernel (y) depending of the kernel version. We are not able to have a spec like below to allow a preflight to capture both cases.

    selectedConfigs:
      - CONFIG_CGROUP_FREEZER=y
      - CONFIG_CGROUP_FREEZER=m

This will limit users to just detecting a configuration is either loaded as a module or in-built into the kernel.

Describe the feature

Have the analyser accept a config with multiple values i.e CONFIG_X=my. This would mean that we would be able to define a spec like below which would check whether a kernel configuration exists irrelevant of whether it was loaded as a module or in-built into the kernel. The ability of checking one of the other (m or y) is still preserved with this approach.

- kernelConfigs:
    selectedConfigs:
      - CONFIG_CGROUP_FREEZER=my
      - CONFIG_NETFILTER_XTABLES=my
    outcomes:
      - pass:
          message: "required kernel configs are available"
      - fail:
          message: "missing kernel config(s): {{ .ConfigsNotFound }}"

banjoh avatar Jun 14 '24 17:06 banjoh