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) if self.job.device.hard_reset_command: self.pipeline.add_action(ResetDevice()) self.pipeline.add_action(WaitDeviceBoardID(self.job.device.get("board_id"))) self.pipeline.add_action(FlashOpenOCDAction()) self.pipeline.add_action(ConnectDevice())
def populate(self, parameters): self.pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) flash_cmds_order = self.job.device["flash_cmds_order"] userlist = list(parameters["images"].keys()) flash_cmds = set(userlist).difference(set(flash_cmds_order)) flash_cmds = flash_cmds_order + list(flash_cmds) board_id = self.job.device["fastboot_serial_number"] self.pipeline.add_action(ReadFeedback(repeat=True)) for flash_cmd in flash_cmds: if flash_cmd not in parameters["images"]: continue self.pipeline.add_action(WaitDeviceBoardID(board_id)) self.pipeline.add_action(FastbootFlashAction(cmd=flash_cmd)) self.reboot = parameters["images"][flash_cmd].get("reboot") if self.reboot == "fastboot-reboot": self.pipeline.add_action(FastbootReboot()) self.pipeline.add_action(ReadFeedback(repeat=True)) elif self.reboot == "fastboot-reboot-bootloader": self.pipeline.add_action(FastbootRebootBootloader()) self.pipeline.add_action(ReadFeedback(repeat=True)) elif self.reboot == "fastboot-reboot-fastboot": self.pipeline.add_action(FastbootRebootFastboot()) self.pipeline.add_action(ReadFeedback(repeat=True)) elif self.reboot == "hard-reset": self.pipeline.add_action(PDUReboot()) self.pipeline.add_action(ReadFeedback(repeat=True))
def populate(self, parameters): self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) if self.job.device.hard_reset_command: self.internal_pipeline.add_action(ResetDevice()) self.internal_pipeline.add_action(WaitDeviceBoardID(self.job.device.get('board_id', None))) self.internal_pipeline.add_action(FlashPyOCDAction()) self.internal_pipeline.add_action(ConnectDevice())
def populate(self, parameters): self.pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) method_params = self.job.device["actions"]["boot"]["methods"]["pyocd"][ "parameters" ] if self.job.device.hard_reset_command: self.pipeline.add_action(ResetDevice()) self.pipeline.add_action(WaitDeviceBoardID(self.job.device.get("board_id"))) if method_params.get("connect_before_flash", False): self.pipeline.add_action(ConnectDevice()) self.pipeline.add_action(FlashPyOCDAction()) if not method_params.get("connect_before_flash", False): self.pipeline.add_action(ConnectDevice())
def populate(self, parameters): self.pipeline = Pipeline(parent=self, job=self.job, parameters=parameters) self.pipeline.add_action(DockerTestSetEnvironment()) self.pipeline.add_action(CreateOverlay()) wait_for_device = (parameters.get("docker", {}).get("wait", {}).get("device", True)) if wait_for_device: self.pipeline.add_action(WaitDeviceBoardID(self.get_board_id())) self.pipeline.add_action(DockerTestShell(wait_for_device)) self.pipeline.add_action(ReadFeedback())