mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-03 23:41:21 +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:
		@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user