aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2017-11-29 09:15:41 -0800
committerBrian Dolbec <dolsen@gentoo.org>2017-11-29 09:33:43 -0800
commit7d0d7fda6bdf8d2fe73a7623eba1b943bfabb9ce (patch)
tree7acc5f496408fb3661fc8a126cc60c3c0a876c5c
parentkmerge.sh: ensure bc is installed when kerncache is active (diff)
downloadcatalyst-7d0d7fda6bdf8d2fe73a7623eba1b943bfabb9ce.tar.gz
catalyst-7d0d7fda6bdf8d2fe73a7623eba1b943bfabb9ce.tar.bz2
catalyst-7d0d7fda6bdf8d2fe73a7623eba1b943bfabb9ce.zip
WIP: Add an updates step to stage3 just before the pre-clean steppending
Can be used to correct an issue with the stage that hats the precean step.
-rw-r--r--catalyst/base/stagebase.py16
-rw-r--r--catalyst/targets/stage3.py9
-rwxr-xr-xtargets/stage3/stage3-controller.sh4
-rw-r--r--targets/stage3/stage3-updates.sh10
4 files changed, 39 insertions, 0 deletions
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 7a41973..63a577a 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 f083193..1120349 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 df1479e..ff958d6 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 0000000..1b376de
--- /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
+