The Wayback Machine - https://web.archive.org/web/20200525085735/https://github.com/samuela/rustybox
Skip to content
A free-range, non-GMO fork of busybox in 100% Rust πŸ¦€
Rust Shell
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows Expand on stable rustfmt comment Feb 14, 2020
.vscode Add vscode settings telling RLS to use --all-features Jan 31, 2020
applets fix applet_tables Feb 13, 2020
archival fmt Jan 31, 2020
console_tools
coreutils Merge branch 'master' into od-remove-long-double Feb 16, 2020
debianutils Behemoth extern "C" removal Jan 31, 2020
e2fsprogs fmt Jan 31, 2020
editors get rid of die_func externs Feb 13, 2020
findutils get rid of xfunc_error_retval externs Feb 13, 2020
init get rid of die_func externs Feb 13, 2020
klibc_utils fmt Jan 31, 2020
libbb
libpwdgrp Behemoth extern "C" removal Jan 31, 2020
librb
loginutils get rid of die_func externs Feb 13, 2020
mailutils fmt Jan 31, 2020
miscutils get rid of xfunc_error_retval externs Feb 13, 2020
modutils fmt Jan 31, 2020
networking formatting Mar 13, 2020
printutils fmt Jan 31, 2020
procps formatting Mar 13, 2020
runit get rid of xfunc_error_retval externs Feb 13, 2020
shell get rid of die_func externs Feb 13, 2020
sysklogd Behemoth extern "C" removal Jan 31, 2020
tests move a bunch of bc tests into rust Feb 14, 2020
testsuite move bc test files to their own directory Feb 14, 2020
usage
util_linux get rid of xfunc_error_retval externs Feb 13, 2020
.gitignore
CONTRIBUTING.md add "removing unsafes" section to contributing.md Nov 16, 2019
Cargo.lock formatting Mar 13, 2020
Cargo.toml Merge branch 'master' into od-remove-long-double Feb 16, 2020
README.md remove no default included that does not make sense anymore Feb 3, 2020
build.rs initial commit Nov 2, 2019
rust-toolchain switch to standard nightly Nov 2, 2019
rustfmt.toml initial commit Nov 2, 2019
rustybox.rs support selective applet inclusion Nov 12, 2019

README.md

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.

You can’t perform that action at this time.