fstool 0.3.0

Build disk images and filesystems (ext2/3/4, MBR, GPT) from a directory tree and TOML spec, in the spirit of genext2fs.
Documentation
[package]
name = "fstool"
version = "0.3.0"
edition = "2024"
rust-version = "1.85"
description = "Build disk images and filesystems (ext2/3/4, MBR, GPT) from a directory tree and TOML spec, in the spirit of genext2fs."
license = "MIT"
repository = "https://github.com/KarpelesLab/fstool"
readme = "README.md"
keywords = ["filesystem", "ext4", "ext2", "gpt", "image"]
categories = ["filesystem", "command-line-utilities"]

[lib]
name = "fstool"
path = "src/lib.rs"

[[bin]]
name = "fstool"
path = "src/bin/fstool/main.rs"

[features]
# Compression codecs for SquashFS reads and `.tar.<algo>` streaming I/O.
# Enabled by default; disable with `default-features = false` and pick
# a subset if you want to slim the binary or avoid a C-bundled build.
default = ["gzip", "xz", "lzma", "lz4", "zstd", "lzo", "dmg-bzip2", "dmg-lzfse"]
gzip = ["dep:flate2"]
xz = ["dep:lzma-rs"]
lzma = ["dep:lzma-rs"]
lz4 = ["dep:lz4_flex"]
zstd = ["dep:zstd"]
lzo = ["dep:minilzo-rs"]
# DMG chunk codecs beyond the always-available zero / raw / zlib / ADC set.
# bzip2-rs is a pure-Rust decoder, lzfse_rust is a pure-Rust LZFSE
# decoder; both gated so a slim build can drop them.
dmg-bzip2 = ["dep:bzip2-rs"]
dmg-lzfse = ["dep:lzfse_rust"]

[dependencies]
thiserror = "2"
log = "0.4"
uuid = { version = "1", features = ["v4"] }
crc32fast = "1"
clap = { version = "4", features = ["derive"] }
serde = { version = "1.0.228", features = ["derive"] }
toml = "1.1.2"
crc32c = "0.6.8"
# CP949 (Korean) ↔ UTF-8 for the GRF backend (Gravity Ragnarok archives
# store filenames in CP949). encoding_rs's `EUC_KR` label is the WHATWG
# alias that covers CP949 — the spec mapping is identical in practice.
encoding_rs = "0.8"
# Used to spool compressed tar streams to a temp file when reading or
# writing `.tar.gz` / `.tar.zst` / etc., so we don't have to hold the
# whole archive in RAM. Cheap dep; already in dev-dependencies.
tempfile = "3"

# Compression codecs — all optional and feature-gated. Pure-rust where
# possible (flate2 via miniz_oxide, lz4_flex, lzma-rs); zstd and lzo
# pull in bundled C source.
flate2 = { version = "1", optional = true, default-features = false, features = ["rust_backend"] }
lzma-rs = { version = "0.3", optional = true }
lz4_flex = { version = "0.11", optional = true, default-features = false, features = ["std", "safe-encode", "safe-decode", "frame"] }
zstd = { version = "0.13", optional = true }
"minilzo-rs" = { version = "0.6", optional = true }

# DMG codec deps. bzip2-rs is decode-only pure Rust; lzfse_rust is a
# pure-Rust LZFSE encoder + decoder. Both opt-in via dmg-bzip2 /
# dmg-lzfse features so a build without DMG support can drop them.
bzip2-rs = { version = "0.1", optional = true }
lzfse_rust = { version = "0.2", optional = true }

# Needed on Unix for the BLKGETSIZE64 / DKIOCGETBLOCKCOUNT ioctls used to
# query the size of a block device, plus the O_EXCL open flag that refuses
# devices with a mounted partition.
[target.'cfg(unix)'.dependencies]
libc = "0.2"

[dev-dependencies]
tempfile = "3"
env_logger = "0.11"