summaryrefslogtreecommitdiffstats
path: root/tools/releasetools/edify_generator.py
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2015-06-22 19:17:41 -0700
committerTao Bao <tbao@google.com>2015-06-22 19:27:59 -0700
commitbebd3cfbf934beb18b73a4d4e98b98c2c0a1d6fe (patch)
tree204a8d8ae796321cb4d6cc4314a433c3005723b4 /tools/releasetools/edify_generator.py
parent5c91af0d9486f82d72d71c8962a64643d1d32f70 (diff)
downloadbuild-bebd3cfbf934beb18b73a4d4e98b98c2c0a1d6fe.zip
build-bebd3cfbf934beb18b73a4d4e98b98c2c0a1d6fe.tar.gz
build-bebd3cfbf934beb18b73a4d4e98b98c2c0a1d6fe.tar.bz2
Use fstab in the source build
When generating incremental OTAs, we should use the fstab in the source build instead of the target one. Similarly for recovery_mount_options. Bug: 22011892 Change-Id: Idb5c72d1a792e8bb40376a380e3dc06136b13652
Diffstat (limited to 'tools/releasetools/edify_generator.py')
-rw-r--r--tools/releasetools/edify_generator.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py
index 281ed59..566e687 100644
--- a/tools/releasetools/edify_generator.py
+++ b/tools/releasetools/edify_generator.py
@@ -20,11 +20,15 @@ class EdifyGenerator(object):
"""Class to generate scripts in the 'edify' recovery script language
used from donut onwards."""
- def __init__(self, version, info):
+ def __init__(self, version, info, fstab=None):
self.script = []
self.mounts = set()
self.version = version
self.info = info
+ if fstab is None:
+ self.fstab = self.info.get("fstab", None)
+ else:
+ self.fstab = fstab
def MakeTemporary(self):
"""Make a temporary script object whose commands can latter be
@@ -168,7 +172,7 @@ class EdifyGenerator(object):
where option is optname[=optvalue]
E.g. ext4=barrier=1,nodelalloc,errors=panic|f2fs=errors=recover
"""
- fstab = self.info.get("fstab", None)
+ fstab = self.fstab
if fstab:
p = fstab[mount_point]
mount_dict = {}
@@ -202,7 +206,7 @@ class EdifyGenerator(object):
self.script.append('ui_print("%s");' % (message,))
def TunePartition(self, partition, *options):
- fstab = self.info.get("fstab", None)
+ fstab = self.fstab
if fstab:
p = fstab[partition]
if p.fs_type not in ("ext2", "ext3", "ext4"):
@@ -216,7 +220,7 @@ class EdifyGenerator(object):
"""Format the given partition, specified by its mount point (eg,
"/system")."""
- fstab = self.info.get("fstab", None)
+ fstab = self.fstab
if fstab:
p = fstab[partition]
self.script.append('format("%s", "%s", "%s", "%s", "%s");' %
@@ -226,7 +230,7 @@ class EdifyGenerator(object):
def WipeBlockDevice(self, partition):
if partition not in ("/system", "/vendor"):
raise ValueError(("WipeBlockDevice doesn't work on %s\n") % (partition,))
- fstab = self.info.get("fstab", None)
+ fstab = self.fstab
size = self.info.get(partition.lstrip("/") + "_size", None)
device = fstab[partition].device
@@ -271,7 +275,7 @@ class EdifyGenerator(object):
"""Write the given package file into the partition for the given
mount point."""
- fstab = self.info["fstab"]
+ fstab = self.fstab
if fstab:
p = fstab[mount_point]
partition_type = common.PARTITION_TYPES[p.fs_type]