aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author3l H4ck3r C0mf0r7 <pablexworld13@gmail.com>2021-10-10 15:27:53 -0300
committerNolen Johnson <johnsonnolen@gmail.com>2023-10-11 14:25:46 -0400
commit20a492d803421dad5f423337a7c4fcf8542f741c (patch)
tree090dc74bbe294d5789a677b4db77dc8dfd4b930c
parent8f28f1ba13fd32636abfd0dd8f2fc8f88bb75edc (diff)
downloadgptfdisk-20a492d803421dad5f423337a7c4fcf8542f741c.tar.gz
Fix hybrid MBR recognition on --android-dumpandroid-u-rb-dp-10-gplandroid-u-rb-dp-10-gpl
Android parses the output of 'sgdisk --android-dump <blockdev>' to detect the partition table of external storage devices (SD cards, USB storage devices, etc.) This function exclusive to Android's fork of sgdisk is missing a switch case handling devices that use hybrid MBR as their partitioning scheme. In Linux, devices using hybrid MBR are handled by simply ignoring the MBR table, and using GPT. Android should do the same. This commit fixes external storage devices formatted with hybrid GPT being treated by Android as unknown. Change-Id: I7a06e1f24674e7566edc834b95e4e1898e28ea75
-rw-r--r--sgdisk.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sgdisk.cc b/sgdisk.cc
index 1892e2d..bdd077b 100644
--- a/sgdisk.cc
+++ b/sgdisk.cc
@@ -58,6 +58,7 @@ static int android_dump(char* device) {
}
}
break;
+ case hybrid:
case gpt:
gptData.JustLooking();
if (!gptData.LoadPartitions((string) device)) {