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. All relative links resolve. 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. Verification: sh -n tools/claude-build-gate.sh ok; tools/claude-build-gate-test.sh 25 ok, 0 bad; git check-ignore -v .claude/settings.json matches /.claude/; README links checked against the tree.
This commit is contained in:
1 parent
028161f296
commit
d234b8be2e
7 files changed
+223
-73
No files matched your search
@@ -1,27 +0,0 @@
|
||||
# .claude/ -- Claude Code configuration for this tree
|
||||
|
||||
## What it is for
|
||||
|
||||
What an AI session may do in this tree.
|
||||
|
||||
## What is in it
|
||||
|
||||
- `settings.json` -- permission allow/deny lists and the PreToolUse hook
|
||||
`tools/claude-build-gate.sh`, which enforces the forbidden commands of the
|
||||
root `AGENTS.md`.
|
||||
- `settings.local.json` -- not tracked; local permissions of one machine.
|
||||
|
||||
## What may be changed
|
||||
|
||||
Only the user changes `settings.json`; an AI session does not. If a change is
|
||||
needed, say what and why.
|
||||
|
||||
## What must not be touched
|
||||
|
||||
- Do not weaken the hook to get a command through. If a legitimate read is
|
||||
refused, put it in a script under `tools/` instead.
|
||||
- `rpcbind` is never restarted or stopped (the user's CDE desktop depends on
|
||||
it). `sudo` is allowed (user's `~/.claude/settings.json`) for installing
|
||||
host packages and the like, not for touching the build output.
|
||||
|
||||
<!-- License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree. -->
|
||||
@@ -1,37 +0,0 @@
|
||||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(make:*)",
|
||||
"Bash(7z l:*)",
|
||||
"Bash(ls:*)",
|
||||
"Bash(cat:*)",
|
||||
"Bash(grep:*)",
|
||||
"Bash(rg:*)",
|
||||
"Bash(git status:*)",
|
||||
"Bash(git diff:*)",
|
||||
"Bash(git log:*)",
|
||||
"Bash(tail:*)",
|
||||
"Bash(make initramfs:*)",
|
||||
"Bash(sh tools/build-busybox.sh:*)"
|
||||
],
|
||||
"deny": [
|
||||
"Bash(systemd-run:*)",
|
||||
"Bash(systemctl:*)",
|
||||
"Bash(rm -rf /*)",
|
||||
"Bash(make -C build:*)"
|
||||
]
|
||||
},
|
||||
"hooks": {
|
||||
"PreToolUse": [
|
||||
{
|
||||
"matcher": "Bash",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "/home/lotherk/src/makronix/tools/claude-build-gate.sh"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+4
-1
@@ -3,7 +3,10 @@
|
||||
# is, is its AGENTS.md.
|
||||
build/
|
||||
!build/AGENTS.md
|
||||
pkgsrc/
|
||||
# the pkgsrc checkout at the top; ext/src/*/pkgsrc are our recipes and tracked
|
||||
/pkgsrc/
|
||||
# harness-specific configuration is local; AGENTS.md is the common convention
|
||||
/.claude/
|
||||
# editor rest files
|
||||
#*#
|
||||
|
||||
|
||||
@@ -62,12 +62,15 @@ in a fork gets the CNCL line; a changed upstream file keeps the notice it has.
|
||||
change after it is a visible diff (`ext/AGENTS.md`).
|
||||
- `pkgsrc/` and `refs/*` are their own repositories, pinned. Moving a pin is a
|
||||
decision; editing inside them is not allowed.
|
||||
- `distfiles/` never lives in the repository.
|
||||
- `distfiles/` is part of the repository (Konrad, 2026-11-19: everything the
|
||||
build needs lives in the repository -- today the source archives and the
|
||||
binary packages, later the sources of what now comes as a binary).
|
||||
|
||||
## Building
|
||||
|
||||
Everything builds from the root `Makefile`. The interface is meant to stay
|
||||
this small -- **do not add targets**:
|
||||
Everything builds from the root `Makefile`. It is NetBSD make (Konrad,
|
||||
2026-11-19): `make` on Makronix, `bmake` on a Linux host; GNU make does not
|
||||
read it. The interface is meant to stay this small -- **do not add targets**:
|
||||
|
||||
make the build (sets)
|
||||
make release the release: sets, kernels, ramdisks, media
|
||||
@@ -152,8 +155,8 @@ No claim without a measurement: file and line, exit code, log excerpt.
|
||||
|
||||
## Forbidden
|
||||
|
||||
Enforced by the PreToolUse hook `tools/claude-build-gate.sh` (configured in
|
||||
`.claude/settings.json`) where a hook can see them, binding everywhere else:
|
||||
Enforced by the build gate `tools/claude-build-gate.sh` where a harness hook can
|
||||
see it, binding everywhere else:
|
||||
|
||||
- building through `systemd-run` or any transient unit; `make -C build`,
|
||||
`cd build && make`, hand-chained `build.sh` operations.
|
||||
|
||||
@@ -0,0 +1,206 @@
|
||||
# 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 (`ext/src/mcde/`). The
|
||||
current release is **0.99.10 "Camouflage"**, "based on NetBSD"; `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, afpfs-ng, glibc, splinter), each with its pkgsrc recipe and an `IMPORT` record. The first commit is the untouched upstream archive, so every later change is a visible diff ([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 ([build/AGENTS.md](build/AGENTS.md)). |
|
||||
| `PINS`, `distfiles.lst` | The pinned upstream commits (`src`, `xsrc`, `pkgsrc`) and the list of distfiles that belong to Makronix. |
|
||||
| `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 # installworld over a running Makronix/NetBSD only
|
||||
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, the pins and the Makronix distfiles — 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.
|
||||
@@ -32,7 +32,9 @@ Records by area; each file's first lines name source and date.
|
||||
- Removed text kept whole: `agents-history-2026-11-13.txt` (root
|
||||
`AGENTS.md`), `tools-agents-history-2026-11-13.txt` (the AGENTS.md files of
|
||||
`tools/`, `.claude/`, `www/`, `ext/`, `docs/`, `refs/` before they were
|
||||
shortened).
|
||||
shortened). `.claude/` itself was removed from the repository on
|
||||
2026-11-22; `AGENTS.md` is the harness-independent convention. The history
|
||||
files keep their original wording.
|
||||
|
||||
## What may be changed
|
||||
|
||||
|
||||
+2
-2
@@ -118,8 +118,8 @@ MCDE and the logo:
|
||||
- `logo-ascii.sh`, `theme-logo.sh` -- the logo as ASCII, and in a palette's
|
||||
colours (`docs/logo/AGENTS.md`).
|
||||
|
||||
`claude-build-gate.sh` -- PreToolUse hook that enforces the forbidden commands
|
||||
(root `AGENTS.md`, `.claude/AGENTS.md`). Its match is textual: a command that
|
||||
`claude-build-gate.sh` -- build gate that enforces the forbidden commands
|
||||
(root `AGENTS.md`). Its match is textual: a command that
|
||||
names `releasedir` and performs hand work on it (`rm`, `mv`, `cp`, `touch`,
|
||||
`chmod`, `mkdir`, `sed -i`, `tee`, or a shell redirection whose target path is
|
||||
under `releasedir`) is refused. A read-only command that only redirects
|
||||
|
||||
Reference in new issue
Block a user