.. 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: # DEPLOY_TARGET_BLOCK
     :end-before: # BOOT_TARGET_BLOCK

.. _deploy_to_fastboot_images_url:

.. include:: actions-deploy-images-url.rsti

.. _deploy_to_fastboot_images_compression:

compression
^^^^^^^^^^^
.. include:: actions-deploy-images-compression.rsti

.. _deploy_to_fastboot_images_reboot:

reboot
^^^^^^

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

.. topic:: Allowed values

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

.. _deploy_to_fastboot_images_archive:

archive
^^^^^^^
.. include:: actions-deploy-images-archive.rsti

.. _deploy_to_fastboot_images_apply-overlay:

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

Use this to apply LAVA specific overlays to image.

.. code-block:: yaml

  - deploy:
      to: fastboot
      images:
        system:
          url: http://example.com/system.img.xz
          compression: xz
          apply-overlay: true

.. _deploy_to_fastboot_images_sparse:

sparse
^^^^^^

.. code-block:: yaml

  - deploy:
      to: fastboot
      images:
        system:
          url: http://example.com/system.img.xz
          compression: xz
          sparse: true


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.

.. code-block:: yaml

  - deploy:
      to: fastboot
      images:
        system:
          url: http://example.com/system.ext4.xz
          compression: xz
          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
^^^^^^
.. include:: actions-deploy-images-md5sum.rsti

.. _deploy_to_fastboot_images_sha256sum:

sha256sum
^^^^^^^^^
.. include:: actions-deploy-images-sha256sum.rsti

sha512sum
^^^^^^^^^
.. include:: actions-deploy-images-sha512sum.rsti
