del logfile and hw_sc param

Signed-off-by: Mupceet <laiguizhong@huawei.com>
This commit is contained in:
Mupceet 2022-06-22 11:31:44 +08:00
parent 093b3ac74b
commit 55de52d588
15 changed files with 11 additions and 51 deletions

View File

@ -1,20 +1,9 @@
{
"jobs" : [ {
"name" : "services:deviceinfoservice",
"cmds" : [
"chown shell system /data/init_agent/begetctrl.log",
"chmod 0666 /data/init_agent/begetctrl.log"
]
}
],
"services" : [{
"name" : "deviceinfoservice",
"path" : ["/system/bin/sa_main", "/system/profile/deviceinfoservice.xml"],
"uid" : "deviceinfo",
"gid" : ["deviceinfo", "shell"],
"jobs" : {
"on-start" : "services:deviceinfoservice"
},
"secon" : "u:r:deviceinfoservice:s0"
}
]

View File

@ -158,7 +158,6 @@ if (defined(ohos_lite)) {
defines = [
"INIT_AGENT",
"INIT_FILE",
"_GNU_SOURCE",
"USE_MBEDTLS",
]
@ -258,7 +257,6 @@ if (defined(ohos_lite)) {
defines = [
"INIT_AGENT",
"INIT_FILE",
"_GNU_SOURCE",
"USE_MBEDTLS",
]

View File

@ -181,7 +181,6 @@ if (defined(ohos_lite)) {
defines = [
"INIT_AGENT",
"INIT_FILE",
"_GNU_SOURCE",
]

View File

@ -166,7 +166,6 @@
"chmod 0771 /data/resource-cache",
"mkdir /data/lost+found 0770 root root",
"mkdir /data/drm 0770 drm drm",
"mkdir /data/mediadrm 0770 mediadrm mediadrm",
"mkdir /data/nfc 0770 nfc nfc",
"mkdir /data/nfc/param 0770 nfc nfc",
"mkdir /data/backup 0700 system system",
@ -189,7 +188,6 @@
"mkdir /data/cache/recovery 0770 system cache",
"mkdir /data/cache/backup_stage 0700 system system",
"mkdir /data/cache/backup 0700 system system",
"mkdir /data/init_agent 0770 shell system",
"setparam sys.use_memfd false",
"chown root system /dev/fscklogs/log",
"chmod 0770 /dev/fscklogs/log",

View File

@ -178,7 +178,6 @@
"mkdir /data/cache/recovery 0770 system cache",
"mkdir /data/cache/backup_stage 0700 system system",
"mkdir /data/cache/backup 0700 system system",
"mkdir /data/init_agent 0770 shell system",
"setparam sys.use_memfd false",
"chown root system /dev/fscklogs/log",
"chmod 0770 /dev/fscklogs/log",

View File

@ -11,22 +11,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
build_version = 2.0
# whether ohos is enabled.
hw_sc.build.os.enable=true
# ohos API version number.
hw_sc.build.os.apiversion=9
# ohos system version.
hw_sc.build.os.version=2.2.0
# ohos device type please use hw_sc.build.os.devicetype
# ohos release type
hw_sc.build.os.releasetype=Canary1
const.actionable_compatible_property.enabled=false
const.postinstall.fstab.prefix=/system
const.secure=1
@ -55,4 +39,3 @@ const.product.build.host=default
const.product.build.date=default
const.product.hardwareprofile=default
const.ohos.buildroothash=default
const.ohos.sdkapilevel=8

View File

@ -11,12 +11,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
build_version = root:root:0777
hw_sc.build.os.enable = root:root:0777
hw_sc.build.os.apiversion = root:root:0777
hw_sc.build.os.version = root:root:0777
hw_sc.build.os.releasetype = root:root:0777
const.actionable_compatible_property.enabled = root:root:0777
const.postinstall.fstab.prefix = root:root:0777
const.secure = root:root:0777

View File

@ -30,7 +30,7 @@ int main(int argc, char * const argv[])
INIT_LOGE("Process id error %d!", getpid());
return 0;
}
EnableInitLog(INIT_DEBUG);
EnableInitLog(INIT_INFO);
if (isSecondStage == 0) {
SystemPrepare();
} else {

View File

@ -320,7 +320,6 @@ static void DoRestorecon(const struct CmdArgs *ctx)
static void DoLoadAccessTokenId(const struct CmdArgs *ctx)
{
INIT_LOGI("load access token id : %s", ctx->argv[0]);
LoadAccessTokenId();
}

View File

@ -52,10 +52,7 @@ if (defined(ohos_lite)) {
ohos_static_library("agent_log") {
sources = base_sources
defines = [
"INIT_AGENT",
"INIT_FILE",
]
defines = [ "INIT_AGENT" ]
public_configs = [ ":exported_header_files" ]
include_dirs = [ "//third_party/bounds_checking_function/include" ]
external_deps = [ "hilog_native:libhilog_base" ]

View File

@ -121,7 +121,7 @@ static void InitLog(InitLogLevel logLevel, unsigned int domain, const char *tag,
static LogLevel LOG_LEVEL[] = { LOG_DEBUG, LOG_INFO, LOG_WARN, LOG_ERROR, LOG_FATAL };
HiLogBasePrint(LOG_CORE, LOG_LEVEL[logLevel], domain, tag, "%{public}s", tmpFmt);
#ifdef INIT_FILE
LogToFile("/data/init_agent/begetctl.log", tag, tmpFmt);
LogToFile(INIT_LOG_PATH"begetctl.log", tag, tmpFmt);
#endif
#endif
}

View File

@ -134,10 +134,10 @@ INIT_PUBLIC_API int InitParamWorkSpace(int onlyRead)
PARAM_CHECK(ret == 0, return -1, "Failed to create hash map for workspace");
WORKSPACE_INIT_LOCK(g_paramWorkSpace);
ListInit(&g_paramWorkSpace.workSpaceList);
PARAM_SET_FLAG(g_paramWorkSpace.flags, WORKSPACE_FLAGS_INIT);
ret = RegisterSecurityOps(onlyRead);
PARAM_CHECK(ret == 0, return -1, "Failed to get security operations");
PARAM_SET_FLAG(g_paramWorkSpace.flags, WORKSPACE_FLAGS_INIT);
#ifndef PARAM_SUPPORT_SELINUX
ret = AddWorkSpace(WORKSPACE_NAME_NORMAL, onlyRead, PARAM_WORKSPACE_MAX);
@ -363,6 +363,10 @@ int SystemGetParameterValue(ParamHandle handle, char *value, unsigned int *len)
INIT_INNER_API ParamWorkSpace *GetParamWorkSpace(void)
{
if (!PARAM_TEST_FLAG(g_paramWorkSpace.flags, WORKSPACE_FLAGS_INIT)) {
PARAM_LOGE("GetParamWorkSpace %p", &g_paramWorkSpace);
return NULL;
}
return &g_paramWorkSpace;
}
@ -403,6 +407,7 @@ INIT_LOCAL_API int ParamStrCpy(char *strDest, size_t destMax, const char *strSrc
*strDest = *strSrc;
strDest++;
strSrc++;
i++;
}
*strDest = '\0';
#else

View File

@ -119,7 +119,7 @@ INIT_LOCAL_API int InitWorkSpace(WorkSpace *workSpace, int onlyRead, uint32_t sp
INIT_LOCAL_API void CloseWorkSpace(WorkSpace *workSpace)
{
PARAM_CHECK(workSpace != NULL, return, "The workspace is null");
PARAM_LOGI("CloseWorkSpace %s", workSpace->fileName);
PARAM_LOGV("CloseWorkSpace %s", workSpace->fileName);
if (!PARAM_TEST_FLAG(workSpace->flags, WORKSPACE_FLAGS_INIT)) {
free(workSpace);
return;

View File

@ -32,7 +32,7 @@
static const uint32_t RECV_BUFFER_MAX = 5 * 1024;
static atomic_uint g_requestId = ATOMIC_VAR_INIT(1);
static int g_clientFd = INVALID_SOCKET;
pthread_mutex_t g_clientMutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t g_clientMutex = PTHREAD_MUTEX_INITIALIZER;
__attribute__((constructor)) static void ParameterInit(void)
{

View File

@ -214,7 +214,6 @@ ohos_unittest("init_unittest") {
defines = [
"READ_CHECK",
"INIT_AGENT",
"INIT_FILE",
"STARTUP_INIT_TEST",
"PARAM_SUPPORT_DAC",
"_GNU_SOURCE",