Integrate the SDK installer into the toolkit so it can put alkane-os on a compatible miner (for now the Antminer S17 / zynq-7010) from a local .afw or an auto-pulled latest release, and remove it (back to stock). Release host is the self-hosted Gitea (GitHub is retired). - FIX (brick risk): boards/zynq.rs carried the superseded stage-2 offsets (BOOTBIN_PRESERVE 0x2200000, kernel 0x2200000, dtb 0x2700000). Corrected to the live S17 / SDK-plan layout: BOOT.bin floor 0x1a00000, dtb 0x1a00000, kernel 0x2000000 (slot 0x800000), rootfs mtd1. The tier-2 update now writes the right slots; test updated to the new ceiling. - alkane-artifacts/fetch.rs: resolve and download the latest .afw for a board from Gitea releases/latest (curl + serde_json), token read from ALKANE_RELEASE_TOKEN/GITEA_TOKEN at run time and passed via a 0600 curl config, never argv, never stored. - alkane-flash/stock.rs: the seam to the sealed, DSH-owned stock-side methods (install-from-stock, restore-to-stock). Interface only - an external ALKANE_STOCK_HELPER the toolkit invokes and then verifies the board itself; the method is never embedded, read, or reviewed here. - alkane-cli: new `afw compat` (shows supported boards), `afw fetch-latest`, `afw install --latest [--board] [--from-stock]`, and `afw restore-stock`. The install/restore commands gate on a supported board. --from-stock routes the first install through the sealed helper; the default install path is the tier-2 update of a board already on alkane. - docs/install.md documents the flow and the two env seams. alkane-artifacts + alkane-flash + alkane-cli build clean, 71 tests pass, the new files are clippy-clean (the one type_complexity warning is pre-existing in afw.rs, untouched). No emojis. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BdKQBPjAXpCwmigUov5eQk
72 lines
2.3 KiB
Markdown
72 lines
2.3 KiB
Markdown
# Installing and removing alkane-os
|
|
|
|
The CLI (`alkane-cli afw ...`) is the supported flashing path. In-app (GUI)
|
|
flashing is disabled while that path is reworked; it will call the same engine.
|
|
|
|
## Compatible miners
|
|
|
|
```
|
|
alkane-cli afw compat
|
|
```
|
|
|
|
Lists the control boards alkane-os can be installed on. For now that is the
|
|
Antminer S17 (`zynq-7010`). The install/restore commands refuse any board whose
|
|
`.afw` is not one of these.
|
|
|
|
## Install
|
|
|
|
From a local bundle:
|
|
|
|
```
|
|
alkane-cli afw install path/to/alkane-os-<ver>-zynq-7010-armv7.afw \
|
|
--host <miner-ip> --confirm FLASH
|
|
```
|
|
|
|
From the latest release (pulled from Gitea, not GitHub, which is retired):
|
|
|
|
```
|
|
alkane-cli afw install --latest --board zynq-7010 --host <miner-ip> --confirm FLASH
|
|
# or fetch only:
|
|
alkane-cli afw fetch-latest --board zynq-7010 --output ./downloads
|
|
```
|
|
|
|
A private release repo needs a token, read from `ALKANE_RELEASE_TOKEN` (else
|
|
`GITEA_TOKEN`) at run time and passed to curl through a 0600 config file - never
|
|
on the command line, never stored by the toolkit.
|
|
|
|
### A board still on stock
|
|
|
|
Writing our first image onto a board that is still on genuine stock (past the
|
|
stock gates and getting root) is done by a sealed helper, not by this toolkit.
|
|
Point `ALKANE_STOCK_HELPER` at that helper and add `--from-stock`:
|
|
|
|
```
|
|
ALKANE_STOCK_HELPER=/path/to/helper \
|
|
alkane-cli afw install --latest --board zynq-7010 --host <miner-ip> \
|
|
--from-stock --confirm FLASH
|
|
```
|
|
|
|
The toolkit acquires and verifies the `.afw`, gates on compatibility, invokes
|
|
the helper for the stock-side step, then you verify the board came up as alkane:
|
|
|
|
```
|
|
alkane-cli afw verify-live --host <miner-ip> --timeout 300
|
|
```
|
|
|
|
Without `--from-stock`, `install` performs a tier-2 update of a board already on
|
|
alkane: it writes the dtb (`/dev/mtd0 @ 0x1a00000`), the kernel
|
|
(`/dev/mtd0 @ 0x2000000`) and the rootfs (`/dev/mtd1`), holds a backup of each,
|
|
reads them back (md5), and never writes `/dev/mtd0` below `0x1a00000`
|
|
(BOOT.bin/FSBL/FPGA/U-Boot are preserved).
|
|
|
|
## Remove (back to stock)
|
|
|
|
```
|
|
ALKANE_STOCK_HELPER=/path/to/helper \
|
|
alkane-cli afw restore-stock --host <miner-ip> --confirm FLASH
|
|
```
|
|
|
|
Returning an aftermarket board to genuine stock is also the sealed helper's job.
|
|
The toolkit orchestrates and then you verify independently that the board no
|
|
longer answers as alkane and presents its stock OS.
|