|
FlatImage
A configurable Linux containerization system
|
Manages external DwarFS layer files and directories for the filesystem controller. More...
#include <layers.hpp>
Public Member Functions | |
| Value< void > | push (fs::path const &path) |
| Adds a layer from a file or directory path. | |
| Value< void > | push_from_var (std::string_view var) |
| Loads layers from a colon-separated environment variable. | |
| std::vector< Layer > const & | get_layers () const |
| Retrieves the collected layer file paths with offsets. | |
| void | push_binary (fs::path const &path_file_binary, uint64_t offset) |
| Scans a binary file for embedded DwarFS filesystems. | |
Manages external DwarFS layer files and directories for the filesystem controller.
Provides a unified interface for collecting layer files from both individual file paths and directories. Supports the FIM_LAYERS environment variable which accepts a colon-separated list of paths that can be files or directories.
Directory Scanning:
File Processing:
Definition at line 59 of file layers.hpp.
|
inline |
Retrieves the collected layer file paths with offsets.
Returns the final list of validated layer files with their offsets in the order they were added. This is used by the filesystem controller to mount layers sequentially.
Definition at line 174 of file layers.hpp.
|
inlinenodiscard |
Adds a layer from a file or directory path.
Automatically detects whether the path is a file or directory and processes accordingly:
| path | Filesystem path (file or directory) |
Definition at line 119 of file layers.hpp.
|
inline |
Scans a binary file for embedded DwarFS filesystems.
Reads a binary file from the given offset, looking for concatenated DwarFS filesystems. Each filesystem is prefixed with an 8-byte size field. Appends found filesystems to the layers collection with their respective offsets.
Format:
| path_file_binary | Path to the binary file to scan |
| offset | Initial offset in bytes where scanning begins |
Definition at line 195 of file layers.hpp.
|
inlinenodiscard |
Loads layers from a colon-separated environment variable.
Processes environment variables like FIM_LAYERS which contain colon-separated paths. Each path can be either a file or directory. Performs shell expansion on variable values before processing.
Processing Steps:
| var | Name of environment variable to read (e.g., "FIM_LAYERS") |
Definition at line 148 of file layers.hpp.