.. index:: deploy to fastboot

.. _deploy_to_fastboot:

to: fastboot
************

.. seealso:: :ref:`deploy_using_lxc`

.. index:: deploy to fastboot images

.. _deploy_to_fastboot_images:

images
======

Fastboot deployments support a range of images to be downloaded and deployed to
the device. The list of images will depend on the test job and the test device.
The available elements determine the command arguments passed to ``fastboot``
inside the LXC i.e., the partition to be flashed.

partition
---------

The partition is a text string which specifies the partition to which the
image will be flashed using the ``fastboot`` command.

In the example, the partition to be flashed on the :term:`DUT` is ``system``.

.. note:: The partition text is passed to fastboot command as given in the
   job, for example, ``fastboot flash system /lava-lxc/rootfs.img``, hence
   take caution to pass the right partition name.


.. include:: examples/test-jobs/hi6220-hikey.yaml
     :code: yaml
     :start-after: to: fastboot
     :end-before: reboot:

.. _deploy_to_fastboot_images_url:

url *
^^^^^

Specifies the URL to download. All downloads are checksummed using ``md5sum``
and ``sha256sum``

URLs are checked during the test job validation to ensure that the file can be
downloaded. Missing files will cause the test job to end as Incomplete.

URLs **must** use one of the supported schemes, the first element of the URL.

.. topic:: Supported schema

 * ``http://``
 * ``https://``
 * ``file://``
 * ``lxc://``

.. _deploy_to_fastboot_images_compression:

compression
^^^^^^^^^^^

If the image is compressed, the compression method **must** be specified.

.. topic:: Allowed values

 * ``gz``
 * ``bz2``
 * ``xz``

.. _deploy_to_fastboot_images_reboot:

reboot
^^^^^^

If there is a need to restart or reboot the :term:`DUT` after flashing boot
image, then the method **must** be specified.

.. topic:: Allowed values

 * ``hard-reset``
 * ``fastboot-reboot``
 * ``fastboot-reboot-bootloader``

.. _deploy_to_fastboot_images_archive:

archive
^^^^^^^

Some system images are compressed as a tarball (``.tar.*``), these images
need the ``archive`` option specified to unpack the system image correctly.

::

   archive: tar

.. _deploy_to_fastboot_images_apply-overlay:

apply-overlay
^^^^^^^^^^^^^

Use this to apply LAVA specific overlays to image.

::

   apply-overlay: true

.. _deploy_to_fastboot_images_sparse:

sparse
^^^^^^

The default value for this parameter is ``true``. Some system images are
shipped as sparse images which needs special handling with tools such as
``simg2img`` and ``img2simg``, in order to apply LAVA specific overlays to it.
By default LAVA assumes the image to which ``apply-overlay`` is specified is a
sparse image.

.. seealso:: :ref:`deploy_to_fastboot_images_apply-overlay`

If the image is not a sparse image then this should be explicitly mentioned,
so that LAVA will treat the image as non-sparse ext4 image.

::

   sparse: false

.. seealso:: The sparse image format is defined in sparse_format_ in the
   Android platform source code.

.. _sparse_format: https://android.googlesource.com/platform/system/core/+/master/libsparse/sparse_format.h

.. _deploy_to_fastboot_images_md5sum:

md5sum
^^^^^^

The checksum of the file to download can be provided, and if so it will be
checked against the downloaded content. This can help to detect multiple
potential problems such as misconfigured caching or corrupted downloads. If
compression is used, the checksum to specify is the checksum of the compressed
file, irrespective of whether that file is decompressed later.

.. _deploy_to_fastboot_images_sha256sum:

sha256sum
^^^^^^^^^

The checksum of the file to download can be provided, and if so it will be
checked against the downloaded content. This can help to detect multiple
potential problems such as misconfigured caching or corrupted downloads. If
compression is used, the checksum to specify is the checksum of the compressed
file, irrespective of whether that file is decompressed later.:

.. include:: examples/test-jobs/hi6220-hikey.yaml
     :code: yaml
     :start-after: system:
     :end-before: - boot
