def populate(self, parameters): self.pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) self.method_params = self.job.device["actions"]["boot"]["methods"][ "u-boot"]["parameters"] self.usb_mass_device = self.method_params.get( "uboot_mass_storage_device") # establish a new connection before trying the reset self.pipeline.add_action(ResetDevice()) self.pipeline.add_action(BootloaderInterruptAction()) if self.method_params.get("uboot_ums_flash", False): self.pipeline.add_action( BootloaderCommandsAction(expect_final=False)) self.pipeline.add_action(WaitDevicePathAction( self.usb_mass_device)) self.pipeline.add_action(FlashUBootUMSAction(self.usb_mass_device)) self.pipeline.add_action(ResetDevice()) elif self.method_params.get("uboot_altbank", False): self.pipeline.add_action( BootloaderCommandsActionAltBank(expect_final=False)) self.pipeline.add_action(BootloaderInterruptAction()) self.pipeline.add_action(BootloaderCommandsAction()) else: self.pipeline.add_action(BootloaderCommandsAction()) if self.has_prompts(parameters): self.pipeline.add_action(AutoLoginAction()) if self.test_has_shell(parameters): self.pipeline.add_action(ExpectShellSession()) if "transfer_overlay" in parameters: self.pipeline.add_action(OverlayUnpack()) self.pipeline.add_action(ExportDeviceEnvironment())
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(BootloaderInterruptAction()) 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): super().populate(parameters) self.pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) sequences = self.job.device["actions"]["boot"]["methods"]["grub"].get( "sequence", []) for sequence in sequences: mapped = _grub_sequence_map(sequence) if mapped[1]: self.pipeline.add_action(mapped[0](itype=mapped[1])) elif mapped[0]: self.pipeline.add_action(mapped[0]()) if self.has_prompts(parameters): self.pipeline.add_action(AutoLoginAction()) if self.test_has_shell(parameters): self.pipeline.add_action(ExpectShellSession()) if "transfer_overlay" in parameters: self.pipeline.add_action(OverlayUnpack()) self.pipeline.add_action(ExportDeviceEnvironment()) else: if self.has_boot_finished(parameters): self.logger.debug("Doing a boot without a shell (installer)") self.pipeline.add_action(InstallerWait()) self.pipeline.add_action(PowerOff())
def populate(self, parameters): self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) self.method_params = self.job.device['actions']['boot']['methods'][ 'u-boot']['parameters'] self.usb_mass_device = self.method_params.get( 'uboot_mass_storage_device') # establish a new connection before trying the reset self.internal_pipeline.add_action(ResetDevice()) self.internal_pipeline.add_action(BootloaderInterruptAction()) if self.method_params.get('uboot_ums_flash', False): self.internal_pipeline.add_action( BootloaderCommandsAction(expect_final=False)) self.internal_pipeline.add_action( WaitDevicePathAction(self.usb_mass_device)) self.internal_pipeline.add_action( FlashUBootUMSAction(self.usb_mass_device)) self.internal_pipeline.add_action(ResetDevice()) else: 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())
def populate(self, parameters): self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) # Always ensure the device is in fastboot mode before trying to boot. # 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.hard_reset_command: self.force_prompt = True self.internal_pipeline.add_action(ConnectDevice()) self.internal_pipeline.add_action(ResetDevice()) else: self.internal_pipeline.add_action(EnterFastbootAction()) # Based on the boot sequence defined in the device configuration, add # the required pipeline actions. sequences = self.job.device['actions']['boot']['methods'].get( 'fastboot', []) for sequence in sequences: mapped = _fastboot_sequence_map(sequence) if mapped[1]: self.internal_pipeline.add_action( mapped[0](device_actions=mapped[1])) elif mapped[0]: self.internal_pipeline.add_action(mapped[0]()) 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): super(GrubSequenceAction, self).populate(parameters) self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) sequences = self.job.device['actions']['boot']['methods']['grub'].get( 'sequence', []) for sequence in sequences: mapped = _grub_sequence_map(sequence) if mapped[1]: self.internal_pipeline.add_action(mapped[0](type=mapped[1])) elif mapped[0]: self.internal_pipeline.add_action(mapped[0]()) 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.pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) self.pipeline.add_action(BootQemuRetry()) if self.has_prompts(parameters): self.pipeline.add_action(AutoLoginAction()) if self.test_has_shell(parameters): self.pipeline.add_action(ExpectShellSession()) if "transfer_overlay" in parameters: self.pipeline.add_action(OverlayUnpack()) self.pipeline.add_action(ExportDeviceEnvironment())
def populate(self, parameters): self.pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) name = parameters["connection"] self.pipeline.add_action(ConnectShell(name=name)) if self.has_prompts(parameters): self.pipeline.add_action(AutoLoginAction(booting=False)) if self.test_has_shell(parameters): self.pipeline.add_action(ExpectShellSession()) if "transfer_overlay" in parameters: self.pipeline.add_action(OverlayUnpack()) self.pipeline.add_action(ExportDeviceEnvironment())
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.pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) self.pipeline.add_action(ResetDevice()) self.pipeline.add_action(DepthchargeStart()) self.pipeline.add_action(BootloaderCommandsAction()) if self.has_prompts(parameters): self.pipeline.add_action(AutoLoginAction()) if self.test_has_shell(parameters): self.pipeline.add_action(ExpectShellSession()) if "transfer_overlay" in parameters: self.pipeline.add_action(OverlayUnpack()) self.pipeline.add_action(ExportDeviceEnvironment())
def populate(self, parameters): self.pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) self.pipeline.add_action(KexecAction()) # Add AutoLoginAction unconditionally as this action does nothing if # the configuration does not contain 'auto_login' self.pipeline.add_action(AutoLoginAction()) self.pipeline.add_action(ExpectShellSession()) if "transfer_overlay" in parameters: self.pipeline.add_action(OverlayUnpack()) self.pipeline.add_action(ExportDeviceEnvironment())
def populate(self, parameters): self.pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) self.pipeline.add_action(BootFVPMain()) if self.has_prompts(parameters): self.pipeline.add_action(ReadFeedback()) self.pipeline.add_action(AutoLoginAction()) if self.test_has_shell(parameters): self.pipeline.add_action(ExpectShellSession()) if "transfer_overlay" in parameters: self.pipeline.add_action(OverlayUnpack())
def populate(self, parameters): self.pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) # establish a new connection before trying the reset self.pipeline.add_action(ResetDevice()) self.pipeline.add_action(BootloaderInterruptAction()) self.pipeline.add_action(BootloaderCommandsAction()) if self.has_prompts(parameters): self.pipeline.add_action(AutoLoginAction()) if self.test_has_shell(parameters): self.pipeline.add_action(ExpectShellSession()) if "transfer_overlay" in parameters: self.pipeline.add_action(OverlayUnpack()) self.pipeline.add_action(ExportDeviceEnvironment())
def populate(self, parameters): self.parameters = parameters self.pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) if parameters.get("commands"): self.pipeline.add_action(BootFastbootCommands()) board_id = self.job.device["fastboot_serial_number"] # Always ensure the device is in fastboot mode before trying to boot. # 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.pipeline.add_action(ConnectDevice()) self.pipeline.add_action(UBootEnterFastbootAction()) elif self.job.device.hard_reset_command: self.force_prompt = True self.pipeline.add_action(ConnectDevice()) self.pipeline.add_action(ResetDevice()) else: self.pipeline.add_action(WaitDeviceBoardID(board_id)) self.pipeline.add_action(EnterFastbootAction()) # Based on the boot sequence defined in the device configuration, add # the required pipeline actions. sequences = self.job.device["actions"]["boot"]["methods"].get( "fastboot", []) for sequence in sequences: mapped = _fastboot_sequence_map(sequence) self.pipeline.add_action(WaitDeviceBoardID(board_id)) if mapped[1]: self.pipeline.add_action(mapped[0](device_actions=mapped[1])) elif mapped[0]: self.pipeline.add_action(mapped[0]()) if self.job.device.hard_reset_command: if not self.is_container(): self.pipeline.add_action(PreOs()) if self.has_prompts(parameters): self.pipeline.add_action(AutoLoginAction()) if self.test_has_shell(parameters): self.pipeline.add_action(ExpectShellSession()) if "transfer_overlay" in parameters: self.pipeline.add_action(OverlayUnpack()) self.pipeline.add_action(ExportDeviceEnvironment()) else: if not self.is_container(): self.pipeline.add_action(ConnectAdb()) self.pipeline.add_action(AdbOverlayUnpack())
def populate(self, parameters): self.pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) self.pipeline.add_action(ConnectDevice()) if parameters.get("pre_power_command", False): self.pipeline.add_action(PrePower()) if parameters.get("pre_os_command", False): self.pipeline.add_action(PreOs()) if parameters.get("reset", True): self.pipeline.add_action(ResetDevice()) if self.has_prompts(parameters): self.pipeline.add_action(AutoLoginAction()) if self.test_has_shell(parameters): self.pipeline.add_action(ExpectShellSession()) if "transfer_overlay" in parameters: self.pipeline.add_action(OverlayUnpack()) self.pipeline.add_action(ExportDeviceEnvironment())
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())
def populate(self, parameters): self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) # Nexell Extension if 'nexell_ext' in parameters: self.logger.debug("[SEOJI] ****** parameters: %s", parameters) self.internal_pipeline.add_action( NexellFastbootBootAction(parameters)) self.internal_pipeline.add_action(ConnectDevice()) if self.has_prompts(parameters): if 'auto_login' in parameters: self.internal_pipeline.add_action(AutoLoginAction()) self.internal_pipeline.add_action( WaitForAdbDeviceForNexell(parameters)) self.internal_pipeline.add_action(ApplyNexellOverlay()) self.internal_pipeline.add_action(ExpectShellSession()) else: if parameters.get("commands"): self.logger.debug("[SEOJI] boot - add BootFastbootCommands()") self.internal_pipeline.add_action(BootFastbootCommands()) # Always ensure the device is in fastboot mode before trying to boot. # 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.hard_reset_command: self.force_prompt = True self.internal_pipeline.add_action(ConnectDevice()) self.internal_pipeline.add_action(ResetDevice()) else: self.logger.debug("[SEOJI] boot - add EnterFastbootAction") self.internal_pipeline.add_action(EnterFastbootAction()) # Based on the boot sequence defined in the device configuration, add # the required pipeline actions. self.logger.debug("[SEOJI] get sequences") sequences = self.job.device['actions']['boot']['methods'].get( 'fastboot', []) self.logger.debug("[SEOJI] sequences" + str(sequences)) for sequence in sequences: mapped = _fastboot_sequence_map(sequence) if mapped[1]: self.internal_pipeline.add_action( mapped[0](device_actions=mapped[1])) elif mapped[0]: self.internal_pipeline.add_action(mapped[0]()) if self.job.device.hard_reset_command: if not is_lxc_requested(self.job): self.internal_pipeline.add_action(PreOs()) 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 not is_lxc_requested(self.job): self.internal_pipeline.add_action(ConnectAdb()) self.internal_pipeline.add_action(AdbOverlayUnpack())