auc: fall back to 'sdcard' image
authorDaniel Golle <redacted>
Mon, 14 Feb 2022 14:24:21 +0000 (14:24 +0000)
committerDaniel Golle <redacted>
Mon, 14 Feb 2022 14:25:54 +0000 (14:25 +0000)
Fallback to use 'sdcard' image in case there is neither 'sysupgrade'
nor 'combined' image available.
This allows using 'auc' on targets where 'sdcard' image is also used
for sysupgrade (such as some mvebu-based devices with eMMC).

Signed-off-by: Daniel Golle <redacted>
utils/auc/src/auc.c

index 6a78d2db825c1519c8faf34c1a7415a3f003b7d5..cd2acc52250ade518843457ba915ce0d86fd1106 100644 (file)
@@ -1363,6 +1363,10 @@ static int select_image(struct blob_attr *images, const char *target_fstype, cha
                ret = get_image_by_type(images, combined_type, fstype, image_name, image_sha256);
                if (!ret)
                        return 0;
+
+               ret = get_image_by_type(images, "sdcard", fstype, image_name, image_sha256);
+               if (!ret)
+                       return 0;
        }
 
        /* fallback to squashfs unless fstype requested explicitly */
@@ -1372,6 +1376,10 @@ static int select_image(struct blob_attr *images, const char *target_fstype, cha
                        return 0;
 
                ret = get_image_by_type(images, combined_type, "squashfs", image_name, image_sha256);
+               if (!ret)
+                       return 0;
+
+               ret = get_image_by_type(images, "sdcard", fstype, image_name, image_sha256);
        }
 
        return ret;
git clone https://git.99rst.org/PROJECT