fs_config_generator: use vendor shell for vendor AID
Bug: 109748241
Test: Build and check generated file
Change-Id: Ib6bca77aa906a1aa9ed41c51bddb2871ecb66e1a
diff --git a/tools/fs_config/fs_config_generator.py b/tools/fs_config/fs_config_generator.py
index 4839578..cd534ec 100755
--- a/tools/fs_config/fs_config_generator.py
+++ b/tools/fs_config/fs_config_generator.py
@@ -138,13 +138,13 @@
'media_codec': 'mediacodec'
}
- def __init__(self, identifier, value, found):
+ def __init__(self, identifier, value, found, login_shell):
"""
Args:
identifier: The identifier name for a #define <identifier>.
value: The value of the AID, aka the uid.
found (str): The file found in, not required to be specified.
-
+ login_shell (str): The shell field per man (5) passwd file.
Raises:
ValueError: if the friendly name is longer than 31 characters as
that is bionic's internal buffer size for name.
@@ -154,6 +154,8 @@
self.identifier = identifier
self.value = value
self.found = found
+ self.login_shell = login_shell
+
try:
self.normalized_value = str(int(value, 0))
except ValueException:
@@ -171,7 +173,8 @@
return self.identifier == other.identifier \
and self.value == other.value and self.found == other.found \
- and self.normalized_value == other.normalized_value
+ and self.normalized_value == other.normalized_value \
+ and self.login_shell == other.login_shell
@staticmethod
def is_friendly(name):
@@ -336,7 +339,7 @@
ValueError: With message set to indicate the error.
"""
- aid = AID(identifier, value, self._aid_header)
+ aid = AID(identifier, value, self._aid_header, '/system/bin/sh')
# duplicate name
if aid.friendly in self._aid_name_to_value:
@@ -647,7 +650,7 @@
sys.exit(error_message('Found specified but unset "value"'))
try:
- aid = AID(section_name, value, file_name)
+ aid = AID(section_name, value, file_name, '/vendor/bin/sh')
except ValueError as exception:
sys.exit(error_message(exception))
@@ -1280,7 +1283,7 @@
except ValueError as exception:
sys.exit(exception)
- print "%s::%s:%s::/:/system/bin/sh" % (logon, uid, uid)
+ print "%s::%s:%s::/:%s" % (logon, uid, uid, aid.login_shell)
@generator('group')