craft_parts.overlays.overlay_manager module¶
Overlay mount operations and package installation helpers.
- class craft_parts.overlays.overlay_manager.LayerMount(overlay_manager, top_part, pkg_cache=True)[source]¶
Bases:
object
Mount 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)[source]¶
Bases:
object
Execution 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.
- property base_layer_dir: Path | None¶
Return the path to the base layer, if any.
- download_packages(package_names)[source]¶
Download packages and populate the overlay package cache.
- Parameters:
package_names (
list
[str
]) – The list of packages to download.- Return type:
None
- install_packages(package_names)[source]¶
Install packages on the overlay area using chroot.
- Parameters:
package_names (
list
[str
]) – The list of packages to install.- Return type:
None
- mount_layer(part, *, pkg_cache=False)[source]¶
Mount the overlay step layer stack up to the given part.
- Parameters:
part (
Part
) – The part corresponding to the topmost layer to mount.cache (pkg) – Whether the package cache layer is enabled.
pkg_cache (
bool
)
- Return type:
None
- class craft_parts.overlays.overlay_manager.PackageCacheMount(overlay_manager)[source]¶
Bases:
object
Mount and umount the overlay package cache.
- Parameters:
overlay_manager (
OverlayManager
) – The overlay manager.