1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

cgroups: make probe method more robust

In case a target does not report a configuration file, we can still check
the user-space API to verify it CGroups are supported.

NOTE: a rooted target is still a mandatory requirement because some commands
are still dependant on the possibility to run them with root permissions.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
This commit is contained in:
Patrick Bellasi 2016-04-26 15:33:23 +01:00
parent 3acf5d56df
commit 4b58c573a5

View File

@ -235,7 +235,11 @@ class CgroupsModule(Module):
@staticmethod
def probe(target):
return target.config.has('cgroups') and target.is_rooted
if not target.is_rooted:
return False
if target.file_exists('/proc/cgroups'):
return True
return target.config.has('cgroups')
def __init__(self, target):
super(CgroupsModule, self).__init__(target)