releasetools: Add --oem_no_mount option.

We may have devices with OEM-specific properties but without an OEM
partition (e.g. the properties might be set by init based on hardware
SKUs). For such devices, we supply --oem_no_mount to skip mounting the
OEM partition in the updater-script. The option is only meaningful when
-o (--oem_settings) is specified.

Bug: 27359929
Change-Id: Ic08396e478a82be4188e980e704b33b4f704a8d7
This commit is contained in:
Tao Bao
2016-02-25 19:49:55 -08:00
parent 1284954db0
commit 8608cde944
2 changed files with 27 additions and 8 deletions

View File

@@ -83,11 +83,17 @@ class EdifyGenerator(object):
raise ValueError("must specify an OEM property")
if not value:
raise ValueError("must specify the OEM value")
cmd = ('file_getprop("/oem/oem.prop", "{name}") == "{value}" || '
'abort("This package expects the value \\"{value}\\" for '
'\\"{name}\\" on the OEM partition; this has value \\"" + '
'file_getprop("/oem/oem.prop", "{name}") + "\\".");').format(
name=name, value=value)
if common.OPTIONS.oem_no_mount:
cmd = ('getprop("{name}") == "{value}" || '
'abort("This package expects the value \\"{value}\\" for '
'\\"{name}\\"; this has value \\"" + '
'getprop("{name}") + "\\".");').format(name=name, value=value)
else:
cmd = ('file_getprop("/oem/oem.prop", "{name}") == "{value}" || '
'abort("This package expects the value \\"{value}\\" for '
'\\"{name}\\" on the OEM partition; this has value \\"" + '
'file_getprop("/oem/oem.prop", "{name}") + "\\".");').format(
name=name, value=value)
self.script.append(cmd)
def AssertSomeFingerprint(self, *fp):