fastbootd: Add commands for logical partitions.
This patch adds the following new commands to fastbootd:
getvar is_logical:<partition>
create-logical-logical-partition <partition> <size>
delete-logical-partition <partition>
resize-logicallogical-partition <partition> <size>
All of these commands operate on logical partitions only, and require a
properly configured "super" partition to operate.
Bug: 78793464
Test: fastboot create-logical-partition example 4096
fastboot create-logical-partition example 4096 returns error
fastboot getvar is-logical:example returns "yes"
fastboot getvar partition-size:example returns "1000"
fastboot resize-logicalpartition example 8000
fastboot getvar partition-size:example returns "2000"
fastboot delete-logical-partition example
fastboot getvar is-logical:example returns error
fastboot getvar is-logical:system_a returns "no"
Change-Id: Iff323eabcf5c559fa04c7c92574650b01803eb1f
diff --git a/fastboot/constants.h b/fastboot/constants.h
index fa17070..b780ba5 100644
--- a/fastboot/constants.h
+++ b/fastboot/constants.h
@@ -30,6 +30,9 @@
#define FB_CMD_REBOOT_RECOVERY "reboot-recovery"
#define FB_CMD_REBOOT_FASTBOOT "reboot-fastboot"
#define FB_CMD_POWERDOWN "powerdown"
+#define FB_CMD_CREATE_PARTITION "create-logical-partition"
+#define FB_CMD_DELETE_PARTITION "delete-logical-partition"
+#define FB_CMD_RESIZE_PARTITION "resize-logical-partition"
#define RESPONSE_OKAY "OKAY"
#define RESPONSE_FAIL "FAIL"
@@ -53,3 +56,4 @@
#define FB_VAR_PARTITION_SIZE "partition-size"
#define FB_VAR_SLOT_SUCCESSFUL "slot-successful"
#define FB_VAR_SLOT_UNBOOTABLE "slot-unbootable"
+#define FB_VAR_IS_LOGICAL "is-logical"