{% extends 'base.jinja2' %}

{% set fastboot_auto_detection = fastboot_auto_detection|default(false) %}
{% set adb_serial_number = adb_serial_number|default('0000000000') %}
{% set fastboot_serial_number = fastboot_serial_number|default('0000000000') %}
{% set soft_reboot_command = soft_reboot_command|default('adb -s ' + fastboot_serial_number + ' reboot bootloader') %}
{% set device_info = device_info|default([{'board_id': fastboot_serial_number}]) %}

{% block body %}
fastboot_auto_detection: {{ fastboot_auto_detection|default(false) }}
adb_serial_number: "{{ adb_serial_number|default('0000000000') }}"
fastboot_serial_number: "{{ fastboot_serial_number|default('0000000000') }}"
fastboot_options: {{ fastboot_options|default([]) }}

{% if fastboot_deploy_uboot_commands %}
# This attribute identifies whether a device should get into fastboot mode by
# interrupting uboot and issuing commands at the bootloader prompt.
fastboot_via_uboot: True
{% endif %}

actions:
  deploy:
    methods:
      lxc:
      ssh:
        options:
{{ ssh_options }}
        host: '{{ ssh_host|default('') }}'
        port: {{ ssh_port|default(22) }}
        user: {{ ssh_user|default('root') }}
        identity_file: {{ ssh_identity_file }}
{% if recovery_mode %}
{{ recovery_mode }}
          recovery_mode:
{% for url in recovery_mode_command %}
          - {{ url }}
{% endfor %}
          recovery_exit:
{% for url in recovery_exit_command %}
          - {{ url }}
{% endfor %}
{% endif %}
      nfs:
      fastboot:
{% if fastboot_deploy_uboot_commands %}
      u-boot:
        parameters:
          bootloader_prompt: "{{ bootloader_prompt }}"
          interrupt_prompt: "{{ interrupt_prompt }}"
          interrupt_char: "{{ interrupt_char }}"
          fastboot:
            commands:
{% for command in fastboot_deploy_uboot_commands %}              - {{ command }}{% endfor %}
{% endif %}
{{- fastboot_interrupt_params }}
    connections:
      adb:
      fastboot:
      lxc:
      serial:
  boot:
    connections:
      adb:
      fastboot:
      lxc:
      serial:
      adb:
    methods:
      lxc:
      ssh:
      minimal:
      u-boot:
        parameters:
          bootloader_prompt: {{ bootloader_prompt|default('=>') }}
          interrupt_prompt: {{ interrupt_prompt|default('Hit any key to stop autoboot') }}
          interrupt_char: "{{ interrupt_char|default('') }}"
          needs_interrupt: {{ uboot_needs_interrupt|default(True) }}
      fastboot: {{ fastboot_sequence }}
{{- fastboot_boot_uboot }}
{{- fastboot_boot_grub }}
  test:
    methods:
      docker:
        global_options:
        - {{ docker_shell_global_arguments }}
        options:
        - {{ docker_shell_extra_arguments }}
{% endblock body %}
