serial_enter_uboot
Reboot the device and interrupt autoboot to enter the U-Boot prompt. Configurable detection handles autoboot stop, prompt matching, and fast fails for kernel boot or login states.
Instructions
Enter U-Boot by rebooting the device and stopping autoboot. Detection rules (autoboot prompts, command prompt, verify env keys) are configurable via device config serial.uboot; built-in defaults already cover Hit/Press x any-key/key/SPACE/Ctrl+C/Ctrl+u x stop/interrupt/abort wordings. Pre-check before rebooting (buffer tail, zero side effects): already at a U-Boot prompt returns success without rebooting; at a login/Password prompt fails fast ('reboot' would be consumed as input). restart=true forces a reboot cycle even when already at a U-Boot prompt: sends the U-Boot 'reset' command and re-intercepts autoboot to land back in U-Boot (Linux is never involved; the Linux-side path keeps using 'reboot'). Kernel-boot detection and prompt matching are not gated on an interrupt: devices that boot straight to the kernel fail fast, devices that disable autoboot (bootdelay=-2) succeed fast, instead of waiting out the full timeout. After the interrupt, two-layer strategy: prompt match first; if not matched within a short window, sends 'printenv' and verifies U-Boot env keys. Fails fast on kernel boot or verify timeout.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| restart | No | Force a reboot cycle even when the device is already at a U-Boot prompt: sends 'reset' (U-Boot's reboot command) and re-intercepts autoboot to land back in U-Boot — Linux is never involved. Default false returns success without rebooting when already in U-Boot. | |
| timeoutMs | No | Total timeout in ms to wait for the autoboot prompt after reboot (default: 60000 = 60s). Entering U-Boot requires a full device reboot, so the wait is genuinely long — scale generously and convert seconds to ms by multiplying by 1000 (e.g. 90s = 90000). | |
| session_id | Yes | The session ID returned by serial_open |