Skip to content

Commit

Permalink
ug: faq: add information on recreating a target
Browse files Browse the repository at this point in the history
Many users want to downgrade the image.
This shows how to recreate a target so it's picked by aklite daemon.

Signed-off-by: Vanessa Maegima <[email protected]>
  • Loading branch information
vanmaegima committed Jan 7, 2025
1 parent e8eaec5 commit c8f5663
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions source/user-guide/troubleshooting/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -710,3 +710,41 @@ There are some cases where this can happen:
Running ``fioctl wave status`` in this case shows that some devices are running Target 42, which is not present in the Targets list, so it shows as an orphan Target.
* A device runs an old Target that has been pruned from the Targets list.
* A device switches from one tag to another and it is still running a Target version which is not present in the new tag.

Recreating Previous Targets
^^^^^^^^^^^^^^^^^^^^^^^^^^^

By default, aktualizr-lite only installs targets which are newer than the current one running on the device.

A common requirement during development is to be able to downgrade to a previous stable target.
This can be easily achieved by reverting to the previous commit shas that generated this stable target.
However, this may not be ideal as it requires CI build time to actually rebuild the target.

Users can then use ``fioctl targets add`` to recreate a previous target by using much less CI time than an actual build.
This recreates the target by re-downloading OSTree or apps contents.

Unfortunately, ``fioctl targets add`` does not regenerate the whole target at once.
Like the normal CI flow, apps and OSTree are built separately in a dedicated CI build.
So two sets of commands are necessary to downgrade to a specific OSTree + apps hash.

An example follows:

* Device running Target A

* New Target B > A is built in CI

* Let the device OTA to Target B

* Target B updated fine but I would like to go back to Target A

* Create a new Target C > B based on A OStree, for example:

.. code-block:: bash
$ fioctl targets add --type ostree --tags <new-tag> --src-tag <orig-tag> --targets-creator "Recreate Target A platform build" <machine> <target-a-ostree-hash>
* Device then OTA to Target C, which goes back to A OSTree

.. note::
Similar steps can be taken to recreate a container target.
See ``fioctl targets add`` command usage for more information.

0 comments on commit c8f5663

Please sign in to comment.