summaryrefslogtreecommitdiffstats
path: root/tools/releasetools/edify_generator.py
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2015-06-10 12:32:41 -0700
committerTao Bao <tbao@google.com>2015-06-10 15:35:34 -0700
commit548eb76c8f0e18d114ce4125905434c1c6920969 (patch)
tree7fd86125397411a2cb3a988f22e64afabc08b64e /tools/releasetools/edify_generator.py
parent942a42e31de9a0468014a256ed7fdd67cb208e64 (diff)
downloadbuild-548eb76c8f0e18d114ce4125905434c1c6920969.zip
build-548eb76c8f0e18d114ce4125905434c1c6920969.tar.gz
build-548eb76c8f0e18d114ce4125905434c1c6920969.tar.bz2
Support SELinux context label when mounting
If there is a SELinux context label in the recovery.fstab, we should honor that when mounting the partition. Bug: 19764039 Change-Id: I4df71a092b418cd340a18b2e3b0936de33d8e3f5
Diffstat (limited to 'tools/releasetools/edify_generator.py')
-rw-r--r--tools/releasetools/edify_generator.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py
index 3d0da88..281ed59 100644
--- a/tools/releasetools/edify_generator.py
+++ b/tools/releasetools/edify_generator.py
@@ -177,9 +177,12 @@ class EdifyGenerator(object):
if "=" in option:
key, value = option.split("=", 1)
mount_dict[key] = value
+ mount_flags = mount_dict.get(p.fs_type, "")
+ if p.context is not None:
+ mount_flags = p.context + ("," + mount_flags if mount_flags else "")
self.script.append('mount("%s", "%s", "%s", "%s", "%s");' % (
p.fs_type, common.PARTITION_TYPES[p.fs_type], p.device,
- p.mount_point, mount_dict.get(p.fs_type, "")))
+ p.mount_point, mount_flags))
self.mounts.add(p.mount_point)
def UnpackPackageDir(self, src, dst):