bootstd: rauc: Don't check root part filesystem
PATCH 1/2 bootstd: rauc: Don't check root part filesystem
Only check if the root partition exists when scanning for the slots partitions and not if the filesystem can be accessed. It is not needed to access the filesystem of the root partition as it might not be supported by u-boot or be encrypted.
--- boot/bootmeth_rauc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
boot/bootmeth_rauc.c +2 -2
@@ -17,6 +17,7 @@#include <fs.h> #include <malloc.h> #include <mapmem.h> +#include <part.h> #include <string.h> #include <linux/stringify.h> #include <asm/cache.h>
@@ -121,10 +122,9 @@ static int distro_rauc_scan_parts(struct bootflow *bflow)if (ret)return log_msg_ret ("part" , ret);fs_close (); - ret =fs_set_blk_dev_with_part (desc, slot->root_part); + ret =part_get_info (desc, slot->root_part,NULL );if (ret)return log_msg_ret ("part" , ret); -fs_close (); } }str_free_list (boot_order_list);
Signature · 1 line
2.43.0
PATCH 2/2 bootstd: rauc: Only require partitions for one slot
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.
--- boot/bootmeth_rauc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
boot/bootmeth_rauc.c +8 -3
@@ -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)
Signature · 1 line
2.43.0
Quoted 6 lines · Leonard Anderweit
Only check if the root partition exists when scanning for the slots partitions and not if the filesystem can be accessed. It is not needed to access the filesystem of the root partition as it might not be supported by u-boot or be encrypted.
Applied to u-boot/master, thanks!
[1/2] bootstd: rauc: Don't check root part filesystem
commit: 5d7c080ae5dc1f8d5ca4fb1dd93a15ea96ca8c72
[2/2] bootstd: rauc: Only require partitions for one slot
commit: 962711498ddac6179f1d1f3fa123397ba02a381bSignature · 1 line
Tom