mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 10:10:46 +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:
parent
3acf5d56df
commit
4b58c573a5
@ -235,7 +235,11 @@ class CgroupsModule(Module):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def probe(target):
|
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):
|
def __init__(self, target):
|
||||||
super(CgroupsModule, self).__init__(target)
|
super(CgroupsModule, self).__init__(target)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user