Git Product home page Git Product logo

mkfs's Introduction

mkfs

mkfs written in pure Rust.

Motivation

I needed a library that could work with file systems in no_std environments for my kernel. Additionally, for testing, I needed a library that I could use easily to create and edit new file system images, and that I could use in my build.rs file. Those things can be done by mke2fs. However, mke2fs is not available out of the box on all platforms, so I opted for something that can be integrated in the cargo build process.

Supported file systems

  • ext2 (in progress)
  • ext3
  • ext4
  • and more...

Features

  • Command line tool to create and edit file system images
  • Usable as library (see below)
  • Compatibility with no_std crates (you need to implement the BlockDevice trait for your data source)

Usage

Command line

(subject to change)

# create a 1MiB ext2 file system in fs.img with the structure of my_directory
mkfs ext2 create --size 1MB --out fs.img --in-dir ./my_directory

Library

(not implemented yet)

Use mkfs directly

Works nicely in build.rs files.

mkfs::ext2::create(
    Ext2CreateOption {
        out: PathBuf::from("fs.img"),
        // all the other options
    }
);

Use with a no_std crate

// something like the following, still trying to figure this out
let block_device: MyBlockDevice = todo!("implement the BlockDevice trait");

let fs = Ext2Fs::new(block_device);
let file = fs.create_file("hello_world.txt");
...

mkfs's People

Contributors

tsatke avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.