public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/catalyst:pending commit in: catalyst/base/, catalyst/targets/, targets/stage3/
@ 2017-11-29 17:21 Brian Dolbec
  0 siblings, 0 replies; only message in thread
From: Brian Dolbec @ 2017-11-29 17:21 UTC (permalink / raw
  To: gentoo-commits

commit:     7d55d5609676afb32c612fbdad56d4d3b49e8f84
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 29 17:15:41 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Nov 29 17:15:41 2017 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=7d55d560

WIP: Add an updates step to stage3 just before the pre-clean step

Can be used to correct an issue with the stage that hats the precean step.

 catalyst/base/stagebase.py          | 16 ++++++++++++++++
 catalyst/targets/stage3.py          |  9 +++++++++
 targets/stage3/stage3-controller.sh |  4 ++++
 targets/stage3/stage3-updates.sh    | 10 ++++++++++
 4 files changed, 39 insertions(+)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 7a41973c..63a577a0 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -882,6 +882,22 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			if "snapcache" in self.settings["options"]:
 				self.snapcache_lock.unlock()
 
+	def update_stage(self):
+		if "autoresume" in self.settings["options"] \
+			and self.resume.is_enabled("update_stage"):
+			log.notice('Resume point detected, skipping update_stage operation...')
+		else:
+			if self.settings["update_stage_command"]:
+				try:
+					if os.path.exists(self.settings["controller_file"]):
+						cmd([self.settings['controller_file'], 'update_stage'],
+							env=self.env)
+						self.resume.enable("update_stage")
+
+				except:
+					self.unbind()
+					raise CatalystError("Build failed, could not execute update_stage")
+
 	def config_profile_link(self):
 		if "autoresume" in self.settings["options"] \
 			and self.resume.is_enabled("config_profile_link"):

diff --git a/catalyst/targets/stage3.py b/catalyst/targets/stage3.py
index f0831932..1120349f 100644
--- a/catalyst/targets/stage3.py
+++ b/catalyst/targets/stage3.py
@@ -14,6 +14,7 @@ class stage3(StageBase):
 	def __init__(self,spec,addlargs):
 		self.required_values=[]
 		self.valid_values=[]
+		self.valid_values.extend(["update_stage_command"])
 		StageBase.__init__(self,spec,addlargs)
 
 	def set_portage_overlay(self):
@@ -24,5 +25,13 @@ class stage3(StageBase):
 				"If you break it, you buy it.  Don't complain to us about it.\n"
 				"Don't say we did not warn you.")
 
+	def set_action_sequence(self):
+		"""Set basic stage1, 2, 3 action sequences"""
+		self.settings["action_sequence"] = ["unpack", "unpack_snapshot",
+				"setup_confdir", "portage_overlay",
+				"base_dirs", "bind", "chroot_setup", "setup_environment",
+				"run_local", "update_stage", "preclean", "unbind", "clean"]
+		self.set_completion_action_sequences()
+
 	def set_cleanables(self):
 		StageBase.set_cleanables(self)

diff --git a/targets/stage3/stage3-controller.sh b/targets/stage3/stage3-controller.sh
index df1479ea..ff958d67 100755
--- a/targets/stage3/stage3-controller.sh
+++ b/targets/stage3/stage3-controller.sh
@@ -15,6 +15,10 @@ case $1 in
 		exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-chroot.sh
 	;;
 
+	update_stage)
+		exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-updates.sh
+	;;
+
 	preclean)
 		exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-preclean-chroot.sh
 	;;

diff --git a/targets/stage3/stage3-updates.sh b/targets/stage3/stage3-updates.sh
new file mode 100644
index 00000000..1b376de5
--- /dev/null
+++ b/targets/stage3/stage3-updates.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+# Update stage3 (rebuilds, etc. needed to fix emerge complaints)
+if [ -n "${clst_update_stage_command}" ]; then
+	echo "Updating stage..."
+	${clst_update_stage_command}
+else
+	echo "Skipping seed stage update..."
+fi
+


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-29 17:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-29 17:21 [gentoo-commits] proj/catalyst:pending commit in: catalyst/base/, catalyst/targets/, targets/stage3/ Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox