image: build the console into a zynq-7010 .afw + fix serve_only API bind

Produce a flashable zynq-7010 image carrying the current console, and make the
image serve it on boot.

- image/make-zynq-afw.sh: cross-compiles alkane-os for armv7 (static musl,
  matching the SDK rootfs; the ARM cross-gcc is the linker since the host cc
  cannot link ARM objects), drops the binary and the image overlay into the SDK's
  zynq rootfs, repacks the ramdisk under fakeroot (device nodes + root ownership
  preserved), and packages zImage + dtb + rootfs into a .afw via ci/make-afw.sh.
- image/overlay/etc/init.d/S60alkane-web: starts `alkane-os --serve` after the
  network, so the booted image serves the console (login + read-only API) on :80.
  The SDK init owns board-detect/network/ssh and leaves the console to this.
- main.rs: fix serve_only to default the cgminer API to loopback (127.0.0.1:4028)
  instead of 0.0.0.0, which bind_local (loopback-only) rejected - so plain
  `--serve` now starts instead of failing to bind.

Verified: the build produces dist/alkane-os-0.1.0-zynq-7010-armv7.afw (check-afw
OK: kernel 4.3MB, dtb 11KB, rootfs 3.26MB), the rootfs carries the new binary +
the web-init overlay, and the static armv7 binary runs under qemu-arm and serves
the console end to end (login page renders, admin/admin -> 303 session,
/api/hardware open). dist/ is gitignored, so the artifact is not committed.
clippy -D warnings clean, no emojis.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBPjAXpCwmigUov5eQk
This commit is contained in:
2026-11-10 21:26:53 -06:00
co-authored by Claude Opus 4.8
parent 34bccbd437
commit 18b5fac584
3 changed files with 122 additions and 1 deletions
+3 -1
View File
@@ -455,7 +455,9 @@ fn serve_only() -> Result<(), Box<dyn std::error::Error>> {
.ok()
.map(|bind| bind.parse())
.transpose()?;
let api = api.or(Some("0.0.0.0:4028".parse()?));
// The cgminer-style API is loopback-only (reach it through SSH); default to
// loopback so `--serve` starts even when ALKANE_API_LISTEN is unset.
let api = api.or(Some("127.0.0.1:4028".parse()?));
let control = Arc::new(Control::default());
let bus = Bus::new();
service::register(&bus, Arc::clone(&status), Arc::clone(&control));