MCPcopy Index your code
hub / github.com/AerynOS/os-tools

github.com/AerynOS/os-tools @v0.26.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.26.1 ↗ · + Follow
1,359 symbols 3,571 edges 150 files 287 documented · 21%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🛠️ OS Tools - Modern System State Management

📦 Core Tools

This repository provides two powerful Rust-based tools for managing .stone packages, the native package format for AerynOS:

  • moss: Advanced package & system state manager with atomic transactions and content deduplication
  • boulder: Modern package building tool with containerized builds and intelligent package splitting

🔧 Technical Overview

.stone Package Format

The .stone format is a structured binary package format designed for modern, rolling-release systems. It features:

  • Explicit versioning for seamless format changes
  • zstd compression for optimal storage
  • Content-addressable storage via xxhash
  • Smart payload separation:
  • 📋 Metadata: Package info and licensing with strong typing
  • 🗂️ Layout: Filesystem structure definitions
  • 📑 Index: Content payload access mapping
  • 📦 Content: Deduplicated file storage

System Architecture

  • Content-addressable /usr with atomic updates via renameat2
  • Private store and roots in /.moss
  • Container-based transaction triggers
  • Full USR merge compliance
  • Stateless system design with clear separation of OS and local system configuration
  • Quick system rollbacks through atomic operations

Boulder Features

  • YAML-based recipe format (stone.yaml, KDL coming soon ❤️)
  • Automatic subpackage splitting
  • Automatic provider emission (e.g. soname()) and dependency use
  • Uniform format for repos, manifests and packages
  • Integrated build sandboxing (also supports rootless builds)
  • Advanced compiler optimization profiles
  • Support for architecture-specific tuning

Note: Using latest Rust via rustup is recommended.

📊 Status

  • [x] Read support for .stone
  • [x] Repository manipulation
  • [x] Plugin system for layered graph of dependencies
  • [x] Search support
  • [x] Transactions
  • [x] Installation support
  • [x] Removal support
  • [x] sync support
  • [x] Triggers
  • [x] GC / cleanups of latent states
  • [ ] System model
  • [ ] Subscriptions (named dependency paths and providers to augment the model)

🚀 Onboarding

# clone the AerynOS os-tools repo somewhere reasonable
mkdir -pv ~/repos/aeryn-os/
cd ~/repos/aeryn-os/
git clone https://github.com/aerynos/os-tools.git
cd tools/

# Install a few prerequisites (this how you'd do it on AerynOS)
sudo moss it binutils glibc-devel linux-headers clang bsdtar-static cpio

# remember to add ~/.cargo/bin to your $PATH if this is how you installed rustfmt
cargo install rustfmt

# from inside the moss clone, this will build boulder and moss
# and install them to ${HOME}/.local/bin/ by default
just get-started

# boulder and moss rely on so-called subuid and subgid support.
# IFF you do not already have this set up for your ${USER} in /etc/subuid and /etc/subuid
# you might want to do something similar to this:
sudo touch /etc/sub{uid,gid}
sudo usermod --add-subuids 1000000-1065535 --add-subgids 1000000-1065535 root
sudo usermod --add-subuids 1065536-1131071 --add-subgids 1065536-1131071 ${USER}

NB: If you want to build .stones with boulder on your non-aeryn host system, you will need to specify the location of the boulder data files (which live in ${HOME}/.local/share/boulder if you used just get-started like above):

alias boulder="${HOME}/.local/bin/boulder --data-dir=${HOME}/.local/share/boulder/ --config-dir=${HOME}/.config/boulder/ --moss-root=${HOME}/.cache/boulder/"

📚 Documentation

See aerynos.dev.

🧪 Experiment

NB: Remember to use the -D sosroot/ argument to specify a root directory, otherwise moss will happily eat your current operating system.

just get-started

# create the sosroot/ directory
mkdir -pv sosroot/

# Add the volatile repo
moss -D sosroot/ repo add volatile https://packages.serpentos.com/volatile/x86_64/stone.index

# List packages
moss -D sosroot/ list available

# Install something
moss -D sosroot/ install systemd bash libx11-32bit

If you want to create systemd-nspawn roots or bootable VMs, please check out the img-tests repository.

🤝 Contributing changes

Please ensure all tests are running locally without issue:

$ just test

# Prior to committing a change:
$ just test # includes the just lint target

# Prior to pushing anything, apply clippy fixes:
$ just fix

Then create a Pull Request with your changes.

⚖️ License

moss-rs is available under the terms of the MPL-2.0

Extension points exported contracts — how you extend this code

Record (Interface)
(no doc) [4 implementers]
crates/stone/src/payload/mod.rs
BlitFile (Interface)
Simple generic interface for blittable files while retaining details. All implementations should return a directory typ [2 …
crates/vfs/src/tree/mod.rs
Config (Interface)
(no doc) [4 implementers]
crates/config/src/lib.rs
Styled (Interface)
Wrapper around `Stylized` which does nothing if not a TTY [1 implementers]
crates/tui/src/styled.rs
Handler (Interface)
(no doc) [1 implementers]
boulder/src/package/analysis.rs
ReadExt (Interface)
(no doc) [1 implementers]
crates/stone/src/ext.rs
ColumnDisplay (Interface)
Implementing ColumnDisplay for a type allows use of the print_to_columns function, ie pretty print in individual alphabe
crates/tui/src/pretty.rs
WriteExt (Interface)
(no doc) [1 implementers]
crates/stone/src/ext.rs

Core symbols most depended-on inside this repo

new
called by 308
moss/src/registry/transaction.rs
iter
called by 110
moss/src/repository/mod.rs
len
called by 106
crates/vfs/src/tree/mod.rs
push
called by 97
crates/vfs/src/tree/builder.rs
new
called by 93
boulder/src/cli/recipe.rs
into_iter
called by 59
moss/src/package/mod.rs
is_empty
called by 49
boulder/src/profile.rs
iter
called by 45
boulder/src/profile.rs

Shape

Method 553
Function 418
Class 231
Enum 149
Interface 8

Languages

Rust96%
C++2%
Python1%
C1%

Modules by API surface

moss/src/client/mod.rs46 symbols
libstone/src/lib.rs40 symbols
crates/container/src/lib.rs29 symbols
libstone/src/stone.h28 symbols
crates/stone/src/read/mod.rs26 symbols
boulder/src/timing.rs25 symbols
moss/src/repository/manager.rs24 symbols
crates/stone_recipe/src/lib.rs24 symbols
moss/src/db/meta/mod.rs23 symbols
crates/vfs/src/tree/mod.rs23 symbols
crates/config/src/lib.rs22 symbols
moss/src/installation.rs21 symbols

For agents

$ claude mcp add os-tools \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact