[PATCH 03/12] linux-mirror: migrate all mirror makefile vars to kconfig

Daniel Gomez <[email protected]> Thu, 06 Nov 2025 23:35:57 +0100
Newsgroups dev.linux.lists.kdevops
Message-ID <[email protected]>
From: Daniel Gomez <[email protected]>

The mirror URL configuration was using a legacy approach where variables
were passed from Kconfig through Makefile to Ansible extra_vars. This
created duplicate variable definitions causing Ansible warnings when the
same variable appeared in both extra_vars_auto.yaml (from Kconfig output
yaml) and extra_vars.yaml (from Makefile arguments).

All mirror URL configurations now use the output yaml marker in
Kconfig, which automatically exports them to extra_vars_auto.yaml ->
extra_vars.yaml without requiring Makefile intervention. This eliminates
the duplicate definitions and simplifies the configuration pipeline.

The migration adds output yaml markers to all MIRROR_*_URL
and DEFAULT_*_URL configurations in both Kconfig.mirror and
Kconfig.defaults, uniforms the playbook variables to match the kconfig
ones and declares the missing vars in Ansible role defaults/.

This also fixes two bugs where mirror_qemu_url and mirror_qemu_jic23_url
were incorrectly referencing CONFIG_MIRROR_KDEVOPS_URL instead of
their proper CONFIG_MIRROR_QEMU_URL and CONFIG_MIRROR_QEMU_JIC23_URL
variables.

It also fixes the bug where some of the mirrors such as linux-modules
where not configured because of variable inconsistency.

Generated-by: Claude AI
Signed-off-by: Daniel Gomez <[email protected]>
---
 Makefile.linux-mirror                              | 18 ------------
 kconfigs/Kconfig.defaults                          |  8 +++++
 kconfigs/Kconfig.mirror                            | 13 +++++++++
 playbooks/roles/linux-mirror/defaults/main.yml     | 34 +++++++++++++++-------
 .../roles/linux-mirror/templates/mirrors.yaml.j2   | 18 ++++++------
 5 files changed, 54 insertions(+), 37 deletions(-)

diff --git a/Makefile.linux-mirror b/Makefile.linux-mirror
index eba8a374..4aa5c780 100644
--- a/Makefile.linux-mirror
+++ b/Makefile.linux-mirror
@@ -3,24 +3,6 @@ ifeq (y,$(CONFIG_MIRROR_INSTALL))
 
 LINUX_MIRROR_ARGS :=
 LINUX_MIRROR_ARGS += install_linux_mirror=True
-ifeq (y,$(CONFIG_INSTALL_LOCAL_LINUX_MIRROR))
-LINUX_MIRROR_ARGS += defaults_xfsprogs_git='$(subst ",,$(CONFIG_DEFAULT_XFSPROGS_URL))'
-LINUX_MIRROR_ARGS += defaults_xfsdump_git='$(subst ",,$(CONFIG_DEFAULT_XFSDUMP_URL))'
-LINUX_MIRROR_ARGS += defaults_pynfs_git='$(subst ",,$(CONFIG_DEFAULT_PYNFS_GIT_URL))'
-LINUX_MIRROR_ARGS += mirror_blktests_url='$(subst ",,$(CONFIG_MIRROR_BLKTESTS_URL))'
-LINUX_MIRROR_ARGS += mirror_fstests_url='$(subst ",,$(CONFIG_MIRROR_FSTESTS_URL))'
-LINUX_MIRROR_ARGS += mirror_kdevops_fstests_url='$(subst ",,$(CONFIG_MIRROR_KDEVOPS_FSTESTS_URL))'
-LINUX_MIRROR_ARGS += mirror_kdevops_url='$(subst ",,$(CONFIG_MIRROR_KDEVOPS_URL))'
-LINUX_MIRROR_ARGS += mirror_kdevops_linus_url='$(subst ",,$(CONFIG_MIRROR_KDEVOPS_LINUS_URL))'
-LINUX_MIRROR_ARGS += mirror_linux_next_url='$(subst ",,$(CONFIG_MIRROR_NEXT_URL))'
-LINUX_MIRROR_ARGS += mirror_qemu_url='$(subst ",,$(CONFIG_MIRROR_KDEVOPS_URL))'
-LINUX_MIRROR_ARGS += mirror_qemu_jic23_url='$(subst ",,$(CONFIG_MIRROR_KDEVOPS_URL))'
-LINUX_MIRROR_ARGS += mirror_mcgrof_linus_url='$(subst ",,$(CONFIG_MIRROR_MCGROF_LINUS_URL))'
-LINUX_MIRROR_ARGS += mirror_mcgrof_url='$(subst ",,$(CONFIG_MIRROR_MCGROF_URL))'
-LINUX_MIRROR_ARGS += mirror_stable_url='$(subst ",,$(CONFIG_MIRROR_STABLE_URL))'
-LINUX_MIRROR_ARGS += mirror_stable_rc_url='$(subst ",,$(CONFIG_MIRROR_STABLE_RC_URL))'
-LINUX_MIRROR_ARGS += mirror_torvalds_url='$(subst ",,$(CONFIG_MIRROR_TORVALDS_URL))'
-endif
 
 MIRROR_CODE      := $(TOPDIR)/playbooks/roles/linux-mirror/linux-mirror-systemd/
 
diff --git a/kconfigs/Kconfig.defaults b/kconfigs/Kconfig.defaults
index c43fee91..c96c3219 100644
--- a/kconfigs/Kconfig.defaults
+++ b/kconfigs/Kconfig.defaults
@@ -6,6 +6,7 @@ config DEFAULT_BLKTESTS_URL
 
 config DEFAULT_BLKTRACE_URL
 	string
+	output yaml
 	default "https://git.kernel.dk/blktrace"
 
 config DEFAULT_DATE_ISO8601
@@ -14,6 +15,7 @@ config DEFAULT_DATE_ISO8601
 
 config DEFAULT_DBENCH_URL
 	string
+	output yaml
 	default "https://github.com/linux-kdevops/dbench.git"
 
 config DEFAULT_FSTESTS_GIT_URL
@@ -38,6 +40,7 @@ config DEFAULT_FSTESTS_KDEVOPS_GITLAB_HTTPS_URL
 
 config DEFAULT_GIT_URL
 	string
+	output yaml
 	default "https://git.kernel.org/pub/scm/git/git.git"
 
 config DEFAULT_KDEVOPS_GITHUB_HTTPS_URL
@@ -54,6 +57,7 @@ config DEFAULT_KDEVOPS_LINUX_HTTPS_URL
 
 config DEFAULT_PYNFS_GIT_URL
 	string
+	output yaml
 	default "git://git.linux-nfs.org/projects/cdmackay/pynfs.git"
 
 config DEFAULT_QEMU_GITHUB_HTTPS_URL
@@ -102,6 +106,7 @@ config DEFAULT_LINUX_NEXT_HTTPS_GOOGLE_URL
 
 config DEFAULT_LTP_URL
 	string
+	output yaml
 	default "https://github.com/linux-test-project/ltp.git"
 
 config DEFAULT_MODULES_GIT
@@ -146,6 +151,7 @@ config DEFAULT_MCGROF_NEXT_HTTPS_GOOGLE_URL
 
 config DEFAULT_NFSTEST_URL
 	string
+	output yaml
 	default "git://git.linux-nfs.org/projects/mora/nfstest.git"
 
 config DEFAULT_TORVALDS_GIT_URL
@@ -210,8 +216,10 @@ config DEFAULT_XFS_HTTPS_GOOGLE_URL
 
 config DEFAULT_XFSDUMP_URL
 	string
+	output yaml
 	default "https://github.com/linux-kdevops/xfsdump-dev.git"
 
 config DEFAULT_XFSPROGS_URL
 	string
+	output yaml
 	default "https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git"
diff --git a/kconfigs/Kconfig.mirror b/kconfigs/Kconfig.mirror
index 6a66a510..e67fe22f 100644
--- a/kconfigs/Kconfig.mirror
+++ b/kconfigs/Kconfig.mirror
@@ -113,6 +113,7 @@ endchoice
 
 config MIRROR_KDEVOPS_URL
 	string
