ls
,mount
, andtop
, 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 idiomaticuse
s. Pretty straightforward find / replace-all usually does the trick. - Pick a utility, like
cat
ortouch
, and work on translating it into safer, more idiomatic rust. There are plenty ofunsafe
s 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.
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[features]
section ofCargo .toml
for the full list of utilities on tap.
After building, you can remove unnecessary debug sections withstrip
. This is recommended if you are particularly size-conscious.
Acknowledgments
There’s simply no way this project would be possible without the hard work from the wonderfulbusyboxandc2rustteams. Both projects are dope, and you should check them out.
GIPHY App Key not set. Please check settings