This commit is contained in:
Michal S.
2026-08-04 17:59:44 +01:00
commit 69071efd58
123 changed files with 7728 additions and 0 deletions
+72
View File
@@ -0,0 +1,72 @@
# MOUSE
MOUSE is the **Monolithic Opinionated Unix-like System Environment**: a small
Linux system with a versioned base, pkgsrc for third-party software, and
`cheesed` as PID 1.
## Build
The build needs Apple Container, Docker, or Podman, plus QEMU and Expect for
the runtime checks.
```sh
make image
make run
make check
```
Artifacts and downloaded sources are kept in `build/`. The default builder has
8 CPUs, 8 GB of memory, and 8 build jobs; override those with
`MOUSE_BUILDER_CPUS`, `MOUSE_BUILDER_MEMORY`, and `MOUSE_BUILD_JOBS`.
`MOUSE_NETWORK=0 make run` disables QEMU networking.
Development images contain `root` and `toor`, both with the password
`cheddar`. `root` uses `/bin/sh` for emergency administration; `toor` uses
`/bin/tcsh` for ordinary administration. Change both passwords before exposing
an image to a network.
## System
The base owns `/bin`, `/sbin`, `/usr/bin`, and `/usr/sbin`; pkgsrc owns
`/usr/local`. `/var`, `/home`, `/srv`, and `/usr/local` are shared by both root
environments, `/etc` follows the selected root, and `/run` is rebuilt at boot.
The fixed `/usr/local` package prefix keeps pkgsrc out of base-owned paths.
Limine boots the default or alternate root from the same disk.
`mouse-bootenv prepare` snapshots the running root into the inactive one;
`activate` selects it and `rollback` selects the other root. Automated base
updates and configuration merging are not implemented yet.
`cheesed` mounts early filesystems, reaps children, supervises services in
cgroups, and handles shutdown. It identifies itself as
`Cheesed to meet you! v0.1.0`. Service definitions live in `/etc/rc.d` and
`/usr/local/etc/rc.d`; dependency cycles, missing facilities, and duplicate
names are rejected.
Persistent service policy lives only in `/etc/rc.conf`:
```sh
enable_network=YES
enable_cron=YES
enable_ntpd=YES
```
Assignments are exactly `enable_NAME=YES` or `enable_NAME=NO`; shell expansion,
includes, and other keys are invalid. `/sbin/service` controls the running
system without editing boot policy.
## Packages
Images contain the pinned pkgsrc 2026Q2 tree in `/usr/local/src/pkgsrc`, with
`bmake` and the package tools under `/usr/local`. Packages use
`/usr/local/etc` for configuration, `/var/db/pkg` for records, and
`/var/cache/pkgsrc` for distfiles and binary packages. This state survives a
base rollback.
## Checks
`make check` builds the assembled disk with test fixtures, then boots it under
QEMU. It covers BIOS and UEFI boot, both Btrfs roots, services and cgroup
cleanup, users, networking, storage tools, native C and C++ compilation, pkgsrc
installation, and persistence across reboots. The build also rejects changed
source checksums and dynamic base executables.