+	output yaml
 	default DEFAULT_KDEVOPS_GITHUB_HTTPS_URL if MIRROR_KDEVOPS_HTTPS_GITHUB
 	default DEFAULT_KDEVOPS_GITLAB_HTTPS_URL if MIRROR_KDEVOPS_HTTPS_GITLAB
 
@@ -151,6 +152,7 @@ endchoice
 
 config MIRROR_TORVALDS_URL
 	string
+	output yaml
 	default DEFAULT_TORVALDS_GIT_URL if MIRROR_TORVALDS_GIT
 	default DEFAULT_TORVALDS_HTTPS_URL if MIRROR_TORVALDS_HTTPS
 	default DEFAULT_TORVALDS_HTTPS_GOOGLE_URL if MIRROR_TORVALDS_HTTPS_GOOGLE
@@ -172,6 +174,7 @@ endchoice
 
 config MIRROR_KDEVOPS_LINUS_URL
 	string
+	output yaml
 	default DEFAULT_KDEVOPS_LINUX_HTTPS_URL if MIRROR_KDEVOPS_LINUS_HTTPS
 
 choice
@@ -209,6 +212,7 @@ endchoice
 
 config MIRROR_NEXT_URL
 	string
+	output yaml
 	default DEFAULT_LINUX_NEXT_GIT_URL if MIRROR_NEXT_GIT
 	default DEFAULT_LINUX_NEXT_HTTPS_URL if MIRROR_NEXT_HTTPS
 	default DEFAULT_LINUX_NEXT_HTTPS_GOOGLE_URL if MIRROR_NEXT_HTTPS_GOOGLE
@@ -248,6 +252,7 @@ endchoice
 
 config MIRROR_MCGROF_URL
 	string
+	output yaml
 	default DEFAULT_MCGROF_NEXT_GIT_URL if MIRROR_MCGROF_GIT
 	default DEFAULT_MCGROF_NEXT_HTTPS_URL if MIRROR_MCGROF_HTTPS
 	default DEFAULT_MCGROF_NEXT_HTTPS_GOOGLE_URL if MIRROR_MCGROF_HTTPS_GOOGLE
@@ -287,6 +292,7 @@ endchoice
 
 config MIRROR_MCGROF_LINUS_URL
 	string
+	output yaml
 	default DEFAULT_MCGROF_LINUS_HTTPS_URL if MIRROR_MCGROF_LINUS_GIT
 	default DEFAULT_MCGROF_LINUS_HTTPS_URL if MIRROR_MCGROF_LINUS_HTTPS
 	default DEFAULT_MCGROF_LINUS_HTTPS_GOOGLE_URL if MIRROR_MCGROF_LINUS_HTTPS_GOOGLE
@@ -366,6 +372,7 @@ endchoice
 
 config MIRROR_STABLE_URL
 	string
+	output yaml
 	default DEFAULT_STABLE_GIT_URL if MIRROR_STABLE_GIT
 	default DEFAULT_STABLE_HTTPS_URL if MIRROR_STABLE_HTTPS
 	default DEFAULT_STABLE_HTTPS_GOOGLE_URL if MIRROR_STABLE_HTTPS_GOOGLE
@@ -492,6 +499,7 @@ endchoice
 
 config MIRROR_QEMU_URL
 	string
+	output yaml
 	default DEFAULT_QEMU_GITHUB_HTTPS_URL if MIRROR_QEMU_HTTPS_GITHUB
 	default DEFAULT_QEMU_GITHUB_SSH_URL if MIRROR_QEMU_SSH_GITHUB
 	default DEFAULT_QEMU_GITLAB_HTTPS_URL if MIRROR_QEMU_HTTPS_GITLAB
@@ -537,6 +545,7 @@ endchoice
 
 config MIRROR_QEMU_JIC23_URL
 	string
