Skip to content

Commit d135a2f

Browse files
authored
Merge pull request rauc#1903 from ejoerns/revise-mark
Fix, update and rewrite parts of the 'mark' documentation
2 parents 12d3b74 + 5b93595 commit d135a2f

2 files changed

Lines changed: 43 additions & 30 deletions

File tree

docs/reference.rst

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2443,15 +2443,27 @@ Bootloader Interaction
24432443
RAUC comes with a generic interface for interacting with the bootloader.
24442444
It handles *all* slots that have a ``bootname`` property set.
24452445

2446-
It provides two base functions:
2446+
.. note:: The terminology between the 'mark' methods and the low-level 'boot'
2447+
methods slightly differs.
24472448

2448-
1) Setting state 'good' or 'bad', reflected by API routine ``r_boot_set_state()``
2449-
and command line tool option ``rauc status mark <good/bad>``
2450-
2) Marking a slot 'primary', reflected by API routine ``r_boot_set_primary()``
2451-
and command line tool option ``rauc status mark-active``
2449+
It provides three base operations:
2450+
2451+
1) Setting state 'bad' (non-bootable), triggered by the API method ``r_mark_bad()``.
2452+
2453+
The bootloader backend API call for this is
2454+
``r_boot_set_state(…, FALSE, …)``.
2455+
2) Setting state 'good' (bootable), reflected by the API method ``r_mark_good()``.
2456+
2457+
The bootloader backend API call for this is
2458+
``r_boot_set_state(…, TRUE, …)``.
2459+
3) Marking a slot 'active' (primary boot target), reflected by API routine
2460+
``r_mark_active()``.
2461+
2462+
The bootloader backend API call for this is
2463+
``r_boot_set_primary()``.
24522464

24532465
The default flow of how they will be called during the installation of a new
2454-
bundle (on Slot 'A') looks as follows:
2466+
bundle looks as follows:
24552467

24562468
.. image:: images/bootloader-interaction_install.svg
24572469
:width: 400
@@ -2491,16 +2503,16 @@ A normal reboot of the system will look as follows:
24912503
Some bootloaders do not require explicitly setting state 'good' as they are able
24922504
to differentiate between a POR and a watchdog reset, for example.
24932505

2494-
.. note: Despite the naming might suggest it, marking a slot bad and good are
2506+
.. note:: Despite the naming might suggest it, marking a slot bad and good are
24952507
not reversible operations, meaning you have no guarantee that a slot first
24962508
set to 'bad' and then set to 'good' again will be in the same state as
24972509
before.
24982510
Actually reactivating it will only work by marking it primary (active).
24992511

2500-
What the high-level functions described above actually do mainly depends on the underlying
2501-
bootloader used and the capabilities it provides.
2502-
Below is a short description about behavior of each bootloader interface
2503-
currently implemented:
2512+
The exact behavior of each operation depends on the underlying bootloader and
2513+
its capabilities.
2514+
The following sections describe how each supported bootloader backend
2515+
implements the above-mentioned operations.
25042516

25052517
U-Boot
25062518
~~~~~~

docs/using.rst

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -139,42 +139,43 @@ points to the correct directory.
139139
That way, installed artifacts can be found by following
140140
``/run/rauc/artifacts/<repository-name>/<artifact-name>``.
141141

142-
React to a Successfully Booted System/Failed Boot
143-
-------------------------------------------------
142+
Marking a Boot as Successful or Failed
143+
--------------------------------------
144144

145-
Normally, the full system update chain is not complete before being sure that
146-
the newly installed system runs without any errors.
147-
As the definition and detection of a `successful` operation is really
148-
system-dependent, RAUC provides commands to preserve a slot as being the
149-
preferred one to boot or to discard a slot from being bootable.
145+
A system update is only considered complete once the newly installed system has
146+
been confirmed to be running correctly.
147+
Since the definition and detection of a successful boot is system-dependent,
148+
RAUC provides explicit commands and a :ref:`D-Bus Method
149+
<gdbus-method-de-pengutronix-rauc-Installer.Mark>` to mark the booted slot
150+
group as either good (confirmed working) or bad (non-working).
150151

151152
.. code-block:: console
152153
153154
# rauc status mark-good
154155
155-
After verifying that the currently booted system is fully operational, one
156-
wants to signal this information to the underlying bootloader implementation
157-
which then, for example, resets a boot attempt counter.
156+
Once the currently booted system is verified as fully operational, run this
157+
command to signal success to the bootloader.
158+
Depending on the bootloader backend, this typically resets a boot attempt
159+
counter and confirms the current slot as the active one.
160+
158161

159162
.. code-block:: console
160163
161164
# rauc status mark-bad
162165
163-
If the current boot failed in some way, this command can be used to communicate
164-
that to the underlying bootloader implementation.
165-
In most cases this will disable the currently booted slot or at least switch to
166-
a different one.
166+
If the current boot has failed, run this command to signal failure to the
167+
bootloader.
168+
Depending on the bootloader backend, this will either disable the currently
169+
booted slot or switch to a different one.
167170

168-
Although not very useful in the field, both commands recognize an optional
169-
argument to explicitly identify the slot to act on:
171+
To maintain consistency with ``rauc status mark-active``, both commands accept
172+
an optional slot argument:
170173

171174
.. code-block:: console
172175
173176
# rauc status mark-{good,bad} [booted | other | <SLOT_NAME>]
174177
175-
This is to maintain consistency with respect to ``rauc status mark-active``
176-
where that argument is definitively wanted, see :ref:`here
177-
<optional-slot-identifier-argument>`.
178+
In practice this is rarely needed.
178179

179180
.. _mark-active:
180181

0 commit comments

Comments
 (0)