Add an extra metadata slot to super[_empty].img.
This change excludes retrofit devices from getting a third metadata
slot, until code is in place to correctly upgrade those devices through
fastbootd/update_engine.
Bug: 121149247
Test: lpdump super_empty.img
Change-Id: Id147c42cee93a1f6d61ee0edc9cddc0c0540a279
diff --git a/tools/releasetools/build_super_image.py b/tools/releasetools/build_super_image.py
index e8730ae..c82a9ee 100755
--- a/tools/releasetools/build_super_image.py
+++ b/tools/releasetools/build_super_image.py
@@ -78,10 +78,12 @@
block_devices = shlex.split(info_dict.get("super_block_devices", "").strip())
groups = shlex.split(info_dict.get("super_partition_groups", "").strip())
- if ab_update:
+ if ab_update and retrofit:
cmd += ["--metadata-slots", "2"]
+ elif ab_update:
+ cmd += ["--metadata-slots", "3"]
else:
- cmd += ["--metadata-slots", "1"]
+ cmd += ["--metadata-slots", "2"]
if ab_update and retrofit:
cmd.append("--auto-slot-suffixing")