Add catch for uboot
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

Apparently, you can just run "boot" in a uboot prompt to get to the
login prompt.
This commit is contained in:
Blizzard Finnegan 2023-06-27 09:00:06 -04:00
parent c6c34462bb
commit 32789a4546
Signed by: blizzardfinnegan
GPG key ID: 61C1E13067E0018E
2 changed files with 5 additions and 2 deletions

View file

@ -115,8 +115,9 @@ impl Device{
initial_state = State::LoginPrompt;
},
Response::UBoot=>{
log::error!("A device was interrupted during the boot process! Please ensure all devices are completely booted and on the main screen, then restart this program.");
return Err("Failed TTY init. Device in u-boot state, must be manually rebooted.".to_string());
usb_port.write_to_device(Command::Boot);
while usb_port.read_from_device(None) != Response::LoginPrompt {}
initial_state = State::LoginPrompt;
},
//Response::Empty parsing here is potentially in bad faith
Response::Other | Response::Empty | Response::ShellPrompt | Response::FailedDebugMenu | Response::DebugInit |

View file

@ -28,6 +28,7 @@ pub enum Command{
Newline,
Reboot,
GetSerial,
Boot,
}
#[derive(Clone,Eq,Derivative,Debug)]
@ -68,6 +69,7 @@ const COMMAND_MAP:Lazy<HashMap<Command,&str>> = Lazy::new(||HashMap::from([
(Command::DebugMenu,"python3 -m debugmenu\n"),
(Command::Newline,"\n"),
(Command::Reboot,"shutdown -r now\n"),
(Command::Boot,"boot\n"),
(Command::GetSerial,"echo 'y1q' | python3 -m debugmenu\n"),
]));