Skip to content

kdevops: embrace kconfig selective yaml output

Luis Chamberlain kdevops 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5Makefile: add support for selective yamlconfigMakefile Makefile.extra_vars+7 -70 replies
2/5scripts/guestfs.Makefile: use output yaml for GUESTFS_REQUIRES_UEFIkconfigs/Kconfig.guestfs scripts/guestfs.Makefile+1 -40 replies
3/5scripts/ssh.Makefile: remove Makefile appending of KDEVOPS_HOSTS_PREFIXkconfigs/Kconfig.kdevops scripts/gen-hosts.Makefile scripts/ssh.Makefile+7 -40 replies
4/5workflows/Makefile: replace direct named entries with output yamlkconfigs/workflows/Kconfig workflows/Makefile+8 -80 replies
5/5fstests: use selective yaml output on a slew of different variablesworkflows/fstests/Kconfig workflows/fstests/Makefile+11 -460 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] kdevops: embrace kconfig selective yaml output

13 days ago I posted an RFC for Linux upstream to support selective yaml output on kconfig [0]. What this does is it lets you annnotate "output yaml" on kconfig symbols and if you do that you also get an additional yaml output of only those symbols. Long ago I theorized we could do something like this so to avoid having to do Makefile edits like this to propagate variables to ansible:

ifeq (y,$(CONFIG_GUESTFS_REQUIRES_UEFI))
GUESTFS_ARGS += guestfs_requires_uefi=True
endif

Alternatives to this are to do full config postprocessing and converting all symbols to yaml entries, or even having an inclusion file to determine which variables should be converted.

The kconfig selective yaml output support streamlines the need by easily associating which symbols you want to be converted over to yaml directly on the kconfig file itself:

config GUESTFS_REQUIRES_UEFI
bool
+ output yaml

Since there are no upstream users of this in the kernel it is obvious that this likely wouldn't have been desirable to be maintained in the kernel, and Masahiro Yamada confirmed so. So this is not upstreamable to Linux. However, we can just carry the delta forward as its rather small. What this would mean for us since we are using a git subtree for kconfig is that we embrace a yamlconfig branch on kconfig and keep that with the small delta. It can sync with the master branch when new updates for new linux-next tags are updated.

I believe that considering the alternatives, carrying the delta forward on a branch on kconfig for this is a much more straight forward approach but I would like to hear other's opinions on this now that we have the work done and a proof of concept completed. This approach lets us clearly annotate the inclusion process of conversion of kconfig symbols to ansible variables, while also allowing the extra_vars.yaml file to remain slim. This makes a deterministic association between kconfig symbol and ansible variables names clear. The value in this we remove ambiguation between kconfig symbol and ansible variables, while also allowing us to keep our Makefiles for workflows pretty small, removing the complexities in variable conversion.

The work left is then:

a) We need to see how a delta in our kconfig could be maintained
b) What the code changes for actual selective yaml output would look like
c) What the cleanups actually look like as a demonstration

For a) it's real simple: we keep a yamlconfig branch on the kconfig tree [1]. Likewise a demonstration project which uses this would be needed, for that I have created the yamlconfig branch on init-kconfig [2]. The previous patches lets us upgrade the kconfig use din kdevops up to the kconfig as of linux-next tag next-20240830. Now to merge the changes required for yamlconfig all we need to do is run:

git subtree --squash pull --prefix=scripts/kconfig/ kconfig yamlconfig

The patches in this series then make use of this optional feature and demonstrate how it fits into kdevops. The last patch is really what I was hoping for to demonstrate. The third patch in this series titled "scripts/ssh.Makefile: remove Makefile appending of KDEVOPS_HOSTS_PREFIX" demonstrates how easy it is for us to loose ourselves with variables and havne't even realized it. It implicates a long term cleanup we should strive to where essentially we won't have to expect users of the old variables so we remove the pesky old variables.

What this does is, it let's us *selectively* move forward with the conversion proceess workflow by workflow, while allowing *new* workflows to come in squeeky clean from the start because proper determinism on variable names would be used from the start.

The real meat and bones and rationale for this effort is demonstrated on the last patch. Thoughts?

If you want to take this for a spin:

https://github.com/mcgrof/kdevops/tree/yamlconfig

PS. nconfig doesn't yet have yamlconfig support, I can add it easily if this approach is agreeable.

[0] https://lkml.kernel.org/r/[email protected]
[1] https://github.com/linux-kdevops/kconfig/tree/yamlconfig
[2] https://github.com/linux-kdevops/init-kconfig/tree/yamlconfig

Luis Chamberlain (5):
Makefile: add support for selective yamlconfig scripts/guestfs.Makefile: use output yaml for GUESTFS_REQUIRES_UEFI scripts/ssh.Makefile: remove Makefile appending of
KDEVOPS_HOSTS_PREFIX
workflows/Makefile: replace direct named entries with output yaml
fstests: use selective yaml output on a slew of different variables

 Makefile                   |  3 ++-
 Makefile.extra_vars        | 11 +++++----
 kconfigs/Kconfig.guestfs   |  1 +
 kconfigs/Kconfig.kdevops   |  7 ++++++
 kconfigs/workflows/Kconfig |  8 +++++++
 scripts/gen-hosts.Makefile |  1 -
 scripts/guestfs.Makefile   |  4 ----
 scripts/ssh.Makefile       |  3 ---
 workflows/Makefile         |  8 -------
 workflows/fstests/Kconfig  | 11 +++++++++
 workflows/fstests/Makefile | 46 --------------------------------------
 11 files changed, 34 insertions(+), 69 deletions(-)
Signature · 1 line
2.43.0