Module cpio

Source
Expand description

CPIO (Copy In/Out) filesystem implementation for the kernel.

This module provides a read-only implementation of the CPIO archive format, typically used for the initial ramdisk (initramfs). The CPIO format is a simple archive format that stores files sequentially with headers containing metadata.

§Features

  • Parsing of CPIO archives in the “new ASCII” format (magic “070701”)
  • Read-only access to files stored in the archive
  • Directory traversal and metadata retrieval

§Limitations

  • Write operations are not supported as the filesystem is read-only
  • Block operations are not implemented since CPIO is not a block-based filesystem

§Components

  • CpiofsEntry: Represents an individual file or directory within the archive
  • Cpiofs: The main filesystem implementation handling mounting and file operations
  • CpiofsFileHandle: Handles file read operations and seeking
  • CpiofsDriver: Driver that creates CPIO filesystems from memory areas

§Usage

The CPIO filesystem is typically created from a memory region containing the archive data, such as an initramfs loaded by the bootloader:

let cpio_driver = CpiofsDriver;
let fs = cpio_driver.create_from_memory(&initramfs_memory_area)?;
vfs_manager.register_filesystem(fs)?;

Structs§

Cpiofs
Structure representing the entire Initramfs
CpiofsDriver
Driver for CPIO-format filesystems (initramfs)
CpiofsEntry
Structure representing an Initramfs entry
CpiofsFileHandle 🔒

Statics§

__DRIVER_INITCALL__ 🔒

Functions§

register_driver 🔒