public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: kdevops@lists.linux.dev, chuck.lever@oracle.com,
	da.gomez@samsung.com, jlayton@kernel.org
Cc: mcgrof@kernel.org
Subject: [PATCH 1/5] Makefile: add support for selective yamlconfig
Date: Wed,  4 Sep 2024 16:30:36 -0700	[thread overview]
Message-ID: <20240904233040.1516250-2-mcgrof@kernel.org> (raw)
In-Reply-To: <20240904233040.1516250-1-mcgrof@kernel.org>

Leverage support for selective yaml config support, this will let us
start removing the requirement to use Makefiles to append variables
into extra_vars.yaml, all we need to do is use the "output yaml" on
the symbols we want converted over.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 Makefile            |  3 ++-
 Makefile.extra_vars | 11 +++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 9d4e954811ab..f9f2b04c6586 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,7 @@ EXTRAVERSION =
 all: deps
 
 export KCONFIG_DIR=$(CURDIR)/scripts/kconfig
+export KCONFIG_YAMLCFG=$(CURDIR)/.extra_vars_auto.yaml
 include $(KCONFIG_DIR)/kconfig.Makefile
 include Makefile.subtrees
 
@@ -250,7 +251,7 @@ mrproper:
 	$(Q)rm -f terraform/*/terraform.tfvars
 	$(Q)rm -f $(KDEVOPS_NODES)
 	$(Q)rm -f $(KDEVOPS_HOSTFILE) $(KDEVOPS_MRPROPER)
-	$(Q)rm -f .config .config.old extra_vars.yaml
+	$(Q)rm -f .config .config.old extra_vars.yaml $(KCONFIG_YAMLCFG)
 	$(Q)rm -f playbooks/secret.yml $(KDEVOPS_EXTRA_ADDON_DEST)
 	$(Q)rm -rf include
 
diff --git a/Makefile.extra_vars b/Makefile.extra_vars
index 1fbacb3441fe..d77ea67c20d4 100644
--- a/Makefile.extra_vars
+++ b/Makefile.extra_vars
@@ -45,13 +45,12 @@ endef
 #$(patsubst $(firstword $(subst =, ,$(1)))=%,$(firstword $(subst =, ,$(1))):%,$(1))
 #$(patsubst $(firstword $(subst =, ,$(1))=)%,$(firstword $(subst =, , $(1):)%,$(1)),$(1))
 
-# We can transform most of .config things we need to using
-# looping on ANSIBLE_EXTRA_ARGS and converting those with
-# this target. If you need to do more complex fancy stuff
-# extend the EXTRA_VAR_INPUTS variable in your workflow with
-# your custom stuff.
+# extra_vars.yaml first gets the selective yaml entries which kconfig writes
+# to for us in KCONFIG_YAMLCFG, then we expand on it with more dynamic data.
+# We use awk NF to just remove empty lines.
 most_extra_vars:
-	@echo --- > $(KDEVOPS_EXTRA_VARS)
+	@awk NF $(KCONFIG_YAMLCFG) > $(KDEVOPS_EXTRA_VARS)
+	@echo "# end of of yamlconfig auto output yaml variables " >> $(KDEVOPS_EXTRA_VARS)
 	@$(foreach exp,$(ANSIBLE_EXTRA_ARGS),echo $(call YAML_ENTRY,$(subst =,: ,$(exp)) >> $(KDEVOPS_EXTRA_VARS)))
 
 # ANSIBLE_EXTRA_ARGS_SEPARATED is to be used for variables in .config
-- 
2.43.0


  reply	other threads:[~2024-09-04 23:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-04 23:30 [PATCH 0/5] kdevops: embrace kconfig selective yaml output Luis Chamberlain
2024-09-04 23:30 ` Luis Chamberlain [this message]
2024-09-04 23:30 ` [PATCH 2/5] scripts/guestfs.Makefile: use output yaml for GUESTFS_REQUIRES_UEFI Luis Chamberlain
2024-09-04 23:30 ` [PATCH 3/5] scripts/ssh.Makefile: remove Makefile appending of KDEVOPS_HOSTS_PREFIX Luis Chamberlain
2024-09-04 23:30 ` [PATCH 4/5] workflows/Makefile: replace direct named entries with output yaml Luis Chamberlain
2024-09-04 23:30 ` [PATCH 5/5] fstests: use selective yaml output on a slew of different variables Luis Chamberlain
2024-09-05  8:03 ` [PATCH 0/5] kdevops: embrace kconfig selective yaml output Luis Chamberlain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240904233040.1516250-2-mcgrof@kernel.org \
    --to=mcgrof@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=da.gomez@samsung.com \
    --cc=jlayton@kernel.org \
    --cc=kdevops@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox