logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>
commit: 9ed4ae9a598fbd818929b395f0f4b4215dd848d7
parent 3fd101e70a9ecf5e26540a3ef60fbc46f27e70c2
Author: Gábor Stefanik <netrolller.3d@gmail.com>
Date:   Sat, 23 Dec 2023 07:11:31 +0100

Support reusing existing directory for multipass bootstrapping

Diffstat:

Mlib/generator.py10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/generator.py b/lib/generator.py @@ -32,6 +32,13 @@ class Generator(): self.tmp_dir = None self.external_dir = None + def reuse(self, tmpdir): + """ + Reuse a previously prepared bwrap environment for further stages. + """ + self.tmp_dir = tmpdir.path + self.external_dir = os.path.join(self.tmp_dir, 'external') + def prepare(self, tmpdir, using_kernel=False, kernel_bootstrap=False, target_size=0): """ Prepare basic media of live-bootstrap. @@ -39,8 +46,7 @@ class Generator(): / -- contains seed to allow steps to be built, containing custom scripts and stage0-posix """ - self.tmp_dir = tmpdir.path - self.external_dir = os.path.join(self.tmp_dir, 'external') + self.reuse(tmpdir) # We use ext3 here; ext4 actually has a variety of extensions that # have been added with varying levels of recency