Skip to main content

Crate bux_e2fs

Crate bux_e2fs 

Source
Expand description

Ext4 filesystem image creation via libext2fs — static FFI bindings and safe Rust API.

§Architecture

  • sys — Raw FFI bindings (auto-generated by bindgen).
  • Filesystem — RAII wrapper around ext2_filsys with safe operations.
  • create_from_dir / inject_file — Convenience functions for common tasks.

§Quick Start

use std::path::Path;

let size = bux_e2fs::estimate_image_size(Path::new("/tmp/rootfs")).unwrap();
bux_e2fs::create_from_dir(
    Path::new("/tmp/rootfs"),
    Path::new("/tmp/image.raw"),
    size,
).unwrap();

Modules§

sys
Raw FFI bindings to libext2fs and [create_inode].

Structs§

CreateOptions
Options for creating a new ext4 filesystem.
Filesystem
RAII wrapper around an ext2_filsys handle.

Enums§

BlockSize
Block size for an ext4 filesystem.
Error
Errors returned by ext4 operations.
FileType
File type for directory entries (maps to EXT2_FT_* constants).

Functions§

create_from_dir
Creates an ext4 image populated from a host directory.
estimate_image_size
Estimates the required image size for a directory tree.
inject_file
Injects a single host file into an existing ext4 image.

Type Aliases§

Result
Convenience alias for std::result::Result<T, Error>.