diff --git a/services/modules/init_context/init_context.c b/services/modules/init_context/init_context.c index 7290897c8c03100393ec665bb2cc968e29c9ab77..f8478d72765c7088527f756c6be63669620a6901 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 baa19bcbe9661ced6ba6b6adefa8015c7b2f17f6..267d76837c191762fa423b90d206ca750f1faab4 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 }