am 8317e664: am 96a57e73: make info_dict and GetTypeAndDevice available to device extensions

Merge commit '8317e66433903badaec8ebd2b9ec2b8153f3d612'

* commit '8317e66433903badaec8ebd2b9ec2b8153f3d612':
  make info_dict and GetTypeAndDevice available to device extensions
This commit is contained in:
Doug Zongker
2010-09-26 15:17:44 -07:00
committed by Android Git Automerger
3 changed files with 27 additions and 29 deletions

View File

@@ -765,3 +765,20 @@ def ComputeDifferences(diffs):
th.start()
while threads:
threads.pop().join()
# map recovery.fstab's fs_types to mount/format "partition types"
PARTITION_TYPES = { "yaffs2": "MTD", "mtd": "MTD",
"ext4": "EMMC", "emmc": "EMMC" }
def GetTypeAndDevice(mount_point, info):
fstab = info["fstab"]
if fstab:
return PARTITION_TYPES[fstab[mount_point].fs_type], fstab[mount_point].device
else:
devices = {"/boot": "boot",
"/recovery": "recovery",
"/radio": "radio",
"/data": "userdata",
"/cache": "cache"}
return info["partition_type"], info.get("partition_path", "") + devices[mount_point]