Expand description
ISO Storage Management
Manages large ISO files that exceed the FAT32 4GB file size limit by splitting them across multiple “chunk” partitions. Each chunk is stored as a single file on a dedicated FAT32 partition.
§Architecture
┌─────────────────────────────────────────────────────────────────┐
│ GPT Disk Layout │
├────────┬────────┬────────┬────────┬────────┬────────┬──────────┤
│ ESP │ Chunk │ Chunk │ Chunk │ Chunk │ Chunk │ Free │
│ (EFI) │ 0 │ 1 │ 2 │ 3 │ 4 │ Space │
│ ~512MB │ ~4GB │ ~4GB │ ~4GB │ ~4GB │ <4GB │ │
└────────┴────────┴────────┴────────┴────────┴────────┴──────────┘§Manifest Format
Each ISO set has a manifest file stored on the ESP at /.iso/<name>.manifest:
MORPHEUS_ISO_MANIFEST_V1
name: ubuntu-24.04-desktop-amd64.iso
size: 6234567890
chunks: 3
sha256: <hash>
chunk_0: <partition_uuid> 4294967296
chunk_1: <partition_uuid> 4294967296
chunk_2: <partition_uuid> 1939600298§Usage
ⓘ
// Writing an ISO (during download)
let mut writer = ChunkWriter::new(block_io, &manifest)?;
writer.write_chunk_data(data_slice)?;
writer.finalize()?;
// Reading an ISO (during boot)
let reader = ChunkReader::new(block_io, &manifest)?;
let data = reader.read_range(offset, length)?;§Constraints
- Maximum chunk size: 4GB - 1 byte (FAT32 limit)
- Maximum chunks per ISO: 16 (fixed array)
- Chunk partition type: Linux filesystem GUID (for now)
- Each chunk partition is formatted as FAT32 with single file
Modules§
- adapter 🔒Block I/O Adapter for Chunked ISO Storage
- chunk 🔒Chunk information structures
- error 🔒ISO storage error types
- ISO9660 Integration
- manifest 🔒ISO Manifest Format
- reader 🔒Chunk Reader
- storage 🔒ISO Storage Manager
- writer 🔒Chunk Writer
Structs§
- Information about a single chunk partition
- Chunk reader for streaming ISO data
- Collection of chunks for a single ISO
- Streaming chunk writer
- Block I/O adapter for chunked ISO storage
- High-level helper to boot from a chunked ISO
- Simpler read interface for when you just need byte-level access
- Block I/O adapter that implements gpt_disk_io::BlockIo
- ISO storage entry (metadata only, no chunk data)
- ISO manifest structure
- Read context for passing to boot/kernel loader
- ISO storage manager
- Partition allocation request
Enums§
- Errors that can occur during ISO chunk operations
- Chunk writer state
Constants§
- Default chunk size (slightly under 4GB to allow for FAT32 overhead)
- Maximum file size that FAT32 supports (4GB - 1 byte)
- Manifest directory path on ESP
- Magic number for manifest files: “MXISO\x01\x00\x00”
- Maximum number of chunks per ISO (16 * 4GB = 64GB max ISO size)
- Maximum number of ISOs that can be tracked
- Maximum manifest size (header + 16 chunks)
Traits§
- Trait for block I/O operations (matches gpt_disk_io::BlockIo pattern)
Functions§
- Calculate number of chunks needed for a given ISO size
- Calculate total disk space needed for an ISO (with FAT32 overhead)