async fn stage_images(
        &mut self,
        co: &mut async_generator::Yield<State>,
        state: &mut state::Stage,
        update_pkg: &UpdatePackage,
        mode: UpdateMode,
        current_configuration: paver::CurrentConfiguration,
    ) -> Result<(), Error> {
        let image_list = [
            ImageType::Bootloader,
            ImageType::Firmware,
            ImageType::Zbi,
            ImageType::ZbiSigned,
            ImageType::FuchsiaVbmeta,
            ImageType::Zedboot,
            ImageType::ZedbootSigned,
            ImageType::Recovery,
            ImageType::RecoveryVbmeta,
        ];

        let images = update_pkg
            .resolve_images(&image_list[..])
            .await
            .context("while determining which images to write")?;

        let images = images
            .verify(mode)
            .context("while ensuring the target images are compatible with this update mode")?
            .filter(|image| {
                if self.config.should_write_recovery {
                    true
                } else {
                    if image.classify().targets_recovery() {
                        fx_log_info!("Skipping recovery image: {}", image.name());
                        false
                    } else {
                        true
                    }
                }
            });

        fx_log_info!("Images to write: {:?}", images);

        let desired_config = current_configuration.to_non_current_configuration();
        fx_log_info!("Targeting configuration: {:?}", desired_config);

        write_images(&self.env.data_sink, &update_pkg, desired_config, images.iter()).await?;
        match mode {
            UpdateMode::Normal => {
                let () =
                    paver::set_configuration_active(&self.env.boot_manager, desired_config).await?;
            }
            UpdateMode::ForceRecovery => {
                let () = paver::set_recovery_configuration_active(&self.env.boot_manager).await?;
            }
        }
        let () = paver::flush(&self.env.data_sink, &self.env.boot_manager, desired_config).await?;

        state.add_progress(co, 1).await;

        Ok(())
    }
/// Pave the various raw images (zbi, bootloaders, vbmeta), and configure the non-current
/// configuration as active for the next boot.
Pave the various raw images (zbi, bootloaders, vbmeta), and configure the non-current
configuration as active for the next boot.
Pave the various raw images ( zbi bootloaders vbmeta ) and configure the non - current configuration as active for the next boot .
async fn stage_images(
        &mut self,
        co: &mut async_generator::Yield<State>,
        state: &mut state::Stage,
        update_pkg: &UpdatePackage,
        mode: UpdateMode,
        current_configuration: paver::CurrentConfiguration,
    ) -> Result<(), Error> {
        let image_list = [
            ImageType::Bootloader,
            ImageType::Firmware,
            ImageType::Zbi,
            ImageType::ZbiSigned,
            ImageType::FuchsiaVbmeta,
            ImageType::Zedboot,
            ImageType::ZedbootSigned,
            ImageType::Recovery,
            ImageType::RecoveryVbmeta,
        ];
        let images = update_pkg
            .resolve_images(&image_list[..])
            .await
            .context("while determining which images to write")?;
        let images = images
            .verify(mode)
            .context("while ensuring the target images are compatible with this update mode")?
            .filter(|image| {
                if self.config.should_write_recovery {
                    true
                } else {
                    if image.classify().targets_recovery() {
                        fx_log_info!("Skipping recovery image: {}", image.name());
                        false
                    } else {
                        true
                    }
                }
            });
        fx_log_info!("Images to write: {:?}", images);
        let desired_config = current_configuration.to_non_current_configuration();
        fx_log_info!("Targeting configuration: {:?}", desired_config);
        write_images(&self.env.data_sink, &update_pkg, desired_config, images.iter()).await?;
        match mode {
            UpdateMode::Normal => {
                let () =
                    paver::set_configuration_active(&self.env.boot_manager, desired_config).await?;
            }
            UpdateMode::ForceRecovery => {
                let () = paver::set_recovery_configuration_active(&self.env.boot_manager).await?;
            }
        }
        let () = paver::flush(&self.env.data_sink, &self.env.boot_manager, desired_config).await?;
        state.add_progress(co, 1).await;
        Ok(())
    }
async fn stage_images ( & mut self , co : & mut async_generator :: Yield < State > , state : & mut state :: Stage , update_pkg : & UpdatePackage , mode : UpdateMode , current_configuration : paver :: CurrentConfiguration , ) -> Result < ( ) , Error > { let image_list = [ ImageType :: Bootloader , ImageType :: Firmware , ImageType :: Zbi , ImageType :: ZbiSigned , ImageType :: FuchsiaVbmeta , ImageType :: Zedboot , ImageType :: ZedbootSigned , ImageType :: Recovery , ImageType :: RecoveryVbmeta , ] ; let images = update_pkg . resolve_images ( & image_list [ .. ] ) . await . context ( " " ) ? ; let images = images . verify ( mode ) . context ( " " ) ? . filter ( | image | { if self . config . should_write_recovery { true } else { if image . classify ( ) . targets_recovery ( ) { fx_log_info ! ( " " image name ( ) ) ; false } else { true } } } ) ; fx_log_info ! ( " " images ) ; let desired_config = current_configuration . to_non_current_configuration ( ) ; fx_log_info ! ( " " desired_config ) ; write_images ( & self . env . data_sink , & update_pkg , desired_config , images . iter ( ) ) . await ? ; match mode { UpdateMode :: Normal => { let ( ) = paver :: set_configuration_active ( & self . env . boot_manager , desired_config ) . await ? ; } UpdateMode :: ForceRecovery => { let ( ) = paver :: set_recovery_configuration_active ( & self . env . boot_manager ) . await ? ; } } let ( ) = paver :: flush ( & self . env . data_sink , & self . env . boot_manager , desired_config ) . await ? ; state . add_progress ( co , 1 ) . await ; Ok ( ( ) ) }
Pave the various raw images (zbi, bootloaders, vbmeta), and configure the non-current
configuration as active for the next boot.
Pave the various raw images ( zbi bootloaders vbmeta ) and configure the non - current configuration as active for the next boot .
&mut self
co
&mut async_generator::Yield<State>
state
&mut state::Stage
update_pkg
&UpdatePackage
mode
UpdateMode
current_configuration
paver::CurrentConfiguration
&mut self
co
&mut async_generator::Yield<State>
state
&mut state::Stage
update_pkg
&UpdatePackage
mode
UpdateMode
current_configuration
paver::CurrentConfiguration