summaryrefslogtreecommitdiff
path: root/fastboot/device/variables.cpp
diff options
context:
space:
mode:
authorDavid Anderson <dvander@google.com>2018-11-05 18:01:32 -0800
committerDavid Anderson <dvander@google.com>2018-11-06 11:43:04 -0800
commit90fe0a43abaa0d395b8884a690c0d3661282b044 (patch)
tree7ff331df8e85ef8aaa1b1ec829649bb44c58b0dd /fastboot/device/variables.cpp
parent96a9fd406326339e66ed833f2a1a2349c0173210 (diff)
fastboot: Query the name of the super partition.
This patch adds a new variable, "super-partition-name", to query the name of the super partition (with a slot suffix if it has one). The fastboot flashing tool has been updated to query this variable. Since the super partition name can no longer be determined without fastbootd, the presence of super_empty.img is used to test for dynamic partition support rather than the presence of a super partition. Bug: 116802789 Test: fastboot flashall on retrofit device Change-Id: If830768eba6de7f31ac3183c64167fae973c77a4
Diffstat (limited to 'fastboot/device/variables.cpp')
-rw-r--r--fastboot/device/variables.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/fastboot/device/variables.cpp b/fastboot/device/variables.cpp
index cbd2856dc..601af3446 100644
--- a/fastboot/device/variables.cpp
+++ b/fastboot/device/variables.cpp
@@ -24,7 +24,9 @@
#include <android-base/stringprintf.h>
#include <android-base/strings.h>
#include <ext4_utils/ext4_utils.h>
+#include <fs_mgr.h>
#include <healthhalutils/HealthHalUtils.h>
+#include <liblp/liblp.h>
#include "fastboot_device.h"
#include "flashing.h"
@@ -35,6 +37,7 @@ using ::android::hardware::boot::V1_0::Slot;
using ::android::hardware::fastboot::V1_0::FileSystemType;
using ::android::hardware::fastboot::V1_0::Result;
using ::android::hardware::fastboot::V1_0::Status;
+using namespace android::fs_mgr;
constexpr char kFastbootProtocolVersion[] = "0.4";
@@ -417,3 +420,10 @@ bool GetHardwareRevision(FastbootDevice* /* device */, const std::vector<std::st
*message = android::base::GetProperty("ro.revision", "");
return true;
}
+
+bool GetSuperPartitionName(FastbootDevice* device, const std::vector<std::string>& /* args */,
+ std::string* message) {
+ uint32_t slot_number = SlotNumberForSlotSuffix(device->GetCurrentSlot());
+ *message = fs_mgr_get_super_partition_name(slot_number);
+ return true;
+}