All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: kdevops@lists.linux.dev, Jeff Layton <jlayton@kernel.org>
Subject: [PATCH RFC] bootlinux: add support for "config-kdevops"
Date: Thu, 17 Aug 2023 18:00:21 -0400	[thread overview]
Message-ID: <20230817-config-kdevops-v1-1-ddcd6c7b89dd@kernel.org> (raw)

Currently, you're expected to have a kernel config file with a name
like "config-{{ target_linux_config }}". If there isn't one, then the
play aborts.

For my use-case, I just want to have a stock config that I periodically
update and use regardless of the branch name. If there is a file called
config-kdevops in the template directory, use that instead of any
version-specific branch.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
Another alterative would be to allow config-branchname to take precedence,
and make this one the fallback when one isn't present.
---
 playbooks/roles/bootlinux/tasks/main.yml | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/playbooks/roles/bootlinux/tasks/main.yml b/playbooks/roles/bootlinux/tasks/main.yml
index e90ba60e1edb..488ff7738078 100644
--- a/playbooks/roles/bootlinux/tasks/main.yml
+++ b/playbooks/roles/bootlinux/tasks/main.yml
@@ -265,9 +265,25 @@
   run_once: true
   delegate_to: localhost
 
+- name: Check whether config-kdevops exists
+  stat:
+    path: "{{ role_path }}/templates/config-kdevops"
+  register: config_kdevops
+  delegate_to: localhost
+
+- name: Found config-kdevops, using it for template
+  set_fact:
+    linux_config: "config-kdevops"
+  when: config_kdevops.stat.exists
+
+- name: No config-kdevops, looking for {{ target_linux_config }}
+  set_fact:
+    linux_config: "{{ target_linux_config }}"
+  when: not config_kdevops.stat.exists
+
 - name: Copy configuration for Linux {{ target_linux_tree }} on the client side
   template:
-    src: "{{ target_linux_config }}"
+    src: "{{ linux_config }}"
     dest: "{{ target_linux_dir_path }}/.config"
     owner: "{{ data_user }}"
     group: "{{ data_group }}"
@@ -278,7 +294,7 @@
 
 - name: Copy configuration for Linux {{ target_linux_tree }} on the host side
   template:
-    src: "{{ target_linux_config }}"
+    src: "{{ linux_config }}"
     dest: "{{ bootlinux_9p_host_path }}/.config"
     mode: 0644
   tags: [ 'linux', 'git', 'config' ]

---
base-commit: 999512fbd14e577be47aafa8703c367bb0089cdc
change-id: 20230817-config-kdevops-cd742de641fd

Best regards,
-- 
Jeff Layton <jlayton@kernel.org>


             reply	other threads:[~2023-08-17 22:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-17 22:00 Jeff Layton [this message]
2023-08-17 22:42 ` [PATCH RFC] bootlinux: add support for "config-kdevops" 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=20230817-config-kdevops-v1-1-ddcd6c7b89dd@kernel.org \
    --to=jlayton@kernel.org \
    --cc=kdevops@lists.linux.dev \
    --cc=mcgrof@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.