Make clean-clone OS rebuilds autonomous

A fresh clone can now bootstrap a complete armv7 rootfs, apply the Bananarchy overlay, regenerate boot artifacts, and produce a flashable image without local build artifacts.

- Add a shared package list and Docker-based rootfs bootstrap, wired into rebuild-image.sh and chroot-shell.sh.
- Add offline rebuild preflight checks and prebuilt-to-overlay artifact synchronization.
- Vendor the patched EDL client and provision host flashing dependencies.
- Remove the hardcoded credential from the power menu helper.
- Refresh documentation and changelog for the autonomous workflow.
This commit is contained in:
Luxferre committed 2026-11-05 13:40:53 +02:00
1 parent a9b72700ac
commit 0ab9367e28
31 files changed
+3809 -181

No files matched your search

+32 -1
View File
@@ -422,7 +422,8 @@ Three native X11 games (`/usr/bin/snake`, `/usr/bin/tetris`, and `/usr/bin/scoun
## 4. Default credentials, USB SSH, and Bantam AI agent
- **Username**: `user`
- **Password**: `147147` (`doas` and `sudo` enabled, with passwordless `doas` configured for `wheel` in `/etc/doas.d/50-sxmo.conf`)
- **Password**: `147147` (`doas` and `sudo` enabled; `/etc/doas.d/50-sxmo.conf` requires a password for general `wheel` use and grants targeted passwordless rules for system actions)
- **Changing the default password**: set `BANANARCHY_USER_PASSWORD` before bootstrapping a rootfs, or change it on the device with `passwd` or the passcode configurator. The power menu no longer contains any hardcoded credential.
- **USB networking SSH**:
```bash
ssh user@172.16.42.1
@@ -575,3 +576,33 @@ The **Xlibre** display server (`modesetting_drv.so`) uses **Glamor + DRI3 + GLX
bananarchy-gps watch 2 # continuously poll GPS fix and satellite telemetry every 2s
bananarchy-gps disable # stop standalone GNSS engine to save power
```
---
## 6. Rebuilding the OS from a clean clone
A fresh `git clone` is enough to produce a flashable image. Docker, Python 3, and network access are the only host requirements; no pre-existing `rootfs/`, `images/`, or EDL checkout is needed.
```bash
./scripts/check-rebuild.sh # optional offline preflight
./rebuild-image.sh nokia-argon # builds images/bananarchy-nokia-argon.img
```
`rebuild-image.sh` runs the following steps automatically:
1. Verifies shell and Python syntax, the `armv7` package list, plugin artifacts, overlay sync, and the ignored local agent config (`scripts/check-rebuild.sh`).
2. Mirrors `prebuilt/` into `overlay/rootfs/` (`scripts/sync-prebuilt-overlay.sh`).
3. Creates a complete `armv7` rootfs from `scripts/rootfs-packages.txt` when `rootfs/` is missing or stale (`scripts/bootstrap-rootfs.sh`), including system accounts, OpenRC runlevels, base configuration, the overlay, and prebuilt kernel modules.
4. Applies the overlay, regenerates the initramfs with `mkinitfs`, and assembles the partitioned MBR image in `images/`.
Useful overrides and helpers:
```bash
ROOTFS_DIR=/path/to/rootfs IMAGES_DIR=/path/to/images ./rebuild-image.sh nokia-sparkler
BANANARCHY_USER_PASSWORD=1234 ./scripts/bootstrap-rootfs.sh --force
./scripts/bootstrap-rootfs.sh --check # report whether bootstrapping is needed
./chroot-shell.sh # bootstraps rootfs/ before opening a shell
sudo ./flash-edl.sh nokia-argon # uses vendor/edl/ and auto-installs host deps
```
The bootstrap is idempotent: an up-to-date rootfs is left untouched. `prebuilt/` is the single source of truth for compiled artifacts, and `scripts/rootfs-packages.txt` is the single source of truth for the package set. The patched EDL client library is vendored under `vendor/edl/` (MIT), so flashing works from a clean clone without a manual download; `flash-edl.sh` installs `pyusb` and `pyserial` into the gitignored `.flash-deps/` directory when needed.