Files
src/README.md
T

94 lines
3.7 KiB
Markdown

# MOUSE
MOUSE is the **Monolithic Opinionated Unix-like System Environment**: a small
Linux system with a versioned base, mouse-ports 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
```
The guest defaults to the host architecture, so Apple Silicon builds AArch64.
Set `MOUSE_ARCH=x86_64` or `MOUSE_ARCH=aarch64` to override it. An explicit
`MOUSE_BUILDER_PLATFORM` supplies the default architecture only when
`MOUSE_ARCH` is unset, so `MOUSE_ARCH=x86_64 MOUSE_BUILDER_PLATFORM=linux/arm64`
cross-builds an x86_64 guest on the Arm builder. Architecture-specific artifacts
live under `build/x86_64/` and `build/aarch64/`; downloaded sources are shared
under `build/sources/`.
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. `MOUSE_GRAPHICAL=1 make
run` opens QEMU's graphical display while retaining the serial console in the
terminal.
VM images use the hostname `mousehole` and provide the administrator account
`mouse` with the password `cheddar`. The account is a member of `wheel` and can
elevate through `doas`; direct `root` and `toor` password authentication remains
locked.
## System
The base owns `/bin`, `/sbin`, `/usr/bin`, and `/usr/sbin`; mouse-ports 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 ports 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_gardendevd=YES
enable_seatd=YES
enable_greetd=YES
enable_wpa_supplicant=NO
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.
The x86_64 kernel includes common laptop and desktop storage, USB, input,
wired-network, Intel Wi-Fi, and Atheros Wi-Fi drivers. Images ship the complete
pinned linux-firmware collection. To configure Wi-Fi, write a mode-0600
`/etc/wpa_supplicant/wpa_supplicant.conf` with `wpa_passphrase`, set
`enable_wpa_supplicant=YES` in `/etc/rc.conf`, and reboot; gardendevd loads drivers
for devices present at boot or plugged in later.
## Packages
Images contain the MOUSE ports tree in `/usr/local/src/mouse-ports`, with
source-built `bmake` under `/usr/local`. Ports use `/usr/local/etc` for
configuration, `/var/db/mouse/packages` for installation records, and
`/var/cache/mouse/ports` for verified distfiles. This state survives a base
rollback.
## Checks
`make check` builds the assembled disk with test fixtures, then boots it under
QEMU. It covers UEFI boot on both architectures and BIOS on x86_64, both Btrfs roots, services and cgroup
cleanup, users, networking, storage tools, native C and C++ compilation, ports
layout, and persistence across reboots. The build also rejects changed
source checksums and dynamic base executables.