craft_parts.overlays.overlay_manager module¶
Overlay mount operations and package installation helpers.
- class craft_parts.overlays.overlay_manager.ChrootMount(overlay_manager, top_part, pkg_cache=True)¶
Bases:
LayerMountContext manager that mounts an overlay for step processing and runs code inside a chroot environment.
- Parameters:
overlay_manager (
OverlayManager)top_part (
Part)pkg_cache (
bool)
- class craft_parts.overlays.overlay_manager.LayerMount(overlay_manager, top_part, pkg_cache=True)¶
Bases:
objectMount the overlay layer stack for step processing.
- Parameters:
overlay_manager (
OverlayManager) – The overlay manager.top_part (
Part) – The topmost part to mount.pkg_cache (
bool) – Whether to mount the overlay package cache.
- class craft_parts.overlays.overlay_manager.OverlayManager(*, project_info, part_list, base_layer_dir, cache_level, use_host_sources=False)¶
Bases:
objectExecution time overlay mounting and package installation.
- Parameters:
project_info (
ProjectInfo) – The project information.part_list (
list[Part]) – A list of all parts in the project.base_layer_dir (
Path|None) – The directory containing the overlay base, or None if the project doesn’t use overlay parameters.cache_level (
int) – The number of part layers to be mounted before the package cache.use_host_sources (
bool) – Configure chroot to use package sources from the host environment.
- download_packages(package_names, *, include_recommends=False)¶
Download packages and populate the overlay package cache.
- install_packages(package_names, *, include_recommends=False)¶
Install packages on the overlay area using chroot.
- mount_layer(part, *, pkg_cache=False)¶
Mount the overlay step layer stack up to the given part.
- refresh_packages_list()¶
Update the list of available packages in the overlay system.
- Return type:
- run(target, *args, **kwargs)¶
Run the given callable inside the chroot environment.
- class craft_parts.overlays.overlay_manager.PackageCacheMount(overlay_manager)¶
Bases:
objectMount and umount the overlay package cache.
- Parameters:
overlay_manager (
OverlayManager) – The overlay manager.
- download_packages(package_names, *, include_recommends=False)¶
Download the specified packages to the local system.