[volume_image]: Introduce MTD Writer.

Small layer on top of ftl-mtd library for writing directly to raw nand
in linux. This combined with block writer added previously adds the
remainig bits for replacing pave.

This test is only meaningful in linux for now, since there are no other
use cases at the moment for paving directly to raw nand.

The test verifies success of the mtd writer. In order to reproduce
outside of CQ users need to create a ram mtd device and grant permission
to users.

Command to generate the mtd device.
sudo modprobe nandsim id_bytes=0x2c,0xdc,0x90,0xa6,0x54,0x0 badblocks=5

Then
chmod u=rw,og=rw /dev/mtd0

Added ftl_io.h which provides an interface 'FtlHandle' to generate
readers and writes to a FTL instance. In order to load a new instance,
the volume in the handle must be flushed, so data is persisted.

Moved the InMemoryNdm and InMemoryRawNand to a shared test header to
test the ftl_io constructs. Then provided a MTD layer, which
instantiates a FTL on top of a MTD device. Added to tests:

1) Verifies that arbitrary content is read back correctly.
2) Write a FVM, then write the same FVM to a file, and do a block by
block comparison of the contents. This is a paranoid use case.

Test: storage-volume-image-test
Change-Id: I5c33ee55934442e334dccf6e0dc6ed16725dae5f
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/512775
Commit-Queue: Gianfranco Valentino <gevalentino@google.com>
Reviewed-by: James Sullivan <jfsulliv@google.com>
12 files changed
tree: 3edc4382363fc13640cfabfd30dfe0716187ff5e
  1. boards/
  2. build/
  3. buildtools/
  4. bundles/
  5. docs/
  6. examples/
  7. garnet/
  8. products/
  9. scripts/
  10. sdk/
  11. src/
  12. third_party/
  13. tools/
  14. zircon/
  15. .clang-format
  16. .clang-tidy
  17. .git-blame-ignore-revs
  18. .gitattributes
  19. .gitignore
  20. .gn
  21. .style.yapf
  22. AUTHORS
  23. BUILD.gn
  24. CODE_OF_CONDUCT.md
  25. CONTRIBUTING.md
  26. LICENSE
  27. OWNERS
  28. PATENTS
  29. README.md
  30. rustfmt.toml
README.md

Fuchsia

Pink + Purple == Fuchsia (a new operating system)

What is Fuchsia?

Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.

Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.

Read more about Fuchsia's principles.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.