RustForge

foundry

Foundry OS: the operating system built on the Rustbelt kernel

authorGrok Bot <grokbot@localhost>2026-10-31 18:57:44 -0700
commit41e9df8f2e93c3277818d5321025270eadb88a77
parentca4ae6810735d3f733d73dc27ddc4aeee2b78547
treebrowse files at this commit
docs/proposal.md: record the approval; replace 'vendored tarball' with the SHA256-pinned download cache
Mdocs/proposal.md+25 -13

1 file changed, 25 insertions, 13 deletions

@@ -5,6 +5,15 @@ at `master` 58fc4fd (Rustbelt 0.15.1), **re-tested on 0.16.0 (63fcb86), 0.17.0 (fc5e78a) and 0.18.0 (dea72d3)**: see §2.6, §3b, §3c and §3d. Nothing in the kernel repo was changed. `/workspace/rustbelt-os` does not exist yet; creating it is step 1 below, after you approve.* +> **Approved by Tyler on 2026-10-31, with changes.** The OS is now called+> **Foundry OS** (built on the Rustbelt kernel, like Ubuntu on Linux) and+> lives in `/workspace/foundry`; read "rustbelt-os" below as "Foundry OS".+> The answers to §11 are in [plan.md](plan.md). The main changes to this+> text: no tarballs in git (the section "Where musl goes" below is+> rewritten), the shell is `rbsh`, and the kernel pin is a55b41d (0.19.0),+> which already has static-PIE (K2), so the `rb-cc` hacks are no longer+> needed. Everything else is Clarke's original analysis.+ ---  ## 0. The short version@@ -474,19 +483,18 @@ rustbelt-os/ │ ├── toolchain/ │   ├── musl/-│   │   ├── musl-1.2.5.tar.gz         vendored release tarball (1.1 MB)-│   │   ├── musl-1.2.5.tar.gz.asc     upstream signature-│   │   ├── SHA256SUMS+│   │   ├── musl.sha256 / musl.url    pin of the release tarball (downloaded into cache/, never committed)+│   │   ├── fetch.sh                  download + SHA256 check+│   │   ├── build.sh                  unpack → patch → configure → make → install into out/sysroot │   │   └── patches/                  0001-*.patch, applied in order (empty at first)-│   ├── build-musl.sh                 unpack → patch → configure → make → install into out/sysroot-│   └── rb-cc                         compiler wrapper (gcc + musl sysroot + Rustbelt link flags)+│   └── (no rb-cc: Rustbelt 0.19.0 runs static-PIE, so plain musl-gcc -static-pie works) │ ├── c/                        small C programs of our own (hello-musl.c, mprobe.c = libc smoke tests) │ ├── ports/                    third-party C programs, one directory each-│   ├── dash/                 dash-0.5.12.tar.gz, SHA256SUMS, patches/, build.sh+│   ├── dash/                 dash.sha256 + dash.url (tarball in cache/), patches/, build.sh │   ├── sbase/                (M4) suckless coreutils-│   └── busybox/              (M5) busybox-1.37.x tarball, busybox.config, patches/+│   └── busybox/              (M5) busybox.sha256 + .url, busybox.config, patches/ (applets in /usr/lib/busybox) │ ├── rootfs/                   files copied into the image as-is │   ├── readme.txt  notes/    (from kernel disk/)@@ -514,16 +522,20 @@ rustbelt-os/ - `out/` holds everything generated, so `make clean` is just   `rm -rf out`. -### Where musl goes: vendored tarball + patches (recommended), not a submodule+### Where musl goes: a SHA256-pinned download cache + patches (approved), not vendored, not a submodule++*Changed on approval (Q6): tarballs are **not** committed.*  | Option | For | Against | |---|---|---|-| **Vendored release tarball + `patches/` (recommended)** | Works offline, with no remote (you said local only). The exact bytes are pinned by SHA256 and the upstream `.asc` signature. Patches are small readable files. Upgrading means dropping in a new tarball and re-running. | 1.1 MB in git (fine; dash 0.2 MB, busybox about 2.5 MB) |-| git submodule | Full upstream history | A submodule needs a URL to clone from. With local-only rules it would point at another local clone, which is confusing for a beginner and easy to get wrong. Editing musl in place mixes our changes with theirs. |-| `apt install musl-tools` | Zero work | Ties us to Debian's build. Its `musl-gcc` wrapper hard-codes `Scrt1.o` (see §3), and we can't patch it. |+| **Download cache pinned by SHA256 + `patches/` (chosen)** | The repo stays small and holds only text. `toolchain/musl/musl.sha256` pins the exact bytes, `musl.url` says where to get them, and `fetch.sh` downloads into the git-ignored `cache/` and checks the hash. Offline, you drop any copy with the right hash into `cache/` (or set `MUSL_TARBALL=`). Patches stay small readable files. Upgrading = new hash + URL. | The first build needs the network, or a copy of the file. |+| Vendored release tarball in git | Works offline from a fresh clone | 1.1 MB per musl version in git forever (about 4 MB by M5); rejected |+| git submodule | Full upstream history | Needs a URL; confusing with local-only rules; mixes our edits with theirs |+| `apt install musl-tools` | Zero work | Ties us to Debian's build. Still fine for now: Rustbelt 0.19.0 loads static-PIE, so Debian's `musl-gcc -static-pie` works with no `rb-cc` hacks (the kernel builds its own musl fixtures this way). |++Ports work the same way: `ports/<name>/<name>.sha256` + `<name>.url`, into `cache/`. -My expectation is that musl will need **no patches at first**. Every fix so-far belongs either in the kernel or in our `rb-cc` flags.+My expectation is that musl will need **no patches at first**.  ---