|  | 
|  | 1 | +// This Source Code Form is subject to the terms of the Mozilla Public | 
|  | 2 | +// License, v. 2.0. If a copy of the MPL was not distributed with this | 
|  | 3 | +// file, You can obtain one at https://mozilla.org/MPL/2.0/. | 
|  | 4 | + | 
|  | 5 | +//! Module containing types for updating RoT Bootloaders via MGS. | 
|  | 6 | +
 | 
|  | 7 | +use super::MgsClients; | 
|  | 8 | +use crate::SpComponentUpdateHelper; | 
|  | 9 | +use crate::common_sp_update::PrecheckError; | 
|  | 10 | +use crate::common_sp_update::PrecheckStatus; | 
|  | 11 | +use futures::future::BoxFuture; | 
|  | 12 | +use nexus_types::deployment::PendingMgsUpdate; | 
|  | 13 | + | 
|  | 14 | +type GatewayClientError = gateway_client::Error<gateway_client::types::Error>; | 
|  | 15 | + | 
|  | 16 | +pub struct ReconfiguratorRotBootloaderUpdater; | 
|  | 17 | +impl SpComponentUpdateHelper for ReconfiguratorRotBootloaderUpdater { | 
|  | 18 | +    /// Checks if the component is already updated or ready for update | 
|  | 19 | +    fn precheck<'a>( | 
|  | 20 | +        &'a self, | 
|  | 21 | +        _log: &'a slog::Logger, | 
|  | 22 | +        _mgs_clients: &'a mut MgsClients, | 
|  | 23 | +        _update: &'a PendingMgsUpdate, | 
|  | 24 | +    ) -> BoxFuture<'a, Result<PrecheckStatus, PrecheckError>> { | 
|  | 25 | +        // TODO-K: To be completed in a follow up PR | 
|  | 26 | +        todo!() | 
|  | 27 | +    } | 
|  | 28 | + | 
|  | 29 | +    /// Attempts once to perform any post-update actions (e.g., reset the | 
|  | 30 | +    /// device) | 
|  | 31 | +    fn post_update<'a>( | 
|  | 32 | +        &'a self, | 
|  | 33 | +        _log: &'a slog::Logger, | 
|  | 34 | +        _mgs_clients: &'a mut MgsClients, | 
|  | 35 | +        _update: &'a PendingMgsUpdate, | 
|  | 36 | +    ) -> BoxFuture<'a, Result<(), GatewayClientError>> { | 
|  | 37 | +        // TODO-K: To be completed in a follow up PR | 
|  | 38 | +        todo!() | 
|  | 39 | +    } | 
|  | 40 | +} | 
0 commit comments