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
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
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
And of course please test out rustybox and reportany and allissues, concerns, and comments!
Customizing your rustybox distribution
Chances are you don’t actually need or wanteverythingin 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
Cargo .tomlfor 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.