Files
makronix/README.md
T
lotherk 5fe3281496 docs: README for the tree, drop harness-specific .claude config
README.md collects what Makronix is, the repository layout, the one build
entry point and its gate, the installer/desktop/media design, offline
sources, platforms, the documentation map and the contribution rules from
AGENTS.md, GOAL.md and docs/BUILD-CONTRACT.md. It describes the tree as it
is on main: ext/src/* are submodules, distfiles/ is in the repository, and
the version is 0.99.11 (src/sys/conf/makronix-release) with 0.99.10
"Camouflage" as the last named release.

Remove .claude/ from the repository and ignore it: AGENTS.md is the
harness-independent convention. Root AGENTS.md and tools/AGENTS.md now
describe tools/claude-build-gate.sh as a build gate rather than a Claude
hook; docs/reference/AGENTS.md notes the removal of the archived directory.

build/ becomes build/* in .gitignore: git cannot re-include a file from an
excluded directory, so "build/ + !build/AGENTS.md" never worked and the
one tracked file the comment promises was never addable.

Verification: every relative link checked with git cat-file -e against main
(16 links, 0 dead, after build/AGENTS.md became addable); measured in a
throwaway repo that build/* adds build/AGENTS.md and still ignores
build/sub/x.o; make targets read from the root Makefile and
docs/BUILD-CONTRACT.md; 0.99.11 from src/sys/conf/makronix-release.
2026-11-22 14:12:28 +00:00

214 lines
13 KiB
Markdown

# Makronix
Makronix is a standalone operating system based on NetBSD, built and shaped on
purpose. It is opinionated: the user decides little and gets a complete system
in return. The desktop is MCDE, a fork of CDE 2.5.3 that lives in the `mcde`
submodule of `ext/src/mcde/`. The version in the tree is **0.99.11**
(`src/sys/conf/makronix-release`); release names are CDE palette names, and the
last one named is 0.99.10 "Camouflage", whose palette drives logo, icons and
installer theme. `uname -s`
stays `NetBSD` so pkgsrc and `config.guess` keep working
([GOAL.md](GOAL.md), decisions of 2026-11-08).
The guiding principle is **the NetBSD way**: even after the sources have been
changed, a NetBSD developer should say "ah cool, it's still NetBSD". Read the
documentation in the tree first, find the existing pattern with `git grep`,
reuse the existing building block, and only then write code. Platform-neutral
thinking: amd64 is the first target, not the only one. Deviations from a NetBSD
convention are a finding in the report, never a silent change.
> This file is an orientation for people and agents. Where it disagrees with
> the tree, the tree wins. Binding rules are in [AGENTS.md](AGENTS.md), the
> goal and its measurable definitions of done in [GOAL.md](GOAL.md), and the
> one permitted build procedure in [docs/BUILD-CONTRACT.md](docs/BUILD-CONTRACT.md).
> Per-directory `AGENTS.md` files say what belongs in a directory and what may
> be changed there.
## What is in the repository
Everything Makronix needs to build lives in this repository. `make sourcesets`
packages it into a single source set that unpacks to `/usr/src`, so an
installed system can rebuild itself offline ([docs/OFFLINE-BUILD.md](docs/OFFLINE-BUILD.md)).
| Path | What it is |
|---|---|
| `Makefile` | The one build entry point; NetBSD make (`bmake` on a Linux host — GNU make does not read it). |
| `src/` | Makronix's NetBSD tree, tracked here, not an overlay of patches. Its upstream base commit is in `src/BASE`; NetBSD conventions still apply. |
| `xsrc/` | Makronix's X tree, tracked the same way (`xsrc/BASE`). Built by `build.sh -x -X xsrc` into the X sets (`xbase`, `xcomp`, `xetc`, `xfont`, `xserver`); pkgsrc uses `X11_TYPE=native`. |
| `pkgsrc/` | Pinned checkout of pkgsrc (its own repository). Never patched; package lists and recipes are stored outside it. |
| `packages.list` | The one list of packages Makronix ships: `set`, `bin` and `fetch` packages, media repository packages, games, and `@ARCH` restrictions ([docs/MCDE-PROGRAMS.md](docs/MCDE-PROGRAMS.md) for desktop work). |
| `ext/` | Third-party sources Makronix owns as forks (MCDE, Motif alias `mcde-motif`, afpfs-ng, glibc, splinter), each with its pkgsrc recipe and an `IMPORT` record. The forks are **submodules** of their own repositories since 2026-11-22, so a change is a commit there and then a gitlink bump here; the parent records the commit, the history lives in the submodule ([ext/AGENTS.md](ext/AGENTS.md)). |
| `mobile/` | Makronix/Linux for phones: kernel.org Linux plus our patch series, NetBSD userland from `src/` on glibc, pkgsrc in `/usr/pkg`. Its own `Makefile` and rules ([mobile/AGENTS.md](mobile/AGENTS.md)). |
| `refs/` | Read-only upstream references (NetBSD, Linux, OpenBSD) as shallow submodules. Look here, never build from here. |
| `tools/` | POSIX `sh` scripts for build, release, media, tests and MCDE; no Python, no bashisms ([tools/AGENTS.md](tools/AGENTS.md)). |
| `docs/` | Binding build contract, guides, plans, platform notes, and saved upstream reading ([docs/AGENTS.md](docs/AGENTS.md)). |
| `www/` | The project website, including the Guide as an HTML page. |
| `build/` | All build output: object trees, logs, packages, media and test VMs — nothing here is source, and nothing here is committed except `build/AGENTS.md` ([build/AGENTS.md](build/AGENTS.md)). |
| `distfiles/`, `distfiles.lst` | `distfiles.lst` lists the archives that belong to Makronix (path, file name, size, SHA512); `distfiles/` carries them in the repository since 2026-11-19, so the build needs no network. |
| `PINS` | The pinned upstream commits of `src`, `xsrc` and `pkgsrc` (`tools/makronix-pins.sh` checks them). |
| `LICENSE` | CNCL 1.0 (Could Not Care Less) for what Makronix wrote; imported trees keep their own licences. |
## What makes Makronix different
- **Installer.** A fork of NetBSD's `sysinst` with two paths: the *Makronix
way* — choose the disk, optionally encrypt it, then answer the remaining
setup questions (user, network/WLAN, hostname, timezone) during
installation, before the first reboot; and the unchanged advanced NetBSD
path. "FDE" in this repository means cgd root encryption from the installer,
not a hand-typed script. The installer uses the CDE palette; sysinst remains
recognisably sysinst.
- **Desktop.** MCDE is CDE 2.5.3, extended in C99/POSIX with Motif/Xlib/X11,
with system services behind `lib/McdeSys`. The yardstick is "a 1995-class
computer": a new program must be usable in one session on 256 MB without
hardware acceleration. Release names are CDE palette names; 0.99.10 is
"Camouflage" and its palette drives the logo, icons and installer theme.
- **Packages.** The `makronix` set is generated from the installed `/usr/pkg`
tree and installed by sysinst; packages Makronix does not patch arrive as
the NetBSD project's binary packages. Extra groups (games, museum, desktop
programs) come from the media's repository and are installed with `pkg_add`,
so they stay registered for `pkg_add -u` and `pkg_admin audit`.
- **Media.** `make release` produces the installation media: sets, kernels,
the signed source set, a CD/DVD and a bootable USB image. The install DVD
carries everything on one disc; the three CDs split the system, the
`makronix` set and binary packages, with sysinst's "Next CD" menu for
disc changes. Installations from the media are tested in QEMU up to a login
prompt and a clean shutdown.
- **Upgrades.** A one-command path built on `sysupgrade`, `etcupdate` and
registered packages, with `file://` as an allowed source. Release integrity
uses a two-key signify chain: an offline root key signs the release key,
which signs the sets' `SHA512` and the media's package summary.
## Building
Everything builds from the root `Makefile` and one of its named targets. Use
`make` on a NetBSD host and `bmake` on a Linux host; do not create new targets
and do not chain `build.sh` operations by hand ([docs/BUILD-CONTRACT.md](docs/BUILD-CONTRACT.md)).
```sh
make # the distribution (sets), no medium
make release ARCH=amd64 # everything: userland, sets, kernels, signed source
# set, CD/DVD images and the USB image, in one lock
make install # over a running Makronix/NetBSD only: base and X
# (the makronix set and packages follow with t0056)
make mobile # the phones (mobile/Makefile, its own agent)
make test # release tests (tool tests, MCDE units, VM installs)
```
`ARCH` is the name a person types (`amd64`, `evbarm`, ...); `MACHINE` is
NetBSD's internal name for it. The host may be NetBSD (native) or something
else (cross): both are one build, detected at the start. A package that builds
only one way is broken — fix its recipe or a host-tool setting, never "build it
in a VM". A VM is for testing installs and upgrades, not for building.
Important consequences of the build contract:
- **One build at a time per tree.** The Makefile takes `tools/build-lock.sh`;
a second build is refused with the holder's PID. Tools that write
`build/obj` or `releasedir` refuse direct invocation. Run them through make
or through the lock.
- **The gate is `checkflist`**, invoked exactly as NetBSD invokes it. Extra or
missing files fail the build. A run without that gate is not a release, even
if the images exist.
- **Do not hand-edit `build/obj/releasedir/**`**: move, delete or replace a
wrong artefact by fixing and rebuilding. Do not use `git reset --hard`,
`git checkout -- .`, `git clean -fdx` or delete set lists to make failures go
away.
- **Logs are the evidence.** Long builds run as one named background job with
output in `build/logs/<target>-<date>.log`; the last line is
`make <target> exit=N`. A claim without a file:line or a log line is a guess.
Other existing targets package or check what `release` built: `iso`, `usb`,
`compress`, `sourcesets`, `isosrc`, `userland`, `kernel`, `tools`, `stamp`,
`cdtest`. See the root Makefile and `docs/BUILD-CONTRACT.md` for the order.
## After an install: reading and rebuilding offline
A full-profile installation carries the source set in `/usr/src`: `src/`,
`xsrc/`, `ext/`, `pkgsrc/`, `mobile/`, `www/`, `docs/`, `tools/`, the root
files, `packages.list`, `PINS`, `distfiles.lst`, and `distfiles/` with the
archives of the Makronix packages — one tree, no `/usr/xsrc` and no
`/usr/msrc`. The install DVD and CDs do not carry sources; the full profile
asks for the separate source DVD. Source archives are split over several
files on that DVD because 5.8 GB does not fit ISO 9660's 32-bit size field.
The README on the disc gives the extraction command.
```sh
cd /usr/src
export MAKRONIX_TOP=/usr/src
```
`tools/pkgsrc-cross.mk.conf` takes its paths from `MAKRONIX_TOP` and uses
`distfiles/` when present. Updating an installed system, including the cgd
boot-partition caveat for encrypted systems, is in [docs/UPDATING.md](docs/UPDATING.md).
## Platforms
amd64 is the reference platform: tested in QEMU (BIOS and UEFI) and on a
MacBook Pro 2011. The MacBook boots the GPT/EFI USB image directly through
"EFI Boot" and starts dtlogin after installation. Further targeted platforms
are macppc (G3/G4/G5), aarch64 `evbarm` (Raspberry Pi 4 and Zero 2 W, ODROID-M1
and N2) and armv7 `evbarm` (ODROID-U3+), plus mobile on the OnePlus 7T
("hotdogb"). A platform counts as supported only once its test in QEMU is
green; where QEMU cannot model the hardware, real hardware evidence is
required. Current state and gaps are in [docs/PLATFORMS.md](docs/PLATFORMS.md)
and [ISSUES.md](ISSUES.md). Those documents are dated measurements, not
promises.
## Documentation map
- [GOAL.md](GOAL.md) — what Makronix is, decisions made by Konrad, and the
measurable definition of done for each part.
- [AGENTS.md](AGENTS.md) — the binding working rules: docs before code, the
NetBSD way, licensing, build rules, forbidden commands and definition of done.
- [docs/BUILD-CONTRACT.md](docs/BUILD-CONTRACT.md) — the only build procedure,
the `checkflist` gate, task-card format and how a reviewer reruns evidence.
- [docs/OFFLINE-BUILD.md](docs/OFFLINE-BUILD.md) — the source set and what has
actually been measured about rebuilding without a network.
- [docs/UPDATING.md](docs/UPDATING.md) — updating an installed Makronix, and
what is not yet measured.
- [docs/PLATFORMS.md](docs/PLATFORMS.md), [ISSUES.md](ISSUES.md) — platform
tests and the Raspberry Pi 4 issue register.
- [docs/guide/](docs/guide/) — *The Makronix Guide*: one DocBook source built
into manual pages, PDF, HTML and an MCDE information library.
- [ROADMAP.md](ROADMAP.md) — a **draft**, not confirmed by Konrad: proposed
phases (build/media, MCDE, upgrade, platforms, network ideas).
- `docs/reference/` — upstream documentation read and saved with source and
date, so the next session does not start over. Historical narratives here
are history, not rules.
## Contributing
Rules before changes ([AGENTS.md](AGENTS.md)):
1. Read the documentation in the relevant directory and in NetBSD's tree
(`src/BUILDING`, `src/share/misc/style`, `src/distrib/sets/README`,
`src/etc/rc.subr`, man pages, file headers) and save what you read under
`docs/reference/<topic>.txt` with source and date. Quote the sentence that
settles a question, with its location, before acting on it.
2. Find the pattern already in the tree with `git grep` and use the existing
building block. Comment which NetBSD pattern the code follows. Write `tools/`
scripts in POSIX `sh` (`dash -n`); no Python, no bashisms.
3. Measure: a task is done when its test is green and committed, a build when
`checkflist` reports nothing missing or extra, a medium when an installation
reaches a login prompt and shuts down cleanly with the log kept. State the
command, the exit code and the log excerpt — no status prose.
4. Commit with explicit paths, one commit per topic, with the test evidence in
the message, and push to both remotes. Do not commit work that is red or
unfinished; say what is missing instead. Another agent works in `mobile/`
in the same repository, so keep commits scoped.
Project-wide tasks are tracked in tasksd under the `makronix` scope (and its
children, e.g. `makronix/build`, `makronix/mcde`, `makronix/sysinst`); each
card carries "messbar fertig", "Beleg" and "Quellen"
([docs/BUILD-CONTRACT.md](docs/BUILD-CONTRACT.md)). `ROADMAP.md` is a proposal,
not an assignment.
## Licence
What Makronix wrote itself is under [CNCL 1.0](LICENSE) (Could Not Care Less):
do whatever you want, no attribution, no conditions. Files carry the line
`License: CNCL 1.0 ...`. Imported trees keep their own licences: `src/` and
`xsrc/` are NetBSD/BSD, `pkgsrc/` and `refs/*` keep upstream terms, and MCDE in
`ext/` is CDE, LGPL 2.0 or later. A new file in a fork gets the CNCL line; a
changed upstream file keeps the notice it already had.