"--keep-baud 115200,57600,38400,9600 -")
-@contextlib.contextmanager
-def mount_cache_overlay(context: Context, cached: bool) -> Iterator[None]:
- if not context.config.incremental or not context.config.base_trees or context.config.overlay or cached:
- yield
- return
-
- d = context.workspace / "cache-overlay"
- with umask(~0o755):
- d.mkdir(exist_ok=True)
-
- with mount_overlay([context.root], d, context.root):
- yield
-
-
@contextlib.contextmanager
def mount_build_overlay(context: Context, volatile: bool = False) -> Iterator[Path]:
d = context.workspace / "build-overlay"
def save_cache(context: Context) -> None:
- if not context.config.incremental or context.config.overlay:
+ if not context.config.incremental or context.config.base_trees or context.config.overlay:
return
final, build, manifest = cache_tree_paths(context.config)
with complete_step("Installing cache copies"):
rmtree(final, sandbox=context.sandbox)
- # We only use the cache-overlay directory for caching if we have a base tree, otherwise we just
- # cache the root directory.
- if (context.workspace / "cache-overlay").exists():
- move_tree(
- context.workspace / "cache-overlay", final,
- use_subvolumes=context.config.use_subvolumes,
- sandbox=context.sandbox,
- )
- else:
- move_tree(
- context.root, final,
- use_subvolumes=context.config.use_subvolumes,
- sandbox=context.sandbox,
- )
+ move_tree(
+ context.root, final,
+ use_subvolumes=context.config.use_subvolumes,
+ sandbox=context.sandbox,
+ )
if need_build_overlay(context.config) and (context.workspace / "build-overlay").exists():
rmtree(build, sandbox=context.sandbox)
def have_cache(config: Config) -> bool:
- if not config.incremental or config.overlay:
+ if not config.incremental or config.base_trees or config.overlay:
return False
final, build, manifest = cache_tree_paths(config)
install_base_trees(context)
cached = reuse_cache(context)
- with mount_cache_overlay(context, cached):
- copy_repository_metadata(context)
+ copy_repository_metadata(context)
context.config.distribution.setup(context)
install_package_directories(context)
if not cached:
- with mount_cache_overlay(context, cached):
- install_skeleton_trees(context)
- install_distribution(context)
- run_prepare_scripts(context, build=False)
- install_build_packages(context)
- run_prepare_scripts(context, build=True)
- fixup_vmlinuz_location(context)
- run_depmod(context, cache=True)
+ install_skeleton_trees(context)
+ install_distribution(context)
+ run_prepare_scripts(context, build=False)
+ install_build_packages(context)
+ run_prepare_scripts(context, build=True)
+ fixup_vmlinuz_location(context)
+ run_depmod(context, cache=True)
save_cache(context)
reuse_cache(context)