bootstd: rauc: Only require partitions for one slot
authorLeonard Anderweit <l.anderweit@phytec.de>
Tue, 18 Nov 2025 14:30:21 +0000 (15:30 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 27 Nov 2025 15:27:03 +0000 (09:27 -0600)
Partitions can be become unusable due to power cuts or failed updates.
Use the bootmeth RAUC if partitions for at least one slot exist. The
bootmeth can then select the working slot.

Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Tested-by: Martin Schwan <m.schwan@phytec.de>
boot/bootmeth_rauc.c

index 1096dae..833715e 100644 (file)
@@ -99,6 +99,7 @@ static int distro_rauc_scan_parts(struct bootflow *bflow)
        struct distro_rauc_priv *priv;
        char *boot_order;
        const char **boot_order_list;
+       bool slot_found = false;
        int ret;
        int i;
 
@@ -120,16 +121,20 @@ static int distro_rauc_scan_parts(struct bootflow *bflow)
                if (desc) {
                        ret = fs_set_blk_dev_with_part(desc, slot->boot_part);
                        if (ret)
-                               return log_msg_ret("part", ret);
+                               continue;
                        fs_close();
                        ret = part_get_info(desc, slot->root_part, NULL);
                        if (ret)
-                               return log_msg_ret("part", ret);
+                               continue;
+                       slot_found = true;
                }
        }
        str_free_list(boot_order_list);
 
-       return 0;
+       if (slot_found)
+               return 0;
+
+       return -1;
 }
 
 static int distro_rauc_read_bootflow(struct udevice *dev, struct bootflow *bflow)