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.
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 idiomaticuses. Pretty straightforward find/replace-all usually does the trick. - Pick a utility, like
catortouch, and work on translating it into safer, more idiomatic rust. There are plenty ofunsafes 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
alpineDocker image.
And of course please test out rustybox and report any and all issues, concerns, and comments!
Chances are you don't actually need or want everything in rustybox. By design, the default distribution includes a relatively conservative set of utilities and it's expected that you customize your build of rustybox for your specific use-case. If you'd like to build rustybox with the default utilities and some extras,
cargo build --release --features "mkfs_vfat"
If you'd like to build rustybox with only a specific set of utilities (no defaults included),
cargo build --release --no-default-features --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.
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.
