From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 82D3E158046 for ; Sun, 13 Oct 2024 20:33:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AA0F0E0841; Sun, 13 Oct 2024 20:33:52 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 952A8E0841 for ; Sun, 13 Oct 2024 20:33:52 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A14193430EE for ; Sun, 13 Oct 2024 20:33:51 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DB4E01315 for ; Sun, 13 Oct 2024 20:33:49 +0000 (UTC) From: "Andreas K. Hüttel" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas K. Hüttel" Message-ID: <1728830043.d20cfd598ce308f81835cd0b614c37fccc36f0bb.dilfridge@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/base/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/stagebase.py X-VCS-Directories: catalyst/base/ X-VCS-Committer: dilfridge X-VCS-Committer-Name: Andreas K. Hüttel X-VCS-Revision: d20cfd598ce308f81835cd0b614c37fccc36f0bb X-VCS-Branch: master Date: Sun, 13 Oct 2024 20:33:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 3ccca74c-0145-4768-ab5d-7348d9f89be8 X-Archives-Hash: ea0bda6014d8714d26442cc27eb20e63 commit: d20cfd598ce308f81835cd0b614c37fccc36f0bb Author: Andreas K. Hüttel gentoo org> AuthorDate: Sun Oct 13 14:34:03 2024 +0000 Commit: Andreas K. Hüttel gentoo org> CommitDate: Sun Oct 13 14:34:03 2024 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=d20cfd59 Clone stagebase logic from iso to qcow2 (mostly) Signed-off-by: Andreas K. Hüttel gentoo.org> catalyst/base/stagebase.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 8a3d2af6..b26c22ac 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -197,6 +197,7 @@ class StageBase(TargetBase, ClearBase, GenBase): self.set_fstype() self.set_fsops() self.set_iso() + self.set_qcow2() self.set_packages() self.set_rm() self.set_linuxrc() @@ -435,6 +436,20 @@ class StageBase(TargetBase, ClearBase, GenBase): self.settings[self.settings["spec_prefix"] + "/iso"]) del self.settings[self.settings["spec_prefix"] + "/iso"] + def set_qcow2(self): + if self.settings["spec_prefix"] + "/qcow2" in self.settings: + if self.settings[self.settings["spec_prefix"] + "/qcow2"].startswith('/'): + self.settings["qcow2"] = \ + normpath( + self.settings[self.settings["spec_prefix"] + "/qcow2"]) + else: + # This automatically prepends the build dir to the ISO output path + # if it doesn't start with a / + self.settings["qcow2"] = normpath(self.settings["storedir"] + + "/builds/" + self.settings["rel_type"] + "/" + + self.settings[self.settings["spec_prefix"] + "/qcow2"]) + del self.settings[self.settings["spec_prefix"] + "/qcow2"] + def set_fstype(self): if self.settings["spec_prefix"] + "/fstype" in self.settings: self.settings["fstype"] = \ @@ -1628,6 +1643,23 @@ class StageBase(TargetBase, ClearBase, GenBase): log.warning('livecd/iso was not defined. ' 'An ISO Image will not be created.') + def create_qcow2(self): + if "autoresume" in self.settings["options"] \ + and self.resume.is_enabled("create_qcow2"): + log.notice( + 'Resume point detected, skipping create_qcow2 operation...') + return + + # Create the QCOW2 file + if "qcow2" in self.settings: + cmd([self.settings['controller_file'], 'qcow2', self.settings['qcow2']], + env=self.env) + self.gen_digest_file(self.settings["qcow2"]) + self.resume.enable("create_qcow2") + else: + log.warning('diskimage/qcow2 was not defined. ' + 'A QCOW2 file will not be created.') + def build_packages(self): build_packages_resume = pjoin(self.settings["autoresume_path"], "build_packages") @@ -1753,6 +1785,17 @@ class StageBase(TargetBase, ClearBase, GenBase): env=self.env) self.resume.enable("livecd_update") + def diskimage_update(self): + if "autoresume" in self.settings["options"] \ + and self.resume.is_enabled("diskimage_update"): + log.notice( + 'Resume point detected, skipping build_packages operation...') + return + + cmd([self.settings['controller_file'], 'diskimage-update'], + env=self.env) + self.resume.enable("diskimage_update") + @staticmethod def _debug_pause_(): input("press any key to continue: ")