diff --git a/modules/workflow_serial.py b/modules/workflow_serial.py index 03e0bca..804190a 100644 --- a/modules/workflow_serial.py +++ b/modules/workflow_serial.py @@ -135,6 +135,15 @@ def _login_serial_console(ser: SerialPort) -> tuple: ok("Logged in to IOM console.") return True, password + # "Last login:" in the response confirms the password was accepted — + # the shell prompt just hasn't arrived yet (slow shell init or motd). + # Give it up to 10 more seconds to appear. + if "last login" in response.lower(): + response += _ANSI_RE.sub("", ser.read_until_quiet(quiet_period=1.5, timeout=10.0)) + if _at_shell_prompt(response): + ok("Logged in to IOM console.") + return True, password + error(f"Login failed. Console response: {response.strip()[:120]}") return False, ""