diff --git a/Cargo.lock b/Cargo.lock index 612b01d61..bd80cb543 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2891,6 +2891,7 @@ dependencies = [ "ticktimer-server", "trng", "tts-frontend", + "usb-device-xous", "utralib", "xous", "xous-ipc 0.9.7", diff --git a/services/root-keys/Cargo.toml b/services/root-keys/Cargo.toml index ad698fb48..640e4c9ab 100644 --- a/services/root-keys/Cargo.toml +++ b/services/root-keys/Cargo.toml @@ -48,6 +48,7 @@ tts-frontend = {path="../tts"} # aes-gcm-siv = {version = "0.11.0-pre", default-features = false, features = ["alloc"]} aes-gcm-siv = {git="https://github.com/RustCrypto/AEADs.git", branch="master"} subtle = {version = "2.4.1", default-features = false} +usb-device-xous = {path="../usb-device-xous"} # private keys #sha2 = {version = "0.9.5", default-features = false, features = []} diff --git a/services/root-keys/src/main.rs b/services/root-keys/src/main.rs index 956264a07..f2ec92322 100644 --- a/services/root-keys/src/main.rs +++ b/services/root-keys/src/main.rs @@ -1278,6 +1278,10 @@ fn main() -> ! { }), Some(Opcode::TryNoKeySocUpdate) => msg_blocking_scalar_unpack!(msg, _, _, _, _, { if keys.try_nokey_soc_update(&mut rootkeys_modal, main_cid) { + // this will unblock the status thread, but also pop up our reboot flow + send_message(main_cid, + xous::Message::new_scalar(Opcode::UxTryReboot.to_usize().unwrap(), 0, 0, 0, 0) + ).expect("couldn't initiate dialog box"); xous::return_scalar(msg.sender, 1).unwrap(); } else { xous::return_scalar(msg.sender, 0).unwrap(); @@ -1377,6 +1381,9 @@ fn main() -> ! { // this final statement has a take/unwrap to set backup_header back to None match keys.write_backup(backup_header.take().unwrap(), backup_ct) { Ok(_) => { + let usbd = usb_device_xous::UsbHid::new(); + usbd.switch_to_core(usb_device_xous::UsbDeviceType::Debug).unwrap(); + usbd.debug_usb(Some(false)).unwrap(); modals.show_notification(t!("rootkeys.backup_staged", xous::LANG), Some("https://github.com/betrusted-io/betrusted-wiki/wiki/Backups")).ok(); } Err(_) => { diff --git a/services/status/src/main.rs b/services/status/src/main.rs index 8c25dae87..e5640a868 100644 --- a/services/status/src/main.rs +++ b/services/status/src/main.rs @@ -473,7 +473,7 @@ fn wrapped_main() -> ! { }); if let Some(staged) = staged_sv { let soc = llio.soc_gitrev().expect("error querying SoC gitrev; this is fatal"); - if staged > soc { + if (staged > soc) && !soc_updated { // if the soc was updated, we should reboot before we try this if keys.lock().unwrap().prompt_for_update() { // prompt to apply the update modals.add_list_item(t!("rootkeys.gwup.yes", xous::LANG)).expect("couldn't build radio item list");