+	output yaml
 	default DEFAULT_QEMU_JIC23_GITHUB_HTTPS_URL if MIRROR_QEMU_JIC23_HTTPS_GITHUB
 	default DEFAULT_QEMU_JIC23_GITHUB_SSH_URL if MIRROR_QEMU_JIC23_SSH_GITHUB
 	default DEFAULT_QEMU_JIC23_GITLAB_HTTPS_URL if MIRROR_QEMU_JIC23_HTTPS_GITLAB
@@ -577,6 +586,7 @@ endchoice
 
 config MIRROR_FSTESTS_URL
 	string
+	output yaml
 	default DEFAULT_FSTESTS_GIT_URL if MIRROR_FSTESTS_GIT
 	default DEFAULT_FSTESTS_HTTPS_URL if MIRROR_FSTESTS_HTTPS
 	default DEFAULT_FSTESTS_GOOGLE_HTTPS_URL if MIRROR_FSTESTS_HTTPS_GOOGLE
@@ -607,6 +617,7 @@ endchoice
 
 config MIRROR_KDEVOPS_FSTESTS_URL
 	string
+	output yaml
 	default DEFAULT_FSTESTS_KDEVOPS_GITHUB_HTTPS_URL if MIRROR_KDEVOPS_FSTESTS_HTTPS_GITHUB
 	default DEFAULT_FSTESTS_KDEVOPS_GITLAB_HTTPS_URL if MIRROR_KDEVOPS_FSTESTS_HTTPS_GITLAB
 
@@ -652,10 +663,12 @@ config MIRROR_VFS_URL
 
 config MIRROR_BLKTESTS_URL
 	string
+	output yaml
 	default DEFAULT_BLKTESTS_URL
 
 config MIRROR_XFSPROGS_URL
 	string
+	output yaml
 	default DEFAULT_XFSPROGS_URL
 
 choice
diff --git a/playbooks/roles/linux-mirror/defaults/main.yml b/playbooks/roles/linux-mirror/defaults/main.yml
index 763bcb9a..b7fcf3b6 100644
--- a/playbooks/roles/linux-mirror/defaults/main.yml
+++ b/playbooks/roles/linux-mirror/defaults/main.yml
@@ -5,25 +5,39 @@ local_systemd_path: "/usr/local/lib/systemd/system/"
 
 install_linux_mirror: false
 # Please keep these in alphabetical order
-defaults_blktrace_git: "https://git.kernel.dk/blktrace"
-defaults_dbench_git: "https://github.com/linux-kdevops/dbench.git"
+default_blktrace_url: "https://git.kernel.dk/blktrace"
+default_dbench_url: "https://github.com/linux-kdevops/dbench.git"
+default_git_url: "https://git.kernel.org/pub/scm/git/git.git"
+default_ltp_url: "https://github.com/linux-test-project/ltp.git"
+default_nfstest_url: "git://git.linux-nfs.org/projects/mora/nfstest.git"
+default_pynfs_git_url: "git://git.linux-nfs.org/projects/cdmackay/pynfs.git"
 defaults_kdevops_results_archive_git: "https://github.com/linux-kdevops/kdevops-results-archive.git"
-defaults_git_git: "https://git.kernel.org/pub/scm/git/git.git"
-defaults_ltp_git: "https://github.com/linux-test-project/ltp.git"
 defaults_mmtests_git: "https://github.com/gormanm/mmtests.git"
-defaults_nfstest_git: "git://git.linux-nfs.org/projects/mora/nfstest.git"
-defaults_pynfs_git: "git://git.linux-nfs.org/projects/cdmackay/pynfs.git"
-defaults_xfsprogs_git: "https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git"
-defaults_xfsdump_git: "https://github.com/linux-kdevops/xfsdump-dev.git"
+default_xfsdump_url: "https://github.com/linux-kdevops/xfsdump-dev.git"
+default_xfsprogs_url: "https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git"
 
 # These are mirrors which have variability support. The above should be converted
 # to these types so to support alternatives for sources and also the ability to
 # not use git and instead https in case of firewall restrictions in some
 # environments.
