fix(gui): bench driver uses the alkane root credential for the restore leg

The flag-restore reaches the running alkane board over SSH as root, which is a
different credential from the stock login used for install. Alkane bench images
bake root/alkane; pass that (overridable via ALKANE_ROOT_PASSWORD) to the
restore, and keep the saved board SSH credential for the install. The previous
single-credential handoff sent the stock login to the alkane root restore and
hit "Permission denied".

Hardware note (2026-11-16): the PHY-fixed afw installs and comes up REACHABLE on
alkane (both the image PHY fix and the driver's MAC rediscovery proven); the
in-band flag-restore still needs the alkane DTB to expose the `misc` MTD (it
currently exposes only nvdata), tracked separately.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qKwKxq3oUPDKWicM6i
This commit is contained in:
2026-11-16 22:42:05 -06:00
co-authored by Claude Opus 4.8
parent f6c740bc24
commit 71ab5a957c
+14 -9
View File
@@ -228,17 +228,22 @@ pub fn run(spec: &str) -> i32 {
};
let iterations: u32 = it.next().and_then(|s| s.parse().ok()).unwrap_or(1);
let board = "a113d".to_string();
// The A113D flag-restore reaches the running alkane board over SSH as root,
// so use the saved SSH credential (not the web/API one). Install reaches
// stock via the compiled-in method (its own root access); the same password
// is passed through, matching the GUI's single-credential model.
let password = credentials::load_ssh_credentials().map(|(_, p)| p);
// Install reaches STOCK via the compiled-in from-stock method; pass the saved
// board SSH credential through to it.
let stock_password = credentials::load_ssh_credentials().map(|(_, p)| p);
// The flag-restore reaches the running ALKANE board over SSH as `root` - a
// DIFFERENT credential from the stock login. Alkane bench images bake
// root/alkane; allow an override via ALKANE_ROOT_PASSWORD.
let alkane_password = std::env::var("ALKANE_ROOT_PASSWORD")
.ok()
.or_else(|| Some("alkane".to_string()));
println!("== A113D headless GUI bench sequence (network-only install <-> flag-restore) ==");
println!(
"host={host} afw={} board={board} iterations={iterations} credential={}",
"host={host} afw={} board={board} iterations={iterations} stock_cred={} alkane_cred={}",
afw.display(),
if password.is_some() { "loaded" } else { "none" }
if stock_password.is_some() { "loaded" } else { "none" },
if alkane_password.is_some() { "set" } else { "none" }
);
if !afw.exists() {
eprintln!("afw not found: {}", afw.display());
@@ -266,7 +271,7 @@ pub fn run(spec: &str) -> i32 {
board.clone(),
AfwSource::Local(afw.clone()),
true, // allow unsigned (bench image)
password.clone(),
stock_password.clone(),
false, // not an in-place update
);
if !drive("install", h) {
@@ -286,7 +291,7 @@ pub fn run(spec: &str) -> i32 {
// 3. restore (alkane -> stock) flag-flip at the board's CURRENT address
println!("[3/4] restore: alkane -> stock (flag flip) at {alkane_ip}");
let h = stock_ops::start_restore_flag(vec![alkane_ip.clone()], password.clone());
let h = stock_ops::start_restore_flag(vec![alkane_ip.clone()], alkane_password.clone());
if !drive("restore", h) {
all_ok = false;
println!("[3/4] restore FAILED");