GithubHelp home page GithubHelp logo

westonsteimel / rustybox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from samuela/rustybox

0.0 1.0 0.0 8.25 MB

A free-range, non-GMO fork of busybox in 100% Rust ๐Ÿฆ€

Rust 98.78% Shell 1.22%

rustybox's Introduction

rustybox

RustyBox is a free-range, non-GMO fork of BusyBox written entirely in Rust. It includes all your favorite commands like ls, mount, and top, but without a single line of C code! Like BusyBox, rustybox weighs in at just under 1 megabyte and includes all the basic utilities you need to set up a small Linux OS.

screenshot

Status

rustybox is a work-in-progress! It started out life as a direct c2rust transpile of the busybox project, and has been steadily improving since then. This has the benefit of ensuring that rustybox is "bug-for-bug" compatible with busybox, but it does mean that we have inherited the raw pointers and unsafes that come from C land. If making essential software memory-safe is your cup of tea then join the party with a PR!

Contributing to rustybox

Contributing to rustybox is a great way to get started with rust, dig into the bowels of linux, or to help to free the world from the diabolical tyranny of C.

There's lots to be done, so we're happy to have you! Here are just a few ideas:

  • Replace some extern "C" includes with more idiomatic uses. Pretty straightforward find/replace-all usually does the trick.
  • Pick a utility, like cat or touch, and work on translating it into safer, more idiomatic rust. There are plenty of unsafes lying around that you can tackle!
  • Try building Alpine linux with rustybox in place of busybox. This could be an awesome drop-in replacement for the popular alpine Docker image.

Check out the contributing doc for more info!

And of course please test out rustybox and report any and all issues, concerns, and comments!

Building rustybox

Rustybox requires a Linux system to build. Developing in Docker works just as well on macOS and Windows. You'll need GCC and its development headers (esp. quadmath.h) in order to build the f128 dependency. Running sudo apt install build-essential should do the trick on Ubuntu/Debian.

Please open an issue if you have trouble building!

Customizing your rustybox distribution

By default, rustybox does not include any utility. You can include all of them:

cargo build --all-features

Chances are you don't actually need or want everything in rustybox, especially for a release. If you'd like to build rustybox with only a specific set of utilities:

cargo build --release --features "cat ls which"

Check out the [features] section of Cargo.toml for the full list of utilities on tap.

After building, you can remove unnecessary debug sections with strip. This is recommended if you are particularly size-conscious.

Acknowledgements

There's simply no way this project would be possible without the hard work from the wonderful busybox and c2rust teams. Both projects are dope, and you should check them out. Much of the code you find in this repo is transpiled from the work of the busybox AUTHORS.

rustybox's People

Contributors

samuela avatar akeboshiwind avatar zapanton avatar chlongv avatar kamilaborowska avatar

Watchers

James Cloos 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.