+# Please keep these in alphabetical order
+mirror_blktests_url: "https://github.com/osandov/blktests.git"
+mirror_fstests_url: "https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git"
+mirror_kdevops_fstests_url: "https://github.com/linux-kdevops/fstests.git"
+mirror_kdevops_linus_url: "https://github.com/linux-kdevops/linux.git"
 mirror_kdevops_url: "https://github.com/linux-kdevops/kdevops.git"
-mirror_stable_url: "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
+mirror_mcgrof_linus_url: "https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git"
+mirror_mcgrof_url: "https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git"
+mirror_mmtests_url: "https://github.com/gormanm/mmtests.git"
+mirror_modules_url: "https://git.kernel.org/pub/scm/linux/kernel/git/modules/linux.git"
+mirror_next_url: "https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git"
+mirror_qemu_jic23_url: "https://gitlab.com/jic23/qemu.git"
+mirror_qemu_url: "https://gitlab.com/qemu-project/qemu.git"
 mirror_stable_rc_url: "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git"
-mirror_torvalds_url: "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"
+mirror_stable_url: "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
+mirror_torvalds_url: "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"
+mirror_vfs_url: "https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git"
+mirror_xfs_url: "https://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git"
 
 install_only_git_daemon: false
 
diff --git a/playbooks/roles/linux-mirror/templates/mirrors.yaml.j2 b/playbooks/roles/linux-mirror/templates/mirrors.yaml.j2
index f39d0cb0..d3220ad8 100644
--- a/playbooks/roles/linux-mirror/templates/mirrors.yaml.j2
+++ b/playbooks/roles/linux-mirror/templates/mirrors.yaml.j2
@@ -11,16 +11,16 @@ mirrors:
     url: "{{ mirror_blktests_url }}"
     target: "blktests.git"
   - short_name: "blktrace"
-    url: "{{ defaults_blktrace_git }}"
+    url: "{{ default_blktrace_url }}"
     target: "blktrace.git"
   - short_name: "dbench"
-    url: "{{ defaults_dbench_git }}"
+    url: "{{ default_dbench_url }}"
     target: "dbench.git"
   - short_name: "fstests"
     url: "{{ mirror_fstests_url }}"
     target: "fstests.git"
   - short_name: "git"
-    url: "{{ defaults_git_git }}"
+    url: "{{ default_git_url }}"
     target: "git.git"
   - short_name: "kdevops-linus"
     url: "{{ mirror_kdevops_linus_url }}"
@@ -47,19 +47,19 @@ mirrors:
     refresh: "5m"
     refresh_on_boot: "10m"
   - short_name: "linux-next"
-    url: "{{ mirror_linux_next_url }}"
+    url: "{{ mirror_next_url }}"
     target: "linux-next.git"
     reference: "linux.git"
     refresh: "360m"
     refresh_on_boot: "10m"
   - short_name: "ltp"
-    url: "{{ defaults_ltp_git }}"
+    url: "{{ default_ltp_url }}"
     target: "ltp.git"
   - short_name: "mmtests"
     url: "{{ mirror_mmtests_url }}"
     target: "mmtests.git"
   - short_name: "nfstest"
-    url: "{{ defaults_nfstest_git }}"
+    url: "{{ default_nfstest_url }}"
     target: "nfstest.git"
   - short_name: "mcgrof-linus"
     url: "{{ mirror_mcgrof_linus_url }}"
@@ -78,7 +78,7 @@ mirrors:
     target: "linux-modules.git"
     reference: "linux.git"
   - short_name: "pynfs"
-    url: "{{ defaults_pynfs_git }}"
+    url: "{{ default_pynfs_git_url }}"
     target: "pynfs.git"
   - short_name: "qemu"
     target: "qemu.git"
@@ -109,8 +109,8 @@ mirrors:
     target: "xfs-linux.git"
     reference: "linux.git"
   - short_name: "xfsprogs"
-    url: "{{ defaults_xfsprogs_git }}"
+    url: "{{ default_xfsprogs_url }}"
     target: "xfsprogs-dev.git"
   - short_name: "xfsdump"
-    url: "{{ defaults_xfsdump_git }}"
+    url: "{{ default_xfsdump_url }}"
     target: "xfsdump-dev.git"

-- 
2.51.0