Merge "fs_config: include both oem ranges"

This commit is contained in:
Treehugger Robot
2016-04-18 20:35:27 +00:00
committed by Gerrit Code Review
2 changed files with 11 additions and 6 deletions

View File

@@ -90,7 +90,10 @@ value:
It is an error to specify multiple sections with the same [AID_<name>]. Per the ini It is an error to specify multiple sections with the same [AID_<name>]. Per the ini
specifications enforced by Pythons ConfigParser. It is also an error to specify specifications enforced by Pythons ConfigParser. It is also an error to specify
multiple sections with the same value option. It is also an error to specify a value multiple sections with the same value option. It is also an error to specify a value
that is outside of the OEM range AID_OEM_RESERVED_START(2900) and AID_OEM_RESERVED_END(2999) that is outside of the inclusive OEM ranges:
* AID_OEM_RESERVED_START(2900) - AID_OEM_RESERVED_END(2999)
* AID_OEM_RESERVED_2_START(5000) - AID_OEM_RESERVED_2_END(5999)
as defined by system/core/include/private/android_filesystem_config.h. as defined by system/core/include/private/android_filesystem_config.h.
Ordering within the TARGET_FS_CONFIG_GEN files is not relevant. The paths for files are sorted Ordering within the TARGET_FS_CONFIG_GEN files is not relevant. The paths for files are sorted

View File

@@ -33,8 +33,10 @@ GENERIC_DEFINE = "#define %s\t%s"
FILE_COMMENT = '// Defined in file: \"%s\"' FILE_COMMENT = '// Defined in file: \"%s\"'
# from system/core/include/private/android_filesystem_config.h # from system/core/include/private/android_filesystem_config.h
AID_OEM_RESERVED_START = 2900 AID_OEM_RESERVED_RANGES = [
AID_OEM_RESERVED_END = 2999 (2900, 2999),
(5000, 5999),
]
AID_MATCH = re.compile('AID_[a-zA-Z]+') AID_MATCH = re.compile('AID_[a-zA-Z]+')
@@ -52,9 +54,9 @@ def handle_aid(file_name, section_name, config, aids, seen_aids):
raise Exception(errmsg % ('Invalid "value", not a number, got: \"%s\"' % value)) raise Exception(errmsg % ('Invalid "value", not a number, got: \"%s\"' % value))
# Values must be within OEM range # Values must be within OEM range
if (v < AID_OEM_RESERVED_START) or (v > AID_OEM_RESERVED_END): if not any(lower <= v <= upper for (lower, upper) in AID_OEM_RESERVED_RANGES):
s = '"value" not in valid range %d - %d, got: %s' s = '"value" not in valid range %s, got: %s'
s = s % (AID_OEM_RESERVED_START, AID_OEM_RESERVED_END, value) s = s % (str(AID_OEM_RESERVED_RANGES), value)
raise Exception(errmsg % s) raise Exception(errmsg % s)
# use the normalized int value in the dict and detect # use the normalized int value in the dict and detect