# Installing and removing alkane-os Two front-ends drive the same self-contained engine: - The CLI (`alkane-cli afw ...`), documented below, is the scriptable path. - The GUI (`alkane-toolkit`) can scan the fleet, then right-click a board to install alkane-os onto it from stock or restore it to stock. See "GUI (right-click install / uninstall)" at the end. (The GUI's older asic-rs firmware-upload path stays disabled; these two actions use the compiled-in network-only engine, the same one the CLI uses.) ## 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--zynq-7010-armv7.afw \ --host --confirm FLASH ``` From the latest release (pulled from Gitea, not GitHub, which is retired): ``` alkane-cli afw install --latest --board zynq-7010 --host --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 the toolkit itself, over the network. The method is part of this binary; nothing else needs to be installed on your machine. On first use it fetches a small set of per-board assets from our Gitea (repo `blueflare/alkane-stock-assets`, release `zynq-7010-v1`) and caches them locally, verifying each against a known SHA-256. That repo is public, so no token is needed for the stock assets. The asset base URL can be overridden with `ALKANE_STOCK_ASSETS_BASE`. Add `--from-stock` (the token below is only to resolve `--latest` from the private alkane-os release repo; a local `.afw` needs no token): ``` export ALKANE_RELEASE_TOKEN= alkane-cli afw install --latest --board zynq-7010 --host \ --from-stock --confirm FLASH ``` The toolkit acquires and verifies the `.afw`, gates on compatibility, fetches and verifies its assets, performs the network-only stock-side install, then you verify the board came up as alkane: ``` alkane-cli afw verify-live --host --timeout 300 ``` For a bench image that is not signed, add `--allow-unsigned`. 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) ``` export ALKANE_RELEASE_TOKEN= alkane-cli afw restore-stock --host \ --password-file --confirm FLASH ``` Returning an aftermarket board to genuine stock is also done by the toolkit itself, over the network. It uses the same per-board assets (fetched/cached as above from the now-public assets repo, so no token is needed) and the board's alkane root credential (`--password-file`, or `ALKANE_BOARD_PASSWORD`/`ALKANE_BOARD_PASSWORD_FILE`). You then verify independently that the board no longer answers as alkane and presents its stock OS. ## GUI (right-click install / uninstall) The GUI binary is `alkane-toolkit`. Launch it, let the scan list the fleet, then right-click one or more boards and choose: - "Install alkane OS (from stock)..." - scans the alkane-os releases on Gitea, lets you pick one (newest first; pre-releases are marked), optionally takes a board password and an "allow unsigned .afw (bench)" toggle, and - after you type FLASH to confirm - downloads/verifies the `.afw` and installs it onto each selected board over the network, via the same compiled-in from-stock engine the CLI uses. - "Uninstall alkane OS (restore to stock)..." - takes the board's alkane root password and a typed FLASH confirmation, then restores each selected board to genuine stock over the network. Progress and per-board results appear on the status bar; verify board state independently afterwards (the GUI does not claim liveness on its own). Release scanning reads the private `alkane-os` repo, so it needs a Gitea token. A read-only token can be baked into the GUI at build time (`ALKANE_EMBEDDED_TOKEN=` when building), so the shipped binary scans releases with no setup; otherwise set `ALKANE_RELEASE_TOKEN` (or `GITEA_TOKEN`) in the environment before launching. The stock-asset fetch needs no token (that repo is public), so install-from-stock and restore-to-stock work without one - only the release picker needs it. Runtime dependencies (Linux): the GUI links wxWidgets 3.2 (wxGTK) and GTK 3, so the target machine needs `libwxgtk3.2-1` and `libgtk-3-0` installed.