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: Ic80a3377a5a94c9d10dd464eb1257b157a947510
(cherry picked from commit 548eb76c8f)
This commit is contained in:
Tao Bao
2015-06-10 12:32:41 -07:00
parent 1b96592aab
commit df06e96826
2 changed files with 16 additions and 3 deletions

View File

@@ -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):