Expand description
Ext4 filesystem image creation via libext2fs — static FFI bindings and safe Rust API.
§Architecture
sys— Raw FFI bindings (auto-generated bybindgen).Filesystem— RAII wrapper aroundext2_filsyswith 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§
Structs§
- Create
Options - Options for creating a new ext4 filesystem.
- Filesystem
- RAII wrapper around an
ext2_filsyshandle.
Enums§
- Block
Size - Block size for an ext4 filesystem.
- Error
- Errors returned by ext4 operations.
- File
Type - 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>.