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 C088419597F 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=1753665281; cv=none; b=Vk/3GRxwJyufHZbVmZGl0HI0VIyWMcWzg8L1USXi4Few9QnBqsjPznfROqjPvxs7Lz/qDTXVEhkBbr565Mb8uJHD29UgX5yKO+8wOKlFp983cGXaYibxvBiZbmeUIYdRa2/evVf3IychMXCBDILDZQ/W9L+Fta9xh6Mzz/cTY0k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753665281; c=relaxed/simple; bh=ULpNQ1PWjhLwYkOIbzMVwVjnzRptXQPQ2ti/rlCKY3U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZmyosDil0pY5Yuy2yu9bfPXK29+49KxQy5LOX2z60zu+Ie9af4qU6i1OLu2QHVBluzuAuSHrcoh8MszlJ9a+DWaPKiH8An/fW3zYy7TCaBOpu2aLhkTdVbvRkz2mz4uavL9iZDHJ8mZnWhmsODjZXvtF7vv9H2eKsgXzr+wd2l0= 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=BR7ytUU5; 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="BR7ytUU5" 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=BR7ytUU5KS+JgUNtuNfwzryvRU 5C5G2g8C4GbQS1ZeQB5CJ9mxtroK62h/9d3NQGh8RStMEth/P1e/ceqOCGCjG0D3Mv7gNEUdwjv4f g93kPJnwpWKdURefLvQ9si+a/30UKJcxk4PSW+0cb5uKYOYuoRxvWrx6/FJ3VxqVfXhzX3ZSOOZv4 r9XewwqIc1jAwBteylhCsJRNd+JK8hIEQkRhr9RQkpiMgB+ne0fysqkYc/lAMQL8LcW/RFNCqTYYm hjL/BBdsehcWUqhHm1qRHQnT/t3sA96rKXE62kZRn4ZTdiqZgqeR7Mp+AknegrM2tbTCdduwlFak5 9SeQqVnw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1ugCRo-0000000DPl3-1wOU; 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 26/33] bootlinux: Enclose tasks to find kernel release name in a block: Date: Sun, 27 Jul 2025 18:14:26 -0700 Message-ID: <20250728011434.3197091-27-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 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