1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! Container rootfs management and layer merging.
//!
//! This module provides functionality for managing container root filesystems and merging OCI image layers.
//! It supports two layer merging strategies:
//!
//! 1. Copy-based merging (default)
//! - Works on all platforms
//! - Handles OCI whiteout files
//! - Preserves file permissions
//! - More disk space usage
//!
//! 2. Overlayfs-based merging (Linux-only, experimental)
//! - Enabled with `overlayfs` feature flag
//! - More efficient storage usage
//! - Falls back to copy-merge on failure
//! - Not recommended for production use yet
//!
//! # Examples
//!
//! ```no_run
//! use std::path::Path;
//! use monocore::oci::rootfs;
//!
//! # async fn example() -> anyhow::Result<()> {
//! // Merge layers into rootfs
//! rootfs::merge(
//! Path::new("/path/to/oci"),
//! Path::new("/path/to/rootfs"),
//! "alpine:latest"
//! ).await?;
//!
//! // Copy rootfs to new location
//! rootfs::copy(
//! Path::new("/path/to/source"),
//! Path::new("/path/to/dest"),
//! true // Process whiteout files
//! ).await?;
//! # Ok(())
//! # }
//! ```
//!
//! # Feature Flags
//!
//! - `overlayfs` - Enables experimental overlayfs support on Linux
//! - Not recommended for production use
//! - Does not support OCI whiteout files
//! - May have permission issues
//! - Falls back to copy-based merge on failure
//! - Will be replaced by monofs in the future for a more robust solution
//--------------------------------------------------------------------------------------------------
// Exports
//--------------------------------------------------------------------------------------------------
pub use *;
pub use *;
pub use *;
pub use *;