diff --git a/releasetools/c1_edify_generator.py b/releasetools/c1_edify_generator.py index a2ccc30..95bdf48 100755 --- a/releasetools/c1_edify_generator.py +++ b/releasetools/c1_edify_generator.py @@ -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) diff --git a/releasetools/c1_ota_from_target_files b/releasetools/c1_ota_from_target_files index bb6b61b..358b3b2 100755 --- a/releasetools/c1_ota_from_target_files +++ b/releasetools/c1_ota_from_target_files @@ -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")