Esempio n. 1
0
 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())
Esempio n. 2
0
    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())
Esempio n. 3
0
    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())
Esempio n. 4
0
 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())
Esempio n. 5
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self, job=self.job,
                                       parameters=parameters)
     # establish a new connection before trying the reset
     self.internal_pipeline.add_action(ResetDevice())
     # need to look for Hit any key to stop autoboot
     self.internal_pipeline.add_action(UBootInterrupt())
     self.internal_pipeline.add_action(ConnectLxc())
Esempio n. 6
0
 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())
     self.internal_pipeline.add_action(WaitDFUDeviceAction())
     self.internal_pipeline.add_action(FlashDFUAction())
Esempio n. 7
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self,
                                       job=self.job,
                                       parameters=parameters)
     if 'commands' in parameters and 'fastboot' in parameters['commands']:
         self.internal_pipeline.add_action(UefiSubstituteCommands())
         self.internal_pipeline.add_action(MenuConnect())
         self.internal_pipeline.add_action(ResetDevice())
         self.internal_pipeline.add_action(UEFIMenuInterrupt())
         self.internal_pipeline.add_action(UefiMenuSelector())
         self.internal_pipeline.add_action(MenuReset())
         self.internal_pipeline.add_action(ConnectLxc())
         self.internal_pipeline.add_action(WaitForAdbDevice())
     else:
         self.internal_pipeline.add_action(UefiSubstituteCommands())
         self.internal_pipeline.add_action(MenuConnect())
         self.internal_pipeline.add_action(ResetDevice())
         self.internal_pipeline.add_action(UEFIMenuInterrupt())
         self.internal_pipeline.add_action(UefiMenuSelector())
         self.internal_pipeline.add_action(MenuReset())
         self.internal_pipeline.add_action(AutoLoginAction())
         self.internal_pipeline.add_action(ExportDeviceEnvironment())
Esempio n. 8
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
     # establish a new connection before trying the reset
     self.internal_pipeline.add_action(ResetDevice())
     self.internal_pipeline.add_action(UBootInterrupt())
     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())
Esempio n. 9
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self,
                                       job=self.job,
                                       parameters=parameters)
     # establish a new connection before trying the reset
     self.internal_pipeline.add_action(ResetDevice())
     self.internal_pipeline.add_action(MonitorBootloaderAutoBoot())  # wait
     # and set prompt to the uboot prompt
     # Add AutoLoginAction unconditionally as this action does nothing if
     # the configuration does not contain 'auto_login'
     self.internal_pipeline.add_action(AutoLoginAction())
     self.internal_pipeline.add_action(ExpectShellSession())  # wait
     self.internal_pipeline.add_action(ExportDeviceEnvironment())
Esempio n. 10
0
 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())
Esempio n. 11
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self,
                                       job=self.job,
                                       parameters=parameters)
     # establish a new connection before trying the reset
     self.internal_pipeline.add_action(ResetDevice())
     self.internal_pipeline.add_action(BootloaderInterrupt())
     # need to look for Hit any key to stop autoboot
     self.internal_pipeline.add_action(BootloaderCommandsAction())
     # Add AutoLoginAction unconditionally as this action does nothing if
     # the configuration does not contain 'auto_login'
     self.internal_pipeline.add_action(AutoLoginAction())
     self.internal_pipeline.add_action(ExpectShellSession())  # wait
     self.internal_pipeline.add_action(ExportDeviceEnvironment())
Esempio n. 12
0
 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())
Esempio n. 13
0
 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())
Esempio n. 14
0
 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())
Esempio n. 15
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
     self.internal_pipeline.add_action(BootloaderCommandOverlay())
     self.internal_pipeline.add_action(MenuConnect())
     self.internal_pipeline.add_action(ResetDevice())
     # Newer firmware often needs no menu interaction, just press to drop to shell
     if not self._skip_menu(parameters):
         # Some older firmware, UEFI Shell has to be selected from a menu.
         self.internal_pipeline.add_action(UefiShellMenuInterrupt())
         self.internal_pipeline.add_action(UefiShellMenuSelector())
     self.internal_pipeline.add_action(UefiShellInterrupt())
     self.internal_pipeline.add_action(UefiBootloaderCommandsAction())
     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())