public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Matt Turner" <mattst88@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/catalyst:pending/mattst88 commit in: catalyst/base/, catalyst/targets/
Date: Thu, 29 Oct 2020 16:14:26 +0000 (UTC)	[thread overview]
Message-ID: <1603988027.56b60e41c674e4ad4abc56fba86d5dceaf962231.mattst88@gentoo> (raw)

commit:     56b60e41c674e4ad4abc56fba86d5dceaf962231
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 29 03:08:04 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Thu Oct 29 16:13:47 2020 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=56b60e41

catalyst: Split action_sequence into prepare/build/finish

We want to run the "build" sequence in a different mount namespace from
the "prepare" and "finish" sequences, so this splits action_sequence
into those groupings.

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 catalyst/base/stagebase.py        | 24 +++++++++++++++---------
 catalyst/targets/embedded.py      |  6 +++++-
 catalyst/targets/livecd_stage1.py |  6 +++++-
 catalyst/targets/livecd_stage2.py | 10 +++++++---
 catalyst/targets/netboot.py       |  6 +++++-
 catalyst/targets/stage1.py        | 12 ++++++------
 catalyst/targets/stage4.py        |  6 +++++-
 7 files changed, 48 insertions(+), 22 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 46b7c59c..75c84baa 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -64,7 +64,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
             "portage_overlay",
             "portage_prefix",
         ])
-        self.action_sequence = []
+        self.prepare_sequence = []
+        self.build_sequence = []
+        self.finish_sequence = []
 
         self.set_valid_build_kernel_vars(addlargs)
         TargetBase.__init__(self, myspec, addlargs)
@@ -478,36 +480,40 @@ class StageBase(TargetBase, ClearBase, GenBase):
         Or it calls the normal set_action_sequence() for the target stage.
         """
         if "purgeonly" in self.settings["options"]:
-            self.action_sequence.append("remove_chroot")
+            self.build_sequence.append("remove_chroot")
             return
         self.set_action_sequence()
 
     def set_action_sequence(self):
         """Set basic stage1, 2, 3 action sequences"""
-        self.action_sequence.extend([
+        self.prepare_sequence.extend([
             "unpack",
             "setup_confdir",
             "portage_overlay",
+        ])
+        self.build_sequence.extend([
             "bind",
             "chroot_setup",
             "setup_environment",
             "run_local",
             "preclean",
             "unbind",
+        ])
+        self.finish_sequence.extend([
             "clean",
         ])
         self.set_completion_action_sequences()
 
     def set_completion_action_sequences(self):
         if "fetch" not in self.settings["options"]:
-            self.action_sequence.append("capture")
+            self.finish_sequence.append("capture")
         if "keepwork" in self.settings["options"]:
-            self.action_sequence.append("clear_autoresume")
+            self.finish_sequence.append("clear_autoresume")
         elif "seedcache" in self.settings["options"]:
-            self.action_sequence.append("remove_autoresume")
+            self.finish_sequence.append("remove_autoresume")
         else:
-            self.action_sequence.append("remove_autoresume")
-            self.action_sequence.append("remove_chroot")
+            self.finish_sequence.append("remove_autoresume")
+            self.finish_sequence.append("remove_chroot")
 
     def set_use(self):
         use = self.settings["spec_prefix"] + "/use"
@@ -1381,7 +1387,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
             self.purge()
 
         failure = False
-        for x in self.action_sequence:
+        for x in self.prepare_sequence + self.build_sequence + self.finish_sequence:
             log.notice('--- Running action sequence: %s', x)
             sys.stdout.flush()
             try:

diff --git a/catalyst/targets/embedded.py b/catalyst/targets/embedded.py
index 75eb68e4..1314ce7c 100644
--- a/catalyst/targets/embedded.py
+++ b/catalyst/targets/embedded.py
@@ -41,11 +41,13 @@ class embedded(StageBase):
         StageBase.__init__(self, spec, addlargs)
 
     def set_action_sequence(self):
-        self.action_sequence.extend([
+        self.prepare_sequence.extend([
             "unpack",
             "config_profile_link",
             "setup_confdir",
             "portage_overlay",
+        ])
+        self.build_sequence.extend([
             "bind",
             "chroot_setup",
             "setup_environment",
@@ -55,6 +57,8 @@ class embedded(StageBase):
             "fsscript",
             "unmerge",
             "unbind",
+        ])
+        self.finish_sequence.extend([
             "remove",
             "empty",
             "clean",

diff --git a/catalyst/targets/livecd_stage1.py b/catalyst/targets/livecd_stage1.py
index 9dbfa506..81367053 100644
--- a/catalyst/targets/livecd_stage1.py
+++ b/catalyst/targets/livecd_stage1.py
@@ -23,16 +23,20 @@ class livecd_stage1(StageBase):
         StageBase.__init__(self, spec, addlargs)
 
     def set_action_sequence(self):
-        self.action_sequence.extend([
+        self.prepare_sequence.extend([
             "unpack",
             "config_profile_link",
             "setup_confdir",
             "portage_overlay",
+        ])
+        self.build_sequence.extend([
             "bind",
             "chroot_setup",
             "setup_environment",
             "build_packages",
             "unbind",
+        ])
+        self.finish_sequence.extend([
             "clean",
         ])
         self.set_completion_action_sequences()

diff --git a/catalyst/targets/livecd_stage2.py b/catalyst/targets/livecd_stage2.py
index c9b5ce08..f6c14919 100644
--- a/catalyst/targets/livecd_stage2.py
+++ b/catalyst/targets/livecd_stage2.py
@@ -87,11 +87,13 @@ class livecd_stage2(StageBase):
                                     print_traceback=True)
 
     def set_action_sequence(self):
-        self.action_sequence.extend([
+        self.prepare_sequence.extend([
             "unpack",
             "config_profile_link",
             "setup_confdir",
             "portage_overlay",
+        ])
+        self.build_sequence.extend([
             "bind",
             "chroot_setup",
             "setup_environment",
@@ -99,7 +101,7 @@ class livecd_stage2(StageBase):
             "build_kernel"
         ])
         if "fetch" not in self.settings["options"]:
-            self.action_sequence.extend([
+            self.build_sequence.extend([
                 "bootloader",
                 "preclean",
                 "livecd_update",
@@ -108,6 +110,8 @@ class livecd_stage2(StageBase):
                 "rcupdate",
                 "unmerge",
                 "unbind",
+            ])
+            self.finish_sequence.extend([
                 "remove",
                 "empty",
                 "clean",
@@ -115,4 +119,4 @@ class livecd_stage2(StageBase):
                 "setup_overlay",
                 "create_iso",
             ])
-        self.action_sequence.append("clear_autoresume")
+        self.finish_sequence.append("clear_autoresume")

diff --git a/catalyst/targets/netboot.py b/catalyst/targets/netboot.py
index e5c6d43c..9a0a4156 100644
--- a/catalyst/targets/netboot.py
+++ b/catalyst/targets/netboot.py
@@ -160,11 +160,13 @@ class netboot(StageBase):
         self.resume.enable("empty")
 
     def set_action_sequence(self):
-        self.action_sequence.extend([
+        self.prepare_sequence.extend([
             "unpack",
             "config_profile_link",
             "setup_confdir",
             "portage_overlay",
+        ])
+        self.build_sequence.extend([
             "bind",
             "chroot_setup",
             "setup_environment",
@@ -177,6 +179,8 @@ class netboot(StageBase):
             "remove",
             "empty",
             "unbind",
+        ])
+        self.finish_sequence.extend([
             "clean",
             "clear_autoresume",
         ])

diff --git a/catalyst/targets/stage1.py b/catalyst/targets/stage1.py
index 89b30fe1..be3eae93 100644
--- a/catalyst/targets/stage1.py
+++ b/catalyst/targets/stage1.py
@@ -87,15 +87,15 @@ class stage1(StageBase):
         chroot for re-use in stage2 without the need to unpack it.
         '''
         if "fetch" not in self.settings["options"]:
-            self.action_sequence.append("capture")
+            self.finish_sequence.append("capture")
         if "keepwork" in self.settings["options"]:
-            self.action_sequence.append("clear_autoresume")
+            self.finish_sequence.append("clear_autoresume")
         elif "seedcache" in self.settings["options"]:
-            self.action_sequence.append("remove_autoresume")
-            self.action_sequence.append("clean_stage1")
+            self.finish_sequence.append("remove_autoresume")
+            self.finish_sequence.append("clean_stage1")
         else:
-            self.action_sequence.append("remove_autoresume")
-            self.action_sequence.append("remove_chroot")
+            self.finish_sequence.append("remove_autoresume")
+            self.finish_sequence.append("remove_chroot")
 
     def clean_stage1(self):
         '''seedcache is enabled, so salvage the /tmp/stage1root,

diff --git a/catalyst/targets/stage4.py b/catalyst/targets/stage4.py
index bb20be79..78a5c780 100644
--- a/catalyst/targets/stage4.py
+++ b/catalyst/targets/stage4.py
@@ -39,11 +39,13 @@ class stage4(StageBase):
         self.settings["cleanables"].remove('/etc/resolv.conf')
 
     def set_action_sequence(self):
-        self.action_sequence.extend([
+        self.prepare_sequence.extend([
             "unpack",
             "config_profile_link",
             "setup_confdir",
             "portage_overlay",
+        ])
+        self.build_sequence.extend([
             "bind",
             "chroot_setup",
             "setup_environment",
@@ -56,6 +58,8 @@ class stage4(StageBase):
             "rcupdate",
             "unmerge",
             "unbind",
+        ])
+        self.finish_sequence.extend([
             "remove",
             "empty",
             "clean",


             reply	other threads:[~2020-10-29 16:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 16:14 Matt Turner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-01-28  1:54 [gentoo-commits] proj/catalyst:pending/mattst88 commit in: catalyst/base/, catalyst/targets/ Matt Turner
2021-01-18 19:53 Matt Turner
2021-01-18 19:53 Matt Turner
2021-01-18 19:53 Matt Turner
2020-10-29 19:05 Matt Turner
2020-10-29 16:34 Matt Turner
2020-10-29 16:14 Matt Turner
2020-10-29 16:14 Matt Turner
2020-10-29 16:04 Matt Turner
2020-10-29 16:04 Matt Turner
2020-10-29 16:04 Matt Turner
2020-10-29 15:47 Matt Turner
2020-10-29 15:47 Matt Turner
2020-10-29 15:47 Matt Turner
2020-10-29  3:33 Matt Turner
2020-10-29  3:33 Matt Turner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1603988027.56b60e41c674e4ad4abc56fba86d5dceaf962231.mattst88@gentoo \
    --to=mattst88@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox