releasetools: force unmount system before format

Change-Id: Id7c7c9dc6cde50050256f9495288866a49baf810
This commit is contained in:
codeworkx 2012-02-25 13:17:37 +01:00
parent 69e9daff39
commit 2cd0b405fa
2 changed files with 10 additions and 0 deletions

View File

@ -35,3 +35,12 @@ class EdifyGenerator(edify_generator.EdifyGenerator):
('assert(package_extract_file("%(image)s", "/tmp/%(image)s"),\n'
' write_raw_image("/tmp/%(image)s", "%(partition)s"),\n'
' delete("/tmp/%(image)s"));') % args)
def Unmount(self, mount_point):
"""Unmount the partition with the given mount_point."""
fstab = self.info.get("fstab", None)
if fstab:
p = fstab[mount_point]
self.script.append('unmount("%s");' %
(p.mount_point))
self.mounts.add(p.mount_point)

View File

@ -68,6 +68,7 @@ def WriteFullOTAPackage(input_zip, output_zip):
if OPTIONS.wipe_user_data:
script.FormatPartition("/data")
script.Unmount("/system")
script.FormatPartition("/system")
script.Mount("/system")
script.UnpackPackageDir("recovery", "/system")