Git Product home page Git Product logo

ext4-rs's Introduction

Status

Github CI crates.io

ext4-rs can extract the basic stat information, directory listings, and file content from real images generated by other tools, and by the Linux kernel.

This operates directly on partitions. To read actual disc images, probably need to handle partition tables. This can be accomplished with the bootsector crate.

All basic file types are represented: files, directories, symlinks, char and block devices, fifos and sockets. Hard links are not a type of thing that makes sense: the item is just in multiple directories.

Practical problems

  • No support for extended flags (e.g. immutable, append-only).
  • Probably contains overflows and fencepost errors, many of which Rust will translate to panics for you. At least, in debug mode.

Non-goals

This is not a filesystem driver. It does not support efficiently modifying real filesystems. Currently, it doesn't support modifying anything at all, but that may change.

I'm not especially interested in resource-constrained platforms: memory and IO are not used efficiently.

Changelog

  • 0.10.0: move to positioned_io2 over weird seeking; rust 1.59
  • 0.7.0: use rust 1.34 features to remove cast dependency
  • 0.6.0: use failure for error handling
  • 0.5.0: update bitflags for associated constants, and rename some public constants.
  • 0.4.1: fix for an infinite loop parsing directory entries

MSRV

Rust 1.59 (Debian Bookworm / edition = "2021") is supported, and checked by CI. Updating this is a semver bump.

Development

Tests

Some of the tests read generated image files. These images are not directly checked into git, and will be unpacked by build.rs. These files are apparently very large, but should take very little space. This requires a decent tar to be on the path.

These test assets can be rebuilt (on Linux, with root) by running ./extract-test-data --refresh.

License note

The code is licensed under the super-permissive MIT license.

However, a number of struct and bitfield definitions, and some maths expressions, are lifted directly from the Linux, or e2fsprogs, source code. These code-bases are under the GPLv2. I believe this to be fair use: these places are the documentation, and only interface definitions have been extracted, no code. I leave the final decision to you.

Thanks

This would have been practically impossible without the work a Djwong has done on the ext4 disk layout page on the kernel wiki. I believe this person is Darrick Wong. Thanks, man.

ext4-rs's People

Contributors

fauxfaux avatar xvilka avatar losynix avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.