Exactly what the title says: OpenBSD, with some parts rewritten (and some written from scratch) in Rust.
Disclaimer: It's just for fun, obviously it's not a great idea to take a stable set of commonly used userspace tools are rewrite it in a new programming language with no evident benefit...
Disclaimer: This is fully untested software, and we expect for it not to work: nevertheless, open an issue if it doesn't work correctly (or better yet, try to fix it and send a PR)
-
Fun: Mostly, just beacuse it's a fun experiment.
-
Safe: Some high-safety components such as
initanddoasbenefit from an high-quality Rust reimplementation. -
Updated:
- rustBSD is synced daily with the upstream OpenBSD source code for all non-Rust components.
- rustBSD is compatible with OpenBSD's ports and xenocara package repositories.
-
Rolling-release: Everytime a major feature is reached in any of the packages developed by rustBSD and the entire system is tested, a new stable release is published.
-
Declarative: fdecs is a tool for flexible declarative system for rustBSD, managing packages, configurations, scripts, daemons and databases. (not yet implemented)
-
Data-driven:
- Datad is our data layer daemon, built on top of SQLite, inspired by the IBM's AS/400 design. (not yet implemented)
- Kvdb is our in-memory lightweight key-value database, compatible with JSON and inspired by Redis. (not yet implemented)
-
Reliable:
- Built on top of OpenBSD, famous for its reliability
- supervise is our metrics-aware service supervisor, capable of managing safe reboots of critical processes (not yet implemented)
-
Scalable:
- terascale is a Linux server software for spawning and managing multiple rustBSD VMs (not yet implemented)
- polyserverd is a lightweight daemon for managing multiple rustBSD nodes, integrated with
terascale(not yet implemented) - polyclientd is a lightweight daemon for rustBSD nodes that allows to communicate with
polyserverd(not yet implemented) - lbalanced is a lightweight load balancer, integrated with
polyserverdfor splitting packets across multiple rustBSD nodes (not yet implemented)
- Install OpenBSD (most likely in a VM)
- Install the Rust toolchain
- Clone this repository into
/usr/src - Run
make obj && make build - Run
cd /usr/src && sysmerge - Run
cd /dev && ./MAKEDEV all - Run
reboot(just to manage running processes) - You are now running on the latest version of RustBSD!
- (Follow
How to build and install) - Run
export RELDIR=your-releasedir - Run
cd /usr/src/distrib/$(machine)/iso && make - Run
make install
- Run
./run-tests.cshorcsh run-tests.csh
echochrootcat
cpmvddkilllsrmrmdirsleepps
md5sha*synctar
initdoas
datad: sqlite-based background data layerkvdb: in-memory key-value databasefdecs: flexible declarative system for rustBSD installationssupervise: reliable service supervisorpolyclientd: platform for managing multiple rustBSD nodes; polyclientd runs on the nodespolyserverd: platform for managing multiple rustBSD nodes; polyserverd runs on the managerslbalanced: lightweight load balancer daemonterascale: Linux tool for managing rustBSD VMs
Just take any userspace program that you are interested in, implement it in Rust and send a PR.
(Note: before writing a userspace program, read bin/echo as it's the simplest example)
Not too much:
- As long as amd64 is supported, support for other architectures can be broken (with
TODOnotes for later support of other architectures) - As long as it is widely unused, particular CLI flags and features can be left out in the reimplementation process
- If there is a better way to do it, that way should be followed
Yes, but only if we think that they can be widely used on most RustBSD installations.
PuffyRS (found at puffyrs/) is a Rust library designed to help us write better userspace tooling using idiomatic Rust.
-
Create a directory for your program under the appropriate location (e.g.
bin/myprog/for a utility that belongs in/bin). -
Initialize a Rust project inside it:
cargo init --name myprog bin/myprog -
Ensure the
Cargo.tomldeclares a binary matching your program name:[package] name = "myprogrs" version = "0.1.0" edition = "2021" [[bin]] name = "myprog" path = "src/main.rs"
-
Create a
Makefilein your program's directory that invokescargoand integrates with the BSD build system:PROG= myprog CLEANFILES+= target ${PROG}: cargo build --release ln -sf target/release/${PROG} ${PROG} .include <bsd.prog.mk>
-
Add your program's directory name to the
SUBDIRlist in the parentMakefile(e.g.bin/Makefile), so it gets built alongside the rest of the userland. -
Rebuild and install as usual:
make obj && make build cd /usr/src && sysmerge