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 07F8972613 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=X0YWlA/stP+3yCvxUtL4MRcjtl+/2yWmv+rzTvNXt+wXuSaA5R0JB//RvpG+1mnVQuY0nnCl7uAEVo4C+i0ozBEaN01o8MsiUg7DiTMNpuZhsrTroAALL0ZNYFT29zSp5t05iM1nYrImiW0ovnaEVXjWORmVnJTxTikmj0KZ3zA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753661887; c=relaxed/simple; bh=ULpNQ1PWjhLwYkOIbzMVwVjnzRptXQPQ2ti/rlCKY3U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Bx6/JDymfyOLXJG8gHf6XZhysQufyBLjO1C77YIyj4bx7snJqSebICVYmD0ResyKG+nLXg36lFH39+mGmG/Y9s/Ot/xilW/MbIlFK6gU6DRtqN9EH8VRhct9QkiwGjEeJGSpadnRxH/RBItYb4Y9fKMhbFtznkuul7KT1rqMaK4= 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=Try9pp72; 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="Try9pp72" 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=2Dv5nap9peWNd5Cfzia8ru0adM9/nIFTPuKu+iUHxk8=; b=Try9pp720gvxAD1+iRhNmaLdsv 8pjKEY626btC9ceYkpqHHTjFU9e4Ep/q2wxGWGcohfcqQNRI3lfauCrTDX4lFm1kxDXFmGKVSgntD SG3WYN7+QXVNEGUtQszrTigmMGpaRMY4cFYCwo4+ijOBhY3PyoJp2Cwmwyz3cBp9Xr1nDik8tJn+x HvvsRvxoLtquH9bXV6YY9fZXwPGe6/VCjXl0IPBqAkjopE7Y/q0R9zsRii6U6q8zJzDVTzqgnch31 tR5UoSz0NUD5DTtRVKUhVJNw4PAuBcvAyOs+1XfGSVaUZtGN08UklQbUUNxfgcF/r9Q0Mnv+LF/EA /CuUD24Q==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1ugBZ5-0000000DNYI-1nMX; 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 33/40] bootlinux: Enclose tasks to find kernel release name in a block: Date: Sun, 27 Jul 2025 17:17:52 -0700 Message-ID: <20250728001800.3188617-34-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 This set of tasks is done when installing a new kernel from a source tree. I'm about to add a similar set of tasks that will handle the "install from a pre-built package" case. Refactor these tasks so they can be switched on and off as a group. Signed-off-by: Chuck Lever --- .../bootlinux/tasks/update-grub/install.yml | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/playbooks/roles/bootlinux/tasks/update-grub/install.yml b/playbooks/roles/bootlinux/tasks/update-grub/install.yml index a10064ee..350090a1 100644 --- a/playbooks/roles/bootlinux/tasks/update-grub/install.yml +++ b/playbooks/roles/bootlinux/tasks/update-grub/install.yml @@ -93,29 +93,33 @@ tags: [ 'uninstall-linux', 'manual-update-grub' ] import_tasks: update-grub/main.yml -- name: Set the pathname used to extract the kernel release +- name: Get the name of the kernel release to install (source tree) tags: - vars - ansible.builtin.set_fact: - kernelrelease_file: "{{ target_linux_dir_path }}/include/config/kernel.release" + block: + - name: Set the pathname used to extract the kernel release + ansible.builtin.set_fact: + kernelrelease_file: "{{ target_linux_dir_path }}/include/config/kernel.release" -- name: Stat {{ kernelrelease_file }} - tags: - - vars - ansible.builtin.stat: - get_checksum: false - get_mime: false - path: "{{ kernelrelease_file }}" - register: kernel_release_file + - name: Stat {{ kernelrelease_file }} + ansible.builtin.stat: + get_checksum: false + get_mime: false + path: "{{ kernelrelease_file }}" + register: kernel_release_file -- name: Slurp {{ kernelrelease_file }} - tags: - - vars - ansible.builtin.slurp: - src: "{{ kernelrelease_file }}" - register: slurped_kernel_release - when: - - kernel_release_file.stat.exists + - name: Slurp {{ kernelrelease_file }} + ansible.builtin.slurp: + src: "{{ kernelrelease_file }}" + register: slurped_kernel_release + when: + - kernel_release_file.stat.exists + + - name: Get the kernel release of the kernel to be installed + ansible.builtin.set_fact: + kernelrelease: "{{ slurped_kernel_release.content | b64decode | trim }}" + when: + - kernel_release_file.stat.exists - name: Set default kernelrelease if not determined ansible.builtin.set_fact: -- 2.47.2