diff --git a/src/device.rs b/src/device.rs index 9357d91..0f48f61 100755 --- a/src/device.rs +++ b/src/device.rs @@ -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 | diff --git a/src/tty.rs b/src/tty.rs index 87076d5..876532b 100755 --- a/src/tty.rs +++ b/src/tty.rs @@ -28,6 +28,7 @@ pub enum Command{ Newline, Reboot, GetSerial, + Boot, } #[derive(Clone,Eq,Derivative,Debug)] @@ -68,6 +69,7 @@ const COMMAND_MAP:Lazy> = 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"), ]));