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

module/cgroups: Skip disabled cgroup controllers

Currently the cgroups module will pull all available controllers from
/proc/cgroups and then try to mount them, including the disabled ones.
This will result in the entire mount failing.

Lines in /proc/cgroups ending in 0 correspond to disabled controllers.
Filtering those out solves the issue.
This commit is contained in:
Kajetan Puchalski 2022-07-18 13:40:37 +01:00 committed by Marc Bonnici
parent a585426924
commit 5042f474c2

View File

@ -411,7 +411,7 @@ class CgroupsModule(Module):
for line in self.target.execute('{} cat /proc/cgroups'\ for line in self.target.execute('{} cat /proc/cgroups'\
.format(self.target.busybox), as_root=self.target.is_rooted).splitlines()[1:]: .format(self.target.busybox), as_root=self.target.is_rooted).splitlines()[1:]:
line = line.strip() line = line.strip()
if not line or line.startswith('#'): if not line or line.startswith('#') or line.endswith('0'):
continue continue
name, hierarchy, num_cgroups, enabled = line.split() name, hierarchy, num_cgroups, enabled = line.split()
subsystems.append(CgroupSubsystemEntry(name, subsystems.append(CgroupSubsystemEntry(name,