fs_config: include both oem ranges
Support both OEM and OEM2 ranges as defined by
private/android_filesystem_config.h.
Change-Id: I1aef62fa446301bb68b0309b198f3fe8b5eb92c7
Signed-off-by: William Roberts <william.c.roberts@intel.com>
diff --git a/tools/fs_config/fs_config_generator.py b/tools/fs_config/fs_config_generator.py
index e66e295..482c2bc 100755
--- a/tools/fs_config/fs_config_generator.py
+++ b/tools/fs_config/fs_config_generator.py
@@ -33,8 +33,10 @@
FILE_COMMENT = '// Defined in file: \"%s\"'
# from system/core/include/private/android_filesystem_config.h
-AID_OEM_RESERVED_START = 2900
-AID_OEM_RESERVED_END = 2999
+AID_OEM_RESERVED_RANGES = [
+ (2900, 2999),
+ (5000, 5999),
+]
AID_MATCH = re.compile('AID_[a-zA-Z]+')
@@ -52,9 +54,9 @@
raise Exception(errmsg % ('Invalid "value", not a number, got: \"%s\"' % value))
# Values must be within OEM range
- if (v < AID_OEM_RESERVED_START) or (v > AID_OEM_RESERVED_END):
- s = '"value" not in valid range %d - %d, got: %s'
- s = s % (AID_OEM_RESERVED_START, AID_OEM_RESERVED_END, value)
+ if not any(lower <= v <= upper for (lower, upper) in AID_OEM_RESERVED_RANGES):
+ s = '"value" not in valid range %s, got: %s'
+ s = s % (str(AID_OEM_RESERVED_RANGES), value)
raise Exception(errmsg % s)
# use the normalized int value in the dict and detect