From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16C7172621 for ; Mon, 28 Jul 2025 00:18:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753661887; cv=none; b=QzI06j89oXqx8103St+tc1LxKZe5LrQbSUWn1IxfCaNj0jxescGchjUEdUlplvZ7/GrZzFnVohZZfu1jiRJeFoYjqjqHkYE8+9miRRK04macxDv53B78xSFBN+I1tQgvVO9bmwoKXlDSxkwGKt0lKlHFbnmWECHALRXGLwkK0Ds= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753661887; c=relaxed/simple; bh=90xUPAiPC6zF8Yt7T93H5zcOcSj4MwJV3y0Qe1zRsVk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lSAkifgV+8JGVbNPTk2yQsUzSzskmOUJ83KNfNXvvV1udwJFScRi0abz8v8pXwW3HleSGk9CPiZwOrMh5N4p61G0osdHZdsn5jEUt6zGGkI8NZ+Ko9SRp+npGTWw7fj/KMfqsHc4KJhtSL8Y6YVdbFK0K/toVuNoLdf9W7MJYbE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=ap74C0KV; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ap74C0KV" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=Q2lc6jhBxjQrACHYqvaAhzBl5QrsAwgsrnvUVi2ZmnI=; b=ap74C0KV39cAvm/J/gO0JAwkyX A7gNCaRTx62sy/IpSbjTVvVDsK1KiJyLoOIVcclWWBThu9G89vVKjzZxS5SGGZQ4JBZBxSHfTuCzr pz61R+/CJV4szW+zs2ichuvPHQMyub/cFbI4/680pXr0irySLW2Euh2mrcTyb7Tphjtl4oGBelsVH 8v9I/gR/5GTo5ae0ewgB5vcDzsCRxbmE4h++7sMlFTWeqeEDYqIY8PbFsY9+AnsKAI43onQwh7muh MQDc/NbTuL9zESZYyoF8G0jrkxZnuVkFM3PZQufia0dsyZaTUgW2uir33QkfK+UjLMDQhyG5KZE8K 0Z4wT+Zw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1ugBZ5-0000000DNYZ-29UW; Mon, 28 Jul 2025 00:18:03 +0000 From: Luis Chamberlain To: Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev Cc: Chuck Lever Subject: [PATCH 35/40] bootlinux: Install pre-built kernels from packages Date: Sun, 27 Jul 2025 17:17:54 -0700 Message-ID: <20250728001800.3188617-36-mcgrof@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250728001800.3188617-1-mcgrof@kernel.org> References: <20250728001800.3188617-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain From: Chuck Lever 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 --- 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