Skip to content

Commit 7687825

Browse files
karencfviliana
authored andcommitted
[mgs-updates] RoT bootloader FirstPageErased error should be ignored (#8955)
As per #8044 (comment) , the `RotImageError::FirstPageErased` error for the RoT bootloader is not fatal, and should not be treated as such. This patch does two things: 1. Interprets the error response from the SP as an invalid caboose when retrieving caboose information 2. Carries on updating the RoT bootloader when when it finds this error during an image signature check. Closes #8045
1 parent dc76036 commit 7687825

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

nexus/mgs-updates/src/common_sp_update.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,4 +322,5 @@ pub(crate) fn error_means_caboose_is_invalid(
322322
let message = format!("{error:?}");
323323
message.contains("the image caboose does not contain")
324324
|| message.contains("the image does not include a caboose")
325+
|| message.contains("failed to read data from the caboose")
325326
}

nexus/mgs-updates/src/rot_bootloader_updater.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,16 @@ impl SpComponentUpdateHelperImpl for ReconfiguratorRotBootloaderUpdater {
200200
// stage0_next, the device won't let us load this image onto stage0.
201201
// We return a fatal error.
202202
if let Some(e) = stage0next_error {
203-
return Err(PostUpdateError::FatalError {
204-
error: InlineErrorChain::new(&e).to_string(),
205-
});
203+
// With some RoT bootloaders in manufacturing, it isn't strictly
204+
// necessary to go through our update process and stage0next will
205+
// still be erased. This raises an FirstPageErased error, but it
206+
// doesn't mean that we should stop the update process. We
207+
// ignore it.
208+
if e != RotImageError::FirstPageErased {
209+
return Err(PostUpdateError::FatalError {
210+
error: InlineErrorChain::new(&e).to_string(),
211+
});
212+
}
206213
}
207214

208215
// This operation is very delicate. Here, we're overwriting the

0 commit comments

Comments
 (0)