def populate(self, parameters): self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) if self.test_needs_overlay(parameters): self.internal_pipeline.add_action(CustomisationAction()) self.internal_pipeline.add_action(OverlayAction()) # Check if the device has a power command such as HiKey, Dragonboard, # etc. against device that doesn't like Nexus, etc. if self.job.device.get('fastboot_via_uboot', False): self.internal_pipeline.add_action(ConnectDevice()) self.internal_pipeline.add_action(UBootEnterFastbootAction()) elif self.job.device.power_command: self.force_prompt = True self.internal_pipeline.add_action(ConnectDevice()) self.internal_pipeline.add_action(ResetDevice()) else: self.internal_pipeline.add_action(EnterFastbootAction()) self.internal_pipeline.add_action(WaitUSBDeviceAction( device_actions=['add'])) fastboot_dir = self.mkdtemp() image_keys = list(parameters['images'].keys()) image_keys.sort() for image in image_keys: if image != 'yaml_line': self.internal_pipeline.add_action(DownloaderAction(image, fastboot_dir)) if parameters['images'][image].get('apply-overlay', False): if self.test_needs_overlay(parameters): self.internal_pipeline.add_action( ApplyOverlaySparseImage(image)) if self.test_needs_overlay(parameters) and \ self.test_needs_deployment(parameters): self.internal_pipeline.add_action( DeployDeviceEnvironment()) self.internal_pipeline.add_action(LxcAddDeviceAction()) self.internal_pipeline.add_action(FastbootFlashAction())
def populate(self, parameters): self.expect_shell = parameters.get('expect_shell', True) self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) self.internal_pipeline.add_action(BootloaderSecondaryMedia()) self.internal_pipeline.add_action(BootloaderCommandOverlay()) self.internal_pipeline.add_action(ConnectDevice()) # FIXME: reset_device is a hikey hack due to fastboot/OTG issues # remove as part of LAVA-940 - convert to use fastboot-sequence reset_device = self.job.device['actions']['boot']['methods'].get( 'grub-efi', {}).get('reset_device', True) if parameters['method'] == 'grub-efi' and reset_device: # added unless the device specifies not to reset the device in grub. self.internal_pipeline.add_action(ResetDevice()) elif parameters['method'] == 'grub': self.internal_pipeline.add_action(ResetDevice()) if parameters['method'] == 'grub-efi': self.internal_pipeline.add_action(UEFIMenuInterrupt()) self.internal_pipeline.add_action(GrubMenuSelector()) self.internal_pipeline.add_action(BootloaderInterrupt()) self.internal_pipeline.add_action(BootloaderCommandsAction()) if self.has_prompts(parameters): self.internal_pipeline.add_action(AutoLoginAction()) if self.test_has_shell(parameters): self.internal_pipeline.add_action(ExpectShellSession()) if 'transfer_overlay' in parameters: self.internal_pipeline.add_action(OverlayUnpack()) self.internal_pipeline.add_action(ExportDeviceEnvironment()) else: if self.has_boot_finished(parameters): self.logger.debug("Doing a boot without a shell (installer)") self.internal_pipeline.add_action(InstallerWait()) self.internal_pipeline.add_action(PowerOff())
def populate(self, parameters): self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) self.internal_pipeline.add_action(OverlayAction()) if hasattr(self.job.device, 'power_state'): if self.job.device.power_state in ['on', 'off']: self.internal_pipeline.add_action(ConnectDevice()) self.internal_pipeline.add_action(ResetDevice()) image_keys = list(parameters['images'].keys()) # Nexell extension if 'nexell_ext' in image_keys: self.logger.debug("SUKER: parameters in deploy/fastboot.py : " + str(parameters)) self.internal_pipeline.add_action( EnterNexellFastbootAction(parameters, 'deploy_script', 'deploy_command1', 'dir_name')) self.internal_pipeline.add_action( ApplyNexellDeployAction(parameters, 'deploy_script', 'deploy_command2', 'dir_name')) else: self.internal_pipeline.add_action(EnterFastbootAction()) self.internal_pipeline.add_action(LxcAddDeviceAction()) if 'image' in image_keys: download = DownloaderAction('image', self.fastboot_dir) download.max_retries = 3 # overridden by failure_retry in the parameters, if set. self.internal_pipeline.add_action(download) self.internal_pipeline.add_action(FastbootUpdateAction()) if 'ptable' in image_keys: download = DownloaderAction('ptable', self.fastboot_dir) download.max_retries = 3 # overridden by failure_retry in the parameters, if set. self.internal_pipeline.add_action(download) self.internal_pipeline.add_action(ApplyPtableAction()) if 'boot' in image_keys: download = DownloaderAction('boot', self.fastboot_dir) download.max_retries = 3 # overridden by failure_retry in the parameters, if set. self.internal_pipeline.add_action(download) self.internal_pipeline.add_action(ApplyBootAction()) if 'cache' in image_keys: download = DownloaderAction('cache', self.fastboot_dir) download.max_retries = 3 # overridden by failure_retry in the parameters, if set. self.internal_pipeline.add_action(download) self.internal_pipeline.add_action(ApplyCacheAction()) if 'userdata' in image_keys: download = DownloaderAction('userdata', self.fastboot_dir) download.max_retries = 3 # overridden by failure_retry in the parameters, if set. self.internal_pipeline.add_action(download) self.internal_pipeline.add_action(ApplyUserdataAction()) if 'system' in image_keys: download = DownloaderAction('system', self.fastboot_dir) download.max_retries = 3 # overridden by failure_retry in the parameters, if set. self.internal_pipeline.add_action(download) self.internal_pipeline.add_action(ApplySystemAction()) if 'vendor' in image_keys: download = DownloaderAction('vendor', self.fastboot_dir) download.max_retries = 3 # overridden by failure_retry in the parameters, if set. self.internal_pipeline.add_action(download) self.internal_pipeline.add_action(ApplyVendorAction())
def populate(self, parameters): self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) # customize the device configuration for this job self.internal_pipeline.add_action(UBootSecondaryMedia()) self.internal_pipeline.add_action(BootloaderCommandOverlay()) self.internal_pipeline.add_action(ConnectDevice()) self.internal_pipeline.add_action(UBootRetry())
def populate(self, parameters): self.expect_shell = parameters.get('expect_shell', True) self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) self.internal_pipeline.add_action(BootloaderCommandOverlay()) self.internal_pipeline.add_action(ConnectDevice()) self.internal_pipeline.add_action(ResetDevice()) if parameters['method'] == 'grub-efi': self.internal_pipeline.add_action(UEFIMenuInterrupt()) self.internal_pipeline.add_action(GrubMenuSelector()) self.internal_pipeline.add_action(BootloaderInterrupt()) self.internal_pipeline.add_action(BootloaderCommandsAction()) if self.has_prompts(parameters): self.internal_pipeline.add_action(AutoLoginAction()) if self.test_has_shell(parameters): self.internal_pipeline.add_action(ExpectShellSession()) if 'transfer_overlay' in parameters: self.internal_pipeline.add_action(OverlayUnpack()) self.internal_pipeline.add_action(ExportDeviceEnvironment()) else: if self.has_boot_finished(parameters): self.logger.debug("Doing a boot without a shell (installer)") self.internal_pipeline.add_action(InstallerWait()) self.internal_pipeline.add_action(PowerOff())
def populate(self, parameters): self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) # customize the device configuration for this job self.internal_pipeline.add_action(ConnectDevice()) self.internal_pipeline.add_action(BootloaderDefaultsRetry())
def populate(self, parameters): self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) self.internal_pipeline.add_action(OverlayAction()) if hasattr(self.job.device, 'power_state'): if self.job.device.power_state in ['on', 'off']: self.internal_pipeline.add_action(ConnectDevice()) self.internal_pipeline.add_action(PowerOn()) self.internal_pipeline.add_action(EnterFastbootAction()) self.internal_pipeline.add_action(LxcAddDeviceAction()) image_keys = list(parameters['images'].keys()) fastboot_dir = self.mkdtemp() # Add the required actions checks = [('image', FastbootUpdateAction), ('ptable', ApplyPtableAction), ('boot', ApplyBootAction), ('cache', ApplyCacheAction), ('userdata', ApplyUserdataAction), ('system', ApplySystemAction), ('vendor', ApplyVendorAction)] for (key, cls) in checks: if key in image_keys: download = DownloaderAction(key, fastboot_dir) download.max_retries = 3 # overridden by failure_retry in the parameters, if set. self.internal_pipeline.add_action(download) self.internal_pipeline.add_action(cls())
def populate(self, parameters): self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) self.internal_pipeline.add_action(ConnectDevice()) self.internal_pipeline.add_action(PowerOn()) self.internal_pipeline.add_action(WaitDFUDeviceAction()) self.internal_pipeline.add_action(FlashDFUAction())
def populate(self, parameters): self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) method_params = self.job.device['actions']['boot']['methods'][ 'cmsis-dap']['parameters'] self.internal_pipeline.add_action(FlashCMSISAction()) if method_params.get('resets_after_flash', True): self.internal_pipeline.add_action(WaitUSBSerialDeviceAction()) self.internal_pipeline.add_action(ConnectDevice())
def populate(self, parameters): self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) self.internal_pipeline.add_action(ConnectDevice()) self.internal_pipeline.add_action(ResetDevice()) if self.has_prompts(parameters): self.internal_pipeline.add_action(AutoLoginAction()) if self.test_has_shell(parameters): self.internal_pipeline.add_action(ExpectShellSession()) if 'transfer_overlay' in parameters: self.internal_pipeline.add_action(OverlayUnpack()) self.internal_pipeline.add_action(ExportDeviceEnvironment())
def populate(self, parameters): self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) method_params = self.job.device['actions']['boot']['methods'][ 'cmsis-dap']['parameters'] usb_mass_device = method_params.get('usb_mass_device', None) resets_after_flash = method_params.get('resets_after_flash', True) if self.job.device.hard_reset_command: self.internal_pipeline.add_action(ResetDevice()) self.internal_pipeline.add_action( WaitDevicePathAction(usb_mass_device)) self.internal_pipeline.add_action(FlashCMSISAction()) if resets_after_flash: self.internal_pipeline.add_action(WaitUSBSerialDeviceAction()) self.internal_pipeline.add_action(ConnectDevice())
def populate(self, parameters): download_dir = self.mkdtemp() self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) if 'recovery_image' in parameters: self.internal_pipeline.add_action(DownloaderAction('recovery_image', path=download_dir)) self.internal_pipeline.add_action(LxcAddDeviceAction()) self.force_prompt = True self.internal_pipeline.add_action(ConnectDevice()) self.internal_pipeline.add_action(ResetDevice()) self.internal_pipeline.add_action(ExtractVExpressRecoveryImage()) self.internal_pipeline.add_action(EnterVExpressMCC()) self.internal_pipeline.add_action(EnableVExpressMassStorage()) self.internal_pipeline.add_action(WaitUSBMassStorageDeviceAction()) self.internal_pipeline.add_action(MountVExpressMassStorageDevice()) self.internal_pipeline.add_action(DeployVExpressRecoveryImage()) self.internal_pipeline.add_action(UnmountVExpressMassStorageDevice()) self.internal_pipeline.add_action(VExpressFlashErase())
def populate(self, parameters): self.expect_shell = parameters.get('expect_shell', True) self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) self.internal_pipeline.add_action(BootloaderCommandOverlay()) self.internal_pipeline.add_action(ConnectDevice()) self.internal_pipeline.add_action(ResetDevice()) self.internal_pipeline.add_action(BootloaderInterrupt()) self.internal_pipeline.add_action(BootloaderCommandsAction()) if self.expect_shell: self.internal_pipeline.add_action(AutoLoginAction()) self.internal_pipeline.add_action(ExpectShellSession()) # wait self.internal_pipeline.add_action(ExportDeviceEnvironment()) else: self.logger.debug("Doing a boot without a shell (installer)") self.internal_pipeline.add_action(InstallerWait()) self.internal_pipeline.add_action(PowerOff())
def populate(self, parameters): download_dir = self.mkdtemp() self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) if 'recovery_image' in parameters: download = DownloaderAction('recovery_image', path=download_dir) download.max_retries = 3 self.internal_pipeline.add_action(download) if hasattr(self.job.device, 'power_state'): if self.job.device.power_state in ['on', 'off']: self.force_prompt = True self.internal_pipeline.add_action(ConnectDevice()) self.internal_pipeline.add_action(PowerOn()) self.internal_pipeline.add_action(ExtractVExpressRecoveryImage()) self.internal_pipeline.add_action(EnterVExpressMCC()) self.internal_pipeline.add_action(EnableVExpressMassStorage()) self.internal_pipeline.add_action(WaitUSBMassStorageDeviceAction()) self.internal_pipeline.add_action(MountVExpressMassStorageDevice()) self.internal_pipeline.add_action(DeployVExpressRecoveryImage()) self.internal_pipeline.add_action(UnmountVExpressMassStorageDevice()) self.internal_pipeline.add_action(VExpressFlashErase())
def populate(self, parameters): self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) self.internal_pipeline.add_action(FlashPyOCDAction()) self.internal_pipeline.add_action(ConnectDevice())