Beispiel #1
0
 def perform_boot_sequence(self, tty):
     menu = self.get_uefi_menu(tty)
     try:
         menu.select(self.uefi_entry)
     except LookupError:
         raise TargetError('Did not see "{}" UEFI entry.'.format(self.uefi_entry))
     tty.expect(self.efi_shell_prompt, timeout=self.timeout)
     if self.bootargs:
         tty.sendline('')  # stop default boot
         time.sleep(self.short_delay)
         efi_shell_command = '{} {}'.format(self.image, self.bootargs)
         self.logger.debug(efi_shell_command)
         write_characters(tty, efi_shell_command)
         tty.sendline('\r\n')
Beispiel #2
0
 def perform_boot_sequence(self, tty):
     menu = self.get_uefi_menu(tty)
     try:
         menu.select(self.uefi_entry)
     except LookupError:
         raise TargetError('Did not see "{}" UEFI entry.'.format(
             self.uefi_entry))
     tty.expect(self.efi_shell_prompt, timeout=self.timeout)
     if self.bootargs:
         tty.sendline('')  # stop default boot
         time.sleep(self.short_delay)
         efi_shell_command = '{} {}'.format(self.image, self.bootargs)
         self.logger.debug(efi_shell_command)
         write_characters(tty, efi_shell_command)
         tty.sendline('\r\n')
Beispiel #3
0
 def enter(self, value, delay=load_delay):
     """Like ``select()`` except no resolution is performed -- the value is sent directly
     to the serial connection."""
     # Empty the buffer first, so that only response to the input about to
     # be sent will be processed by subsequent commands.
     value = str(value)
     self._reset()
     write_characters(self.conn, value)
     # TODO: in case the value is long an complicated, things may get
     # screwed up (e.g. there may be line breaks injected), additionally,
     # special chars might cause regex to fail. To avoid these issues i'm
     # only matching against the first 5 chars of the value. This is
     # entirely arbitrary and I'll probably have to find a better way of
     # doing this at some point.
     self.conn.expect(value[:5], timeout=delay)
     time.sleep(self.load_delay)
Beispiel #4
0
 def enter(self, value, delay=load_delay):
     """Like ``select()`` except no resolution is performed -- the value is sent directly
     to the serial connection."""
     # Empty the buffer first, so that only response to the input about to
     # be sent will be processed by subsequent commands.
     value = str(value)
     self._reset()
     write_characters(self.conn, value)
     # TODO: in case the value is long an complicated, things may get
     # screwed up (e.g. there may be line breaks injected), additionally,
     # special chars might cause regex to fail. To avoid these issues i'm
     # only matching against the first 5 chars of the value. This is
     # entirely arbitrary and I'll probably have to find a better way of
     # doing this at some point.
     self.conn.expect(value[:5], timeout=delay)
     time.sleep(self.load_delay)
Beispiel #5
0
    def perform_boot_sequence(self, tty):
        if self.uses_bootscript:
            return  # Will boot automatically

        time.sleep(self.short_delay)
        tty.expect(self.bootmon_prompt, timeout=self.timeout)
        with open_serial_connection(port=self.port,
                                    baudrate=self.baudrate,
                                    timeout=self.timeout,
                                    init_dtr=0) as tty:
            write_characters(tty, 'fl linux fdt {}'.format(self.fdt))
            write_characters(tty, 'fl linux initrd {}'.format(self.initrd))
            write_characters(
                tty, 'fl linux boot {} {}'.format(self.image, self.bootargs))
Beispiel #6
0
    def perform_boot_sequence(self, tty):
        if self.uses_bootscript:
            return  # Will boot automatically

        time.sleep(self.short_delay)
        tty.expect(self.bootmon_prompt, timeout=self.timeout)
        with open_serial_connection(port=self.port,
                                    baudrate=self.baudrate,
                                    timeout=self.timeout,
                                    init_dtr=0) as tty:
            write_characters(tty, 'fl linux fdt {}'.format(self.fdt))
            write_characters(tty, 'fl linux initrd {}'.format(self.initrd))
            write_characters(tty, 'fl linux boot {} {}'.format(self.image,
                                                               self.bootargs))