mirror of
https://gitee.com/openharmony/startup_init
synced 2024-11-24 00:30:12 +00:00
系统参数归一,支持liteos
系统参数归一,支持liteos Signed-off-by: Mupceet <laiguizhong@huawei.com> ut错误 Signed-off-by: Mupceet <laiguizhong@huawei.com> ut错误 Signed-off-by: Mupceet <laiguizhong@huawei.com> fix copyright Signed-off-by: Mupceet <laiguizhong@huawei.com> 文件权限 Signed-off-by: Mupceet <laiguizhong@huawei.com> fix dac space Signed-off-by: Mupceet <laiguizhong@huawei.com>
This commit is contained in:
parent
13f6415f59
commit
09552249ce
@ -16,6 +16,7 @@ declare_args() {
|
||||
enable_ohos_startup_init_feature_deviceinfo = true
|
||||
param_test = true
|
||||
control_test = false
|
||||
|
||||
# init begetctl support liteos
|
||||
enable_ohos_startup_init_feature_begetctl_liteos = false
|
||||
enable_ohos_startup_init_lite_use_thirdparty_mbedtls = true
|
||||
|
2
interfaces/hals/hal_sys_param.h
Executable file → Normal file
2
interfaces/hals/hal_sys_param.h
Executable file → Normal file
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2020-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
2
interfaces/hals/hal_token.h
Executable file → Normal file
2
interfaces/hals/hal_token.h
Executable file → Normal file
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2020-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
@ -41,9 +41,11 @@ if (defined(ohos_lite)) {
|
||||
"INIT_LOG_INIT=3",
|
||||
"OHOS_LITE",
|
||||
]
|
||||
deps = []
|
||||
if (enable_ohos_startup_init_feature_begetctl_liteos) {
|
||||
sources += syspara_sources
|
||||
defines += [ "LITEOS_SUPPORT" ]
|
||||
deps += [ "$ohos_product_adapter_dir/utils/sys_param:hal_sysparam" ]
|
||||
} else {
|
||||
sources += [ "syscap/init_syscap.c" ]
|
||||
}
|
||||
@ -60,8 +62,7 @@ if (defined(ohos_lite)) {
|
||||
"//base/startup/init_lite/services/param/include",
|
||||
"//base/startup/init_lite/interfaces/innerkits/include",
|
||||
]
|
||||
deps = [
|
||||
"$ohos_product_adapter_dir/utils/sys_param:hal_sysparam",
|
||||
deps += [
|
||||
"//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
|
||||
"//base/startup/init_lite/services/utils:libinit_tools",
|
||||
"//third_party/bounds_checking_function:libsec_shared",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2020 Huawei Device Co., Ltd.
|
||||
# Copyright (c) 2020-2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2020-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2020-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2020-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2020-2021 Huawei Device Co., Ltd.
|
||||
# Copyright (c) 2020-2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
@ -143,8 +143,8 @@ if (defined(ohos_lite)) {
|
||||
part_name = "init"
|
||||
}
|
||||
|
||||
ohos_prebuilt_etc("charing.group") {
|
||||
source = "//base/startup/init_lite/services/etc/device.charing.group.cfg"
|
||||
ohos_prebuilt_etc("charge.group") {
|
||||
source = "//base/startup/init_lite/services/etc/device.charge.group.cfg"
|
||||
part_name = "init"
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ if (defined(ohos_lite)) {
|
||||
group("etc_files") {
|
||||
deps = [
|
||||
":boot.group",
|
||||
":charing.group",
|
||||
":charge.group",
|
||||
":chipset-sandbox.json",
|
||||
":console.cfg",
|
||||
":group",
|
||||
|
0
services/etc/device.charge.group.cfg
Executable file → Normal file
0
services/etc/device.charge.group.cfg
Executable file → Normal file
@ -58,7 +58,7 @@ extern "C" {
|
||||
#define DAC_DEFAULT_USER 0
|
||||
#else
|
||||
#define PARAM_WORKSPACE_MAX (80 * 1024)
|
||||
#define PARAM_WORKSPACE_SMALL (1024 * 10)
|
||||
#define PARAM_WORKSPACE_SMALL (1024 * 20)
|
||||
#ifdef STARTUP_INIT_TEST
|
||||
#define DAC_DEFAULT_MODE 0777
|
||||
#define PARAM_WORKSPACE_DEF (1024 * 50)
|
||||
|
2
test/moduletest/syspara.cpp
Executable file → Normal file
2
test/moduletest/syspara.cpp
Executable file → Normal file
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -201,10 +201,11 @@ if (defined(ohos_lite)) {
|
||||
"../param/param_stub.cpp",
|
||||
"../param/param_unittest.cpp",
|
||||
"../param/paramservice_unittest.cpp",
|
||||
"../syspara/syspara_unittest.cpp",
|
||||
"cmd_func_test.cpp",
|
||||
]
|
||||
|
||||
if (enable_ohos_startup_init_feature_begetctl_liteos) {
|
||||
sources += [ "../syspara/syspara_unittest.cpp" ]
|
||||
}
|
||||
deps += [
|
||||
"//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
|
||||
"//base/startup/init_lite/services/loopevent:loopevent",
|
||||
|
@ -323,7 +323,7 @@ void PrepareInitUnitTestEnv(void)
|
||||
|
||||
#if !(defined __LITEOS_A__ || defined __LITEOS_M__)
|
||||
// for cmdline
|
||||
const char *cmdLine = "bootgroup=device.charing.group earlycon=uart8250,mmio32,0xfe660000 \
|
||||
const char *cmdLine = "bootgroup=device.charge.group earlycon=uart8250,mmio32,0xfe660000 \
|
||||
root=PARTUUID=614e0000-0000 rw rootwait rootfstype=ext4 console=ttyFIQ0 hardware=rk3568";
|
||||
CreateTestFile(BOOT_CMD_LINE, cmdLine);
|
||||
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "param_message.h"
|
||||
#include "param_stub.h"
|
||||
#include "trigger_manager.h"
|
||||
#include "le_timer.h"
|
||||
|
||||
using namespace testing::ext;
|
||||
using namespace std;
|
||||
@ -428,7 +427,6 @@ public:
|
||||
AddWatch(MSG_ADD_WATCHER, name, value);
|
||||
char buffer[] = "testbuff";
|
||||
CheckTrigger(GetTriggerWorkSpace(), TRIGGER_PARAM_WATCH, buffer, strlen(buffer), TestTriggerExecute);
|
||||
SystemDumpTriggers(1);
|
||||
AddWatch(MSG_DEL_WATCHER, name, value);
|
||||
return 0;
|
||||
}
|
||||
@ -509,11 +507,6 @@ HWTEST_F(ParamServiceUnitTest, TestAddParamWatch3, TestSize.Level0)
|
||||
{
|
||||
ParamServiceUnitTest test;
|
||||
test.TestAddParamWatch3();
|
||||
if (GetParamService()->timer != nullptr) {
|
||||
((TimerTask *)GetParamService()->timer)->processTimer(nullptr, nullptr);
|
||||
}
|
||||
int hashCode = CheckWatchTriggerTimeout();
|
||||
EXPECT_EQ(hashCode, 0);
|
||||
}
|
||||
|
||||
HWTEST_F(ParamServiceUnitTest, TestCloseTriggerWatch, TestSize.Level0)
|
||||
|
Loading…
Reference in New Issue
Block a user