mirror of
https://gitee.com/openharmony/startup_init
synced 2024-11-23 16:20:00 +00:00
Check cgroup v1 layout before loading selinug
Signed-off-by: Wenrui Li <liwenrui4@huawei.com>
This commit is contained in:
parent
c820b15b3b
commit
730a22c9ac
@ -292,6 +292,14 @@ void SystemConfig(const char *uptime)
|
||||
RegisterBootStateChange(BootStateChange);
|
||||
|
||||
INIT_LOGI("boot stage: init finish.");
|
||||
|
||||
// The cgroupv1 hierarchy may be created asynchronously in the early stage,
|
||||
// so make sure it has been done before loading SELinux.
|
||||
struct stat sourceInfo = {0};
|
||||
if (stat("/dev/cgroup", &sourceInfo) == 0) {
|
||||
WaitForFile("/dev/memcg/procs", WAIT_MAX_SECOND);
|
||||
}
|
||||
|
||||
// load SELinux context and policy
|
||||
// Do not move position!
|
||||
PluginExecCmdByName("loadSelinuxPolicy", "");
|
||||
|
Loading…
Reference in New Issue
Block a user