public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: Chuck Lever <cel@kernel.org>, Daniel Gomez <da.gomez@kruces.com>,
	kdevops@lists.linux.dev
Cc: Chuck Lever <chuck.lever@oracle.com>
Subject: [PATCH v2 28/33] bootlinux: Install pre-built kernels from packages
Date: Sun, 27 Jul 2025 18:14:28 -0700	[thread overview]
Message-ID: <20250728011434.3197091-29-mcgrof@kernel.org> (raw)
In-Reply-To: <20250728011434.3197091-1-mcgrof@kernel.org>

From: Chuck Lever <chuck.lever@oracle.com>

Add the tasks needed to install a kernel on a test host from a
pre-built package (either .deb or .rpm). These are run when the
new WORKFLOW_LINUX_PACKAGED Kconfig option is selected.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 playbooks/roles/bootlinux/defaults/main.yml   |  2 +
 .../bootlinux/tasks/install/packages.yml      | 41 +++++++++++++++++++
 playbooks/roles/bootlinux/tasks/main.yml      | 22 +++++++++-
 3 files changed, 64 insertions(+), 1 deletion(-)
 create mode 100644 playbooks/roles/bootlinux/tasks/install/packages.yml

diff --git a/playbooks/roles/bootlinux/defaults/main.yml b/playbooks/roles/bootlinux/defaults/main.yml
index 5b03f0c6..fc6bfec0 100644
--- a/playbooks/roles/bootlinux/defaults/main.yml
+++ b/playbooks/roles/bootlinux/defaults/main.yml
@@ -50,3 +50,5 @@ bootlinux_cxl_test: False
 bootlinux_tree_set_by_cli: False
 
 bootlinux_artifacts_dir: "{{ topdir_path }}/workflows/linux/artifacts"
+kernel_packages: []
+workflow_linux_packaged: false
diff --git a/playbooks/roles/bootlinux/tasks/install/packages.yml b/playbooks/roles/bootlinux/tasks/install/packages.yml
new file mode 100644
index 00000000..34365293
--- /dev/null
+++ b/playbooks/roles/bootlinux/tasks/install/packages.yml
@@ -0,0 +1,41 @@
+---
+- name: Install the built kernel RPMs on the target nodes
+  when:
+    - ansible_os_family != "Debian"
+  block:
+    - name: Find the kernel build artifacts on the control host
+      delegate_to: localhost
+      ansible.builtin.find:
+        paths: "{{ bootlinux_artifacts_dir }}"
+        patterns: "*.rpm"
+        file_type: file
+        recurse: true
+      register: found_rpms
+
+    - name: Upload the kernel build artifacts to the target nodes
+      ansible.builtin.copy:
+        src: "{{ item.path }}"
+        dest: "/tmp"
+        mode: "u=rw,g=r,o=r"
+      loop: "{{ found_rpms.files }}"
+      loop_control:
+        label: "Uploading {{ item.path | basename }} ..."
+
+    - name: Add the core kernel package
+      ansible.builtin.set_fact:
+        kernel_packages: "{{ kernel_packages + ['/tmp/' + item.path | basename ] }}"
+      when:
+        - "'devel' not in item.path"
+        - "'headers' not in item.path"
+      loop: "{{ found_rpms.files }}"
+      loop_control:
+        label: "Adding {{ item.path | basename }} ..."
+
+    - name: Install the selected kernel build artifacts on the target nodes
+      become: true
+      become_method: ansible.builtin.sudo
+      ansible.builtin.command:
+        cmd: "rpm -i --force {{ item }}"
+      loop: "{{ kernel_packages }}"
+      loop_control:
+        label: "Installing {{ item }}"
diff --git a/playbooks/roles/bootlinux/tasks/main.yml b/playbooks/roles/bootlinux/tasks/main.yml
index 57564399..acf77086 100644
--- a/playbooks/roles/bootlinux/tasks/main.yml
+++ b/playbooks/roles/bootlinux/tasks/main.yml
@@ -13,11 +13,16 @@
 - name: Select the .config file for building the test kernel
   ansible.builtin.include_tasks:
     file: "{{ role_path }}/tasks/config.yml"
+  when:
+    - not workflow_linux_packaged|bool
 
 # Distro specific
 - name: Install dependencies to build and install the Linux kernel
   ansible.builtin.import_tasks:
     file: install-deps/main.yml
+  when:
+    - not bootlinux_9p|bool
+    - not workflow_linux_packaged|bool
 
 # When using 9P builds, we still need make on the guest for modules_install
 - name: Install essential build tools for 9P builds
@@ -38,21 +43,27 @@
     - target_linux_install_b4 is defined
     - target_linux_install_b4
     - ansible_facts['os_family']|lower != 'debian'
+    - not workflow_linux_packaged|bool
 
 - name: Set bootlinux_b4_am_this_host as a fact for dev hosts only
   set_fact:
     bootlinux_b4_am_this_host: "{{ ansible_hostname | regex_search('^.*-dev$') is not none }}"
   when:
     - kdevops_baseline_and_dev|bool
+    - not workflow_linux_packaged|bool
 
 - name: Enable b4 am all hosts if not deploying dev and baseline nodes
   set_fact:
     bootlinux_b4_am_this_host: True
   when:
     - not kdevops_baseline_and_dev|bool
+    - not workflow_linux_packaged|bool
 
-- include_role:
+- name: Create data partition
+  ansible.builtin.include_role:
     name: create_data_partition
+  when:
+    - not workflow_linux_packaged|bool
 
 - name: Mount bootlinux 9p on each target node
   become: yes
@@ -180,6 +191,12 @@
   tags: [ 'saved' ]
   when: ansible_facts['os_family']|lower == 'redhat'
 
+- name: Install packages on each target node
+  ansible.builtin.import_tasks:
+    file: "{{ role_path }}/tasks/install/packages.yml"
+  when:
+    - workflow_linux_packaged|bool
+
 - name: Install {{ target_linux_tree }} on the target nodes
   become: yes
   become_flags: 'su - -c'
@@ -190,6 +207,8 @@
   args:
     chdir: "{{ target_linux_dir_path }}"
   tags: [ 'install-linux' ]
+  when:
+    - not workflow_linux_packaged|bool
 
 - name: Install {{ target_linux_tree }} cxl_test on the target nodes
   become: yes
@@ -203,6 +222,7 @@
   tags: [ 'install-linux', 'cxl-install' ]
   when:
     - kdevops_workflow_enable_cxl|bool
+    - not workflow_linux_packaged|bool
 
 - name: Set the default kernel if necessary
   tags: [ 'saved' ]
-- 
2.47.2


  parent reply	other threads:[~2025-07-28  1:14 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-28  1:14 [PATCH v2 00/33] remove vagrant and bootlinux shape up Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 01/33] vagrant: remove entire vagrant configuration directory Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 02/33] kconfigs: fix Kconfig references after vagrant removal Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 03/33] scripts: remove Vagrant-specific scripts and Makefiles Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 04/33] playbooks: remove Vagrant-specific playbooks and roles Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 05/33] gitignore: remove Vagrant-specific ignore patterns Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 06/33] docs: remove Vagrant-specific documentation files Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 07/33] Remove all remaining Vagrant references from codebase Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 08/33] terraform: Clean up the destroy tasks Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 09/33] Switch to the cloud.terraform.terraform module Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 10/33] terraform: Make use of the new "terraform_output" module Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 11/33] terraform: Move "wait_for_connection" out of the terraform playbook Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 12/33] terraform: Remove "delegate_to: localhost" Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 13/33] terraform: Replace scripts/status_terraform.sh Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 14/33] Kconfig: Convert the 9p option to a choice menu Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 15/33] bootlinux: fix making 9p default if using libvirt Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 16/33] bootlinux: Relocate tasks that select a kernel .config Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 17/33] bootlinux: Simplify tasks that select the kernel .config to build Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 18/33] bootlinux: Select the kernel .config earlier Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 19/33] bootlinux: Move 9p build tasks to a subrole Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 20/33] bootlinux: Move tasks for building on target nodes " Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 21/33] bootlinux: Clean up a grub set-up task Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 22/33] bootlinux: Harden update-grub/install.yml Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 23/33] Add a guest/instance for building the test kernel Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 24/33] bootlinux: Add a new builder choice Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 25/33] workflows: Add a kconfig setting for installing kernels via package Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 26/33] bootlinux: Enclose tasks to find kernel release name in a block: Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 27/33] bootlinux: Pick up kernel release info for pre-built packages Luis Chamberlain
2025-07-28  1:14 ` Luis Chamberlain [this message]
2025-07-28  1:14 ` [PATCH v2 29/33] bootlinux: Add an option to build with clang instead of gcc Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 30/33] Makefile: add make style for style checking Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 31/33] CLAUDE.md: new workflow guide for hosts and nodes Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 32/33] CLAUDE.md: add don't BS rules Luis Chamberlain
2025-07-28  1:14 ` [PATCH v2 33/33] gen_nodes/gen_hosts: avoid usage of fs_config_path on task names Luis Chamberlain
2025-07-29 20:07 ` [PATCH v2 00/33] remove vagrant and bootlinux shape up 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=20250728011434.3197091-29-mcgrof@kernel.org \
    --to=mcgrof@kernel.org \
    --cc=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=da.gomez@kruces.com \
    --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