Add example/mkfs.rs to demonstorate how to use the library and
make it easier to use it for debugging with existing e2fsprogs
tools.
BUG=b:329359333
TEST=cargo run --example mkfs -- --path ./foo.ext2
Change-Id: I98966d317f053794607b722f38493568d0d96ced
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5404439
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Add a logic to create a valid superblock.
This crate is supposed to be used for implementing virito-pmem-ext2,
which is a virtio-pmem where ext2 file system is constructed at
boot time. See go/virtio-pmem-ext2 for the details.
BUG=b:329359333
TEST=cargo test
Change-Id: Ib86c0c8e9562e885266d3b321f9f2e302581b90a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5404370
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>