FlatImage
A configurable Linux containerization system
Loading...
Searching...
No Matches
ns_layers Namespace Reference

Filesystem layer management command implementation. More...

Enumerations

enum class  CommitMode { BINARY , LAYER , FILE }
 Commit changes into a novel layer (binary/layer/file modes) More...
 

Functions

Value< void > create (fs::path const &path_dir_src, fs::path const &path_file_dst, fs::path const &path_file_list, uint64_t compression_level)
 Creates a layer (filesystem) from a source directory.
 
Value< void > add (fs::path const &path_file_binary, fs::path const &path_file_layer)
 Includes a filesystem in the target FlatImage.
 
Value< uint64_t > find_next_layer_number (fs::path const &path_dir_layers)
 Finds the next available layer number in the layers directory.
 
Value< void > commit (fs::path const &path_file_binary, fs::path const &path_dir_src, fs::path const &path_file_layer_tmp, fs::path const &path_file_list_tmp, uint32_t layer_compression_level, CommitMode mode, std::optional< fs::path > const &path_dst=std::nullopt)
 
void list (ns_filesystems::ns_layers::Layers const &layers)
 Lists all layers in the format index:offset:size:path.
 

Detailed Description

Filesystem layer management command implementation.

Implements the fim-layer command for creating, listing, and managing DwarFS compressed filesystem layers. Supports layer commit operations to snapshot the current writable overlay into a compressed read-only layer, and layer enumeration to display all available layers.

Enumeration Type Documentation

◆ CommitMode

enum class ns_layers::CommitMode
strong

Commit changes into a novel layer (binary/layer/file modes)

Parameters
path_file_binaryPath to the FlatImage binary
path_dir_srcSource directory with overlay changes
path_file_layer_tmpTemporary layer file path
path_file_list_tmpTemporary file list path
layer_compression_levelCompression level for the layer
path_dir_layersPath to the layers directory (for layer mode)
modeCommit mode (binary, layer, or file)
path_file_dstDestination path (only for file mode)
Returns
Value<void> Nothing on success, or the respective error

Definition at line 189 of file layers.hpp.

Function Documentation

◆ add()

Value< void > ns_layers::add ( fs::path const & path_file_binary,
fs::path const & path_file_layer )
inlinenodiscard

Includes a filesystem in the target FlatImage.

Parameters
path_file_binaryPath to the target FlatImage in which to include the filesystem
path_file_layerPath to the filesystem to include in the FlatImage
Returns
Value<void> Nothing on success, or the respective error

Definition at line 127 of file layers.hpp.

Here is the caller graph for this function:

◆ commit()

Value< void > ns_layers::commit ( fs::path const & path_file_binary,
fs::path const & path_dir_src,
fs::path const & path_file_layer_tmp,
fs::path const & path_file_list_tmp,
uint32_t layer_compression_level,
CommitMode mode,
std::optional< fs::path > const & path_dst = std::nullopt )
inlinenodiscard

Definition at line 191 of file layers.hpp.

◆ create()

Value< void > ns_layers::create ( fs::path const & path_dir_src,
fs::path const & path_file_dst,
fs::path const & path_file_list,
uint64_t compression_level )
inlinenodiscard

Creates a layer (filesystem) from a source directory.

Parameters
path_dir_srcPath to the source directory
path_file_dstPath to the output filesystem file
path_file_listPath to a temporary file to store the list of files to compress
compression_levelThe compression level to create the filesystem
Returns
Value<void> Nothing on success, or the respective error

Definition at line 50 of file layers.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_next_layer_number()

Value< uint64_t > ns_layers::find_next_layer_number ( fs::path const & path_dir_layers)
inlinenodiscard

Finds the next available layer number in the layers directory.

Parameters
path_dir_layersPath to the layers directory
Returns
uint64_t Next available layer number (0-indexed)

Definition at line 154 of file layers.hpp.

◆ list()

void ns_layers::list ( ns_filesystems::ns_layers::Layers const & layers)
inline

Lists all layers in the format index:offset:size:path.

Parameters
layersThe Layers object containing all filesystem layers

Definition at line 274 of file layers.hpp.

Here is the call graph for this function:
Here is the caller graph for this function: