{% set PROJECT = PROJECT|default("") %}
{% extends PROJECT+"nfs.jinja2" %}

{% set AUTO_LOGIN_PASSWORD_PROMPT = "Password:" %}
{% set AUTO_LOGIN_PASSWORD = "P@ssword-1" %}
{% set BOOT_OS_PROMPT = ["Current password: ", "New password: ", "Retype new password: ", "root@snarc-soca9:"] %}

{% set auto_login = auto_login|default(true) %}
{% set boot_method = boot_method|default("u-boot") %}
{% set rootfs_label = "nfsrootfs" %}
{% set run_fpga_commands = false %}
{% set run_tftp_commands = true %}
{% set target_deploy_timeout = 5 %}

{% block device_type %}soca9{% endblock %}

{% block deploy_target %}
- deploy:
    timeout:
      minutes: 10
    to: flasher
    images:
      image:
        url: https://images.validation.linaro.org/people.linaro.org/~remi.duraffort/soca9-disk.img.bz2
        compression: bz2
{{ super() }}
{% endblock deploy_target %}

{% block kernel_extra_args %}
      type: zimage
{% endblock kernel_extra_args %}

{% block boot_commands %}
{% if boot_method == "u-boot" %}
    commands:
      - run FPGA_INIT
      - setenv autoload no
      - dhcp
      - dhcp
      - env print
      - setenv serverip {SERVER_IP}
      - tftp 0x01000000 {KERNEL}
      - tftp 0x00000100 {DTB}
      - "setenv bootargs 'console=ttyS0,115200n8 root=/dev/nfs rw nfsroot={NFS_SERVER_IP}:{NFSROOTFS},tcp,hard,intr,vers=3 rootwait coherent_pool=2M ip=dhcp'"
      - '{BOOTX}'
{% elif boot_method == "bootloader" %}
    bootloader: u-boot
    commands: []
{% endif %}
{% endblock boot_commands %}

{% block auto_login_commands %}
      login_commands:
      - P@ssword-1
      - azertAZERT12345
      - azertAZERT12345
      - azertAZERT12345
{% endblock auto_login_commands %}

