From 47a8bda504d480984d731a1c76d20e43a319cce9 Mon Sep 17 00:00:00 2001 From: cheng_jinsong Date: Thu, 8 Jun 2023 19:34:13 +0800 Subject: [PATCH] close chipset init Signed-off-by: cheng_jinsong --- services/modules/init_context/init_context.c | 2 ++ services/modules/init_context/init_context_static.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/services/modules/init_context/init_context.c b/services/modules/init_context/init_context.c index 7290897c..f8478d72 100644 --- a/services/modules/init_context/init_context.c +++ b/services/modules/init_context/init_context.c @@ -235,8 +235,10 @@ static void SubInitMain(InitContextType type, int readFd, int writeFd) static int SubInitSetSelinuxContext(InitContextType type) { PLUGIN_CHECK(type < INIT_CONTEXT_MAIN, return -1, "Invalid type %d", type); +#ifdef INIT_SUPPORT_CHIPSET_INIT #ifdef WITH_SELINUX setcon(g_subContext[type]); +#endif #endif return 0; } diff --git a/services/modules/init_context/init_context_static.c b/services/modules/init_context/init_context_static.c index baa19bcb..267d7683 100644 --- a/services/modules/init_context/init_context_static.c +++ b/services/modules/init_context/init_context_static.c @@ -83,5 +83,9 @@ int SetSubInitContext(const ConfigContext *context, const char *service) int CheckExecuteInSubInit(const ConfigContext *context) { +#ifdef INIT_SUPPORT_CHIPSET_INIT return !(context == NULL || context->type == INIT_CONTEXT_MAIN || g_currContext.type != INIT_CONTEXT_MAIN); +#else + return 0; +#endif } -- GitLab