How errornointernet/overmask works
Key Components to Include:
Core Components
• Input Block Device (e.g., /dev/sda)
• Overlay File Storage
• Mask File Storage
• NBD (Network Block Device) Interface
• Overmask Core Logic
Data Flow Architecture
a) Physical Layer:
• Overlay and mask files on the same level
b) Overmask Core Layer:
• Following modules (based on src/modes):
• Device Mode Handler
• Apply Mode Handler
• Clean Mode Handler
• Block Device Manager (from block_device.rs)
c) Interface Layer:
• NBD device interface (/dev/nbd*)
• CLI argument parser (from arguments.rs)
Interaction Flows
• Read Operations:
• Check mask file → If masked, read from overlay → If not masked, read from source
• Write Operations:
• Write to overlay file
• Update mask file
• NBD Interface:
• Connection to kernel NBD module
• Virtual device exposure
Design Elements
Use the following visual elements:
• Blue rectangles for storage components (block device, overlay file, mask file)
• Green rectangles for processing components (overmask core logic)
• Yellow rectangles for interface components (NBD, CLI)
Additional Details
Annotations for:
• Required kernel module (nbd)
• File permissions and system requirements
• Key configuration points
Example Layout:
[User/System] ←→ [CLI Interface]
• ↕
**[NBD Device (/dev/nbd*)]**
• ↕
[Overmask Core Logic]
• ↙ ↓ ↘
[Mask] [Overlay] [Source Block Device]
Implementation Notes
• The non-destructive nature of the overlay system
• The separation between source device and overlay storage
• The role of the mask file in tracking modifications
• The virtual device interface provided by NBD