commit: e28156df62eb77b89822e88eba9099a5b1ce229a Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> AuthorDate: Fri Dec 24 23:53:51 2021 +0000 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> CommitDate: Fri Dec 24 23:56:19 2021 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=e28156df
Add some markers in the code for myself Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org> catalyst/base/stagebase.py | 17 +++++++++++++++++ containers/config/chroot.toml | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 4a1b4eb6..a1042182 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -67,6 +67,7 @@ class StageBase(TargetBase, ClearBase, GenBase): "cflags", "common_flags", "compression_mode", + "container", "cxxflags", "decompressor_search_order", "fcflags", @@ -87,6 +88,9 @@ class StageBase(TargetBase, ClearBase, GenBase): self.setup_confdir, self.process_repos, ] + + # CO-MARK + # we need to make self.bind configurable here self.build_sequence = [ self.bind, self.chroot_setup, @@ -139,6 +143,7 @@ class StageBase(TargetBase, ClearBase, GenBase): else: raise CatalystError("Unknown host machine type " + host) + ## CO-MARK if setarch.get('if_build', '') == platform.machine(): chroot = f'setarch {setarch["arch"]} chroot' else: @@ -468,6 +473,7 @@ class StageBase(TargetBase, ClearBase, GenBase): "/tmp/*", ] + # CO-MARK def set_chroot_path(self): """ NOTE: the trailing slash has been removed @@ -895,6 +901,9 @@ class StageBase(TargetBase, ClearBase, GenBase): env=self.env) def bind(self): + # CO-MARK + # we need to be able to disable this step completely (e.g. bubblewrap, qemu-system) + # for x in [x for x in self.mount if self.mount[x]['enable']]: if str(self.mount[x]['source']) == 'config': raise CatalystError(f'"{x}" bind mount source is not configured') @@ -1012,6 +1021,10 @@ class StageBase(TargetBase, ClearBase, GenBase): raise CatalystError('Could not write %s: %s' % ( normpath(self.settings["chroot_path"] + self.settings["make_conf"]), e)) from e + + # CO-MARK + # here we need to copy in additional required files + self.resume.enable("chroot_setup") def write_make_conf(self, setup=True): @@ -1165,6 +1178,9 @@ class StageBase(TargetBase, ClearBase, GenBase): log.notice("Clearing portage_prefix target: %s", target) clear_path(target) + # CO-MARK + # clean up here additional support files (e.g. /linuxrc) + # Remove hacks that should *never* go into stages target = pjoin(self.settings["stage_path"], "etc/portage/patches") if os.path.exists(target): @@ -1353,6 +1369,7 @@ class StageBase(TargetBase, ClearBase, GenBase): chroot = command('chroot') bash = command('bash') + # CO-MARK log.notice("Entering chroot") try: cmd([chroot, self.settings['chroot_path'], bash, '-l'], diff --git a/containers/config/chroot.toml b/containers/config/chroot.toml index a766069c..b53d0648 100644 --- a/containers/config/chroot.toml +++ b/containers/config/chroot.toml @@ -10,12 +10,13 @@ setup_mounts = true # does catalyst have to provide process isolation (i.e. unshare)? # setup_namespaces = false - # do we need to copy files *beyond* the stage definition specific # ones into the isolated filesystem (e.g. /linuxrc)? # support_files = # do we need to convert the filesystem into an image file and back? +# note that making catalyst work with an image-based container / +# emulator will be very, very hard setup_image = false # image pack and unpack commands, if setup_image = true