summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Rokosov <ddrokosov@salutedevices.com>2024-10-17 17:12:11 +0300
committerMattijs Korpershoek <mkorpershoek@baylibre.com>2024-10-24 09:45:55 +0200
commit55c876c6f9b787488c7a9f9c678398c48d13db6f (patch)
tree3e13c60abaf33eb85892c3dbe55f2a0ca60f4f1e
parenta995084beb6682748002878ccb4b8c4de9fc0136 (diff)
common: android_ab: fix slot suffix for abc block
To align with the official Android BCB (Bootloader Control Block) specifications, it's important to note that the slot_suffix should start with an underscore symbol. For a comprehensive understanding of the expected slot_suffix format in userspace, please refer to the provided reference [1]. Links: [1] - https://source.android.com/docs/core/architecture/bootloader/updating#slots Based-on: https://android-review.googlesource.com/c/platform/external/u-boot/+/1446439 Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Guillaume La Roque <glaroque@baylibre.com> Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3_android Link: https://lore.kernel.org/r/20241017-android_ab_master-v5-6-43bfcc096d95@salutedevices.com Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
-rw-r--r--boot/android_ab.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/boot/android_ab.c b/boot/android_ab.c
index c93e5154101..a287eac04fe 100644
--- a/boot/android_ab.c
+++ b/boot/android_ab.c
@@ -52,7 +52,7 @@ static int ab_control_default(struct bootloader_control *abc)
if (!abc)
return -EFAULT;
- memcpy(abc->slot_suffix, "a\0\0\0", 4);
+ memcpy(abc->slot_suffix, "_a\0\0", 4);
abc->magic = BOOT_CTRL_MAGIC;
abc->version = BOOT_CTRL_VERSION;
abc->nb_slot = NUM_SLOTS;
@@ -328,7 +328,8 @@ int ab_select_slot(struct blk_desc *dev_desc, struct disk_partition *part_info,
* or the device tree.
*/
memset(slot_suffix, 0, sizeof(slot_suffix));
- slot_suffix[0] = BOOT_SLOT_NAME(slot);
+ slot_suffix[0] = '_';
+ slot_suffix[1] = BOOT_SLOT_NAME(slot);
if (memcmp(abc->slot_suffix, slot_suffix,
sizeof(slot_suffix))) {
memcpy(abc->slot_suffix, slot_suffix,