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 BE5AA194A59 for ; Mon, 28 Jul 2025 01:14:37 +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=1753665282; cv=none; b=altGNDOvqRtmGZ+r9p+Bn6e+GjU/3Tlrxq5BVGWaMkF7y136BlWxxZrGuLhCVphCMM3/NpvZeNtXZ+9MStnili2qwyzR6IFy3tuErQp+qZOwmLNva9iRp6X0S0SIOMiXQioy4Yd2RGS0uTkG1e7ORwOL50deEJ59tqOY5H+XL98= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753665282; c=relaxed/simple; bh=90xUPAiPC6zF8Yt7T93H5zcOcSj4MwJV3y0Qe1zRsVk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KNhxxoVW6umdP89apVl7OXXfwsH3NUC2gRPcIDoJ0L07L/f8hErHwZnhESSzIOF6ssAA8EuW9k9AKH5WeDTv9uFYaU6dbvAj92L/1OliIrnJLvTiHZ6MONp6zoCFZ2hK+0rfhBDXquVbTcKZkJ5qs1zjIuIuMXxUCUu0daiOPUI= 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=qDo4jZWO; 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="qDo4jZWO" 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=qDo4jZWOuWryviFtqdJjF/RoMe SeybpWFGYfzb0HwyAipTyvC9lIC0D1DXNzdjm6gllXatB8TCUCFPa9tpLHOSHeU4Yb3Mn+NcKPKiz ja/BLdoClgfXC9HQQ73TaEbVk+HumsHc9PHi+0NmZPjRw0pnuwWCdgcFWAGB4vMTic1DxhJ7g0aMV HUWGTSItupXetJONXW+UD3xB7NMtJo4ccoAJvI9ly0wwU3QUIhgqdUI2YxXCi3zUSvWQecI/4yn66 xrDyJrHW2Jy/ihdjn+ih+OTJHJ4byYK4pSeXLTu5DUpykacT2gv5J/0DEtwTpkZA4k2ioGUWXUR1t GC/GrDHg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1ugCRo-0000000DPlH-2Hao; Mon, 28 Jul 2025 01:14:36 +0000 From: Luis Chamberlain To: Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev Cc: Chuck Lever Subject: [PATCH v2 28/33] bootlinux: Install pre-built kernels from packages Date: Sun, 27 Jul 2025 18:14:28 -0700 Message-ID: <20250728011434.3197091-29-mcgrof@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250728011434.3197091-1-mcgrof@kernel.org> References: <20250728011434.3197091-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