summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-10-13 14:19:21 -0600
committerTom Rini <[email protected]>2025-10-13 14:54:32 -0600
commit768b5167bd5bd8bf93698dbc94895ec3b195ffe0 (patch)
tree1b5e0951165082758e9f92357061159a06029123
parent48f21e66e360552c75d70a50421d0e0ed1f59e90 (diff)
parent1c3687782fcedbf13d114d0dcf3d151f2a210973 (diff)
Merge patch series "bootstd: rauc: fix doc and info msg to reflect real flow"
Andreas Pretzsch <[email protected]> says: For the RAUC bootmethod, newly introduced in U-Boot 2025.10, both code and documentation contain some incorrect (maybe outdated) statements, so they do not reflect the real behaviour. This series corrects both the docs and one log_info in the code, to now reflect the real flow. Beside being visible in the code, all of it was tested on a real machine. Despite the very late time in RC cycle, I suggest inclusion before release of U-Boot 2025.10, as the current statements are simply incorrect. Also I do not see any risk in these non-functional changes. Thanks to Martin Schwan for the review and esp. the initial code! Link: https://lore.kernel.org/r/[email protected]
-rw-r--r--boot/bootmeth_rauc.c3
-rw-r--r--doc/develop/bootstd/rauc.rst19
2 files changed, 15 insertions, 7 deletions
diff --git a/boot/bootmeth_rauc.c b/boot/bootmeth_rauc.c
index 81a73046e83..f5d5a971e87 100644
--- a/boot/bootmeth_rauc.c
+++ b/boot/bootmeth_rauc.c
@@ -18,6 +18,7 @@
#include <malloc.h>
#include <mapmem.h>
#include <string.h>
+#include <linux/stringify.h>
#include <asm/cache.h>
/* Length of env var "BOOT_*_LEFT" */
@@ -304,7 +305,7 @@ static int find_active_slot(char **slot_name, ulong *slot_tries)
if (!slot_found) {
if (IS_ENABLED(CONFIG_BOOTMETH_RAUC_RESET_ALL_ZERO_TRIES)) {
log_warning("WARNING: No valid slot found\n");
- log_info("INFO: Resetting boot order and all slot tries\n");
+ log_info("INFO: Resetting all slot tries to " __stringify(CONFIG_BOOTMETH_RAUC_DEFAULT_TRIES) "\n");
boot_order_list = str_to_list(CONFIG_BOOTMETH_RAUC_BOOT_ORDER);
for (i = 0; boot_order_list[i]; i++) {
sprintf(boot_left, "BOOT_%s_LEFT", boot_order_list[i]);
diff --git a/doc/develop/bootstd/rauc.rst b/doc/develop/bootstd/rauc.rst
index b2661d18da4..5afd705dcb1 100644
--- a/doc/develop/bootstd/rauc.rst
+++ b/doc/develop/bootstd/rauc.rst
@@ -21,14 +21,21 @@ with the left one tried first.
The default number of boot tries of each slot is set by
``CONFIG_BOOTMETH_RAUC_DEFAULT_TRIES``.
-In case no valid slot can be found and/or all slots have zero tries left, the
-boot order and slot tries are reset to their default values, if
-``CONFIG_BOOTMETH_RAUC_RESET_ALL_ZERO_TRIES`` is enabled. This prevents a system
-from locking up in the bootloader and tries booting again after a specified
-number of tries.
+If ``BOOT_ORDER`` does not exist in environment, it will be created and set to
+``CONFIG_BOOTMETH_RAUC_BOOT_ORDER``. If any ``BOOT_x_LEFT`` (for example
+``BOOT_A_LEFT`` and/or ``BOOT_B_LEFT``) does not exist in environment, it will
+be created and set to ``CONFIG_BOOTMETH_RAUC_DEFAULT_TRIES``.
+
+If ``CONFIG_BOOTMETH_RAUC_RESET_ALL_ZERO_TRIES`` is enabled, and no valid slot
+is found (all slots in ``BOOT_ORDER`` have ``BOOT_x_LEFT`` set to 0), *all* slot
+tries are reset to their default values. This prevents a system from locking up
+in the bootloader and tries booting again after a specified number of tries.
+
+If a valid slot is found, its LEFT value in environment is decremented by 1.
The boot script must be located in each boot partition. The bootmeth searches
-for "boot.scr.uimg" first, then "boot.scr" if not found.
+for ``boot.scr`` first, then ``boot.scr.uimg`` if not found. It will search in
+all directories of the bootstd list of prefixes (``"/", "/boot"`` by default).
When the bootflow is booted, the bootmeth sets these environment variables: