diff --git a/services/root-keys/src/api.rs b/services/root-keys/src/api.rs index 423452f76..1a72dc103 100644 --- a/services/root-keys/src/api.rs +++ b/services/root-keys/src/api.rs @@ -257,6 +257,7 @@ impl Default for BackupHeaderIpc { } pub const BACKUP_VERSION: u32 = 0x00_01_00_01; +pub const BACKUP_VERSION_MASK: u32 = 0xFF_FF_00_00; // mask off bits that are cross-compatible #[repr(u32)] #[derive(Copy, Clone, PartialEq, Eq, Debug)] diff --git a/services/root-keys/src/implementation.rs b/services/root-keys/src/implementation.rs index 668b75245..7176db4eb 100644 --- a/services/root-keys/src/implementation.rs +++ b/services/root-keys/src/implementation.rs @@ -2645,7 +2645,7 @@ impl<'a> RootKeys { let backup = &kernel[KERNEL_BACKUP_OFFSET as usize..KERNEL_BACKUP_OFFSET as usize + size_of::()]; let mut header = BackupHeader::default(); header.as_mut().copy_from_slice(backup); - if header.version == BACKUP_VERSION { + if (header.version & BACKUP_VERSION_MASK) == (BACKUP_VERSION & BACKUP_VERSION_MASK) { Some(header) } else { None diff --git a/services/status/src/main.rs b/services/status/src/main.rs index 4027c169b..9276bb6ba 100644 --- a/services/status/src/main.rs +++ b/services/status/src/main.rs @@ -464,7 +464,7 @@ fn wrapped_main() -> ! { _ => log::warn!("backup record was found, but it has an improper operation field: {:?}", header.op), } } - _ => {}, // no backup header found, continue with boot + _ => log::info!("No backup header found"), // no backup header found, continue with boot } // check for gateware updates diff --git a/tools/restore.py b/tools/restore.py index 0252d76f6..fd7115539 100644 --- a/tools/restore.py +++ b/tools/restore.py @@ -582,6 +582,7 @@ def main(): # this list should visit kernels in order from newest to oldest. URL_LIST = [ 'https://ci.betrusted.io/releases/v0.9.9/', + 'https://ci.betrusted.io/latest-ci/', # prefer stable, but fallback to latest-ci if the kernels are too old 'https://ci.betrusted.io/releases/v0.9.8/', 'https://ci.betrusted.io/releases/v0.9.7/' ]