Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
95316f57
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
1 年多 前同步成功
通知
3
Star
37
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Startup Init Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
95316f57
编写于
4月 01, 2022
作者:
X
xionglei6
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:log fix
Signed-off-by:
N
xionglei6
<
xionglei6@huawei.com
>
上级
11ab7bb0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
128 addition
and
94 deletion
+128
-94
interfaces/innerkits/BUILD.gn
interfaces/innerkits/BUILD.gn
+115
-90
services/log/BUILD.gn
services/log/BUILD.gn
+9
-3
services/log/init_log.c
services/log/init_log.c
+4
-1
未找到文件。
interfaces/innerkits/BUILD.gn
浏览文件 @
95316f57
...
...
@@ -11,103 +11,128 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import("//base/startup/init_lite/begetd.gni")
import("//build/ohos.gni")
if (defined(ohos_lite)) {
static_library("libbegetutil") {
sources = [ "//base/startup/init_lite/services/log/init_log.c" ]
defines = [
"_GNU_SOURCE",
"OHOS_LITE",
"INIT_LOG_INIT=3",
]
include_dirs = [
"./include",
"//third_party/bounds_checking_function/include",
"//base/startup/init_lite/services/include",
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/interfaces/innerkits/fd_holder",
]
deps = [
"//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
"//base/startup/init_lite/services/loopevent:loopevent",
"//base/startup/init_lite/services/utils:libinit_tools",
"//third_party/bounds_checking_function:libsec_static",
]
}
} else {
import("//base/startup/init_lite/begetd.gni")
import("//build/ohos.gni")
config("exported_header_files") {
visibility = [ ":*" ]
include_dirs = [ "include/" ]
}
fs_manager_sources = [
"fs_manager/fstab.c",
"fs_manager/fstab_mount.c",
]
config("exported_header_files") {
visibility = [ ":*" ]
include_dirs = [ "include/" ]
}
ohos_shared_library("libbegetutil") {
sources = [
"//base/startup/init_lite/services/log/init_log.c",
"fd_holder/fd_holder.c",
"fd_holder/fd_holder_internal.c",
"file/init_file.c",
"reboot/init_reboot_innerkits.c",
"service_control/service_control.c",
"socket/init_socket.c",
"syscap/init_syscap.c",
]
sources += fs_manager_sources
defines = [ "INIT_AGENT" ]
include_dirs = [
"./include",
"//third_party/bounds_checking_function/include",
"//base/startup/init_lite/services/include",
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/interfaces/innerkits/fd_holder",
]
deps = [
"//base/startup/init_lite/services/loopevent:loopevent",
"//base/startup/init_lite/services/param:param_client",
"//base/startup/init_lite/services/utils:libinit_tools",
"//base/startup/init_lite/services/utils:libinit_utils",
"//third_party/bounds_checking_function:libsec_shared",
"//third_party/openssl:libcrypto_static",
"//utils/native/base:utils",
fs_manager_sources = [
"fs_manager/fstab.c",
"fs_manager/fstab_mount.c",
]
external_deps = [ "hilog_native:libhilog_base" ]
public_configs = [ ":exported_header_files" ]
part_name = "init"
install_images = [
"system",
"updater",
]
}
# watcher lib must separate compilation avoid interdependence.
ohos_shared_library("libbeget_proxy") {
sources = [
"//base/startup/init_lite/device_info/device_info_kits.cpp",
"//base/startup/init_lite/device_info/device_info_proxy.cpp",
"//base/startup/init_lite/services/log/init_log.c",
"service_watcher/service_watcher.c",
]
ohos_shared_library("libbegetutil") {
sources = [
"//base/startup/init_lite/services/log/init_log.c",
"fd_holder/fd_holder.c",
"fd_holder/fd_holder_internal.c",
"file/init_file.c",
"reboot/init_reboot_innerkits.c",
"service_control/service_control.c",
"socket/init_socket.c",
"syscap/init_syscap.c",
]
sources += fs_manager_sources
defines = [ "INIT_AGENT" ]
include_dirs = [
"./include",
"//base/startup/init_lite/device_info",
"//utils/native/base/include",
"//base/startup/init_lite/interfaces/innerkits/include",
"//base/startup/init_lite/services/include",
"//base/startup/init_lite/services/include/param",
"//third_party/bounds_checking_function/include",
]
include_dirs = [
"./include",
"//third_party/bounds_checking_function/include",
"//base/startup/init_lite/services/include",
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/interfaces/innerkits/fd_holder",
]
deps = [
"//base/startup/init_lite/services/loopevent:loopevent",
"//base/startup/init_lite/services/param:param_client",
"//base/startup/init_lite/services/utils:libinit_tools",
"//base/startup/init_lite/services/utils:libinit_utils",
"//third_party/bounds_checking_function:libsec_shared",
"//third_party/openssl:libcrypto_static",
"//utils/native/base:utils",
]
external_deps = [ "hilog_native:libhilog_base" ]
public_configs = [ ":exported_header_files" ]
part_name = "init"
install_images = [
"system",
"updater",
]
}
defines = [ "INIT_AGENT" ]
deps = [
"//base/startup/init_lite/services/param/watcher:param_watcheragent",
"//base/startup/init_lite/services/utils:libinit_utils",
"//third_party/bounds_checking_function:libsec_shared",
"//utils/native/base:utils",
]
# watcher lib must separate compilation avoid interdependence.
ohos_shared_library("libbeget_proxy") {
sources = [
"//base/startup/init_lite/device_info/device_info_kits.cpp",
"//base/startup/init_lite/device_info/device_info_proxy.cpp",
"//base/startup/init_lite/services/log/init_log.c",
"service_watcher/service_watcher.c",
]
external_dep
s = [
"hilog_native:libhilog_bas
e",
"ipc:ipc_core
",
"safwk:system_ability_fwk
",
"samgr_standard:samgr_proxy
",
]
part_name = "init"
install_images = [ "system" ]
}
include_dir
s = [
"./includ
e",
"//base/startup/init_lite/device_info
",
"//utils/native/base/include
",
"//base/startup/init_lite/interfaces/innerkits/include
",
"//base/startup/init_lite/services/include",
"//base/startup/init_lite/services/include/param",
"//third_party/bounds_checking_function/include",
]
# For init only
ohos_static_library("libfsmanager_static") {
sources = fs_manager_sources
include_dirs = [
"//base/startup/init_lite/interfaces/innerkits/include",
"//third_party/bounds_checking_function/include",
"//base/startup/init_lite/services/log",
"//base/startup/init_lite/services/include",
]
defines = [ "INIT_AGENT" ]
deps = [
"//base/startup/init_lite/services/param/watcher:param_watcheragent",
"//base/startup/init_lite/services/utils:libinit_utils",
"//third_party/bounds_checking_function:libsec_shared",
"//utils/native/base:utils",
]
external_deps = [
"hilog_native:libhilog_base",
"ipc:ipc_core",
"safwk:system_ability_fwk",
"samgr_standard:samgr_proxy",
]
part_name = "init"
install_images = [ "system" ]
}
# For init only
ohos_static_library("libfsmanager_static") {
sources = fs_manager_sources
include_dirs = [
"//base/startup/init_lite/interfaces/innerkits/include",
"//third_party/bounds_checking_function/include",
"//base/startup/init_lite/services/log",
"//base/startup/init_lite/services/include",
]
part_name = "init"
part_name = "init"
}
}
services/log/BUILD.gn
浏览文件 @
95316f57
...
...
@@ -13,13 +13,19 @@
if (defined(ohos_lite)) {
static_library("init_log") {
sources = [ "init_log.c" ]
defines = [ "OHOS_LITE" ]
public_deps = [ "//third_party/bounds_checking_function:libsec_static" ]
defines = [
"_GNU_SOURCE",
"OHOS_LITE",
"INIT_LOG_INIT=1",
]
include_dirs = [
"//base/hiviewdfx/hilog_lite/interfaces/native/kits",
"//base/startup/init_lite/interfaces/innerkits/include",
]
deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ]
deps = [
"//third_party/bounds_checking_function:libsec_static",
"//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static"
]
}
} else {
import("//build/ohos.gni")
...
...
services/log/init_log.c
浏览文件 @
95316f57
...
...
@@ -23,6 +23,9 @@
#include "securec.h"
#ifdef OHOS_LITE
#ifndef INIT_LOG_INIT
#define INIT_LOG_INIT LOG_CORE
#endif
#include "hilog/log.h"
#endif
#ifdef INIT_AGENT
...
...
@@ -112,7 +115,7 @@ void InitLog(InitLogLevel logLevel, unsigned int domain, const char *tag, const
va_end
(
vargs
);
#ifdef OHOS_LITE
static
LogLevel
LOG_LEVEL
[]
=
{
LOG_DEBUG
,
LOG_INFO
,
LOG_WARN
,
LOG_ERROR
,
LOG_FATAL
};
(
void
)
HiLogPrint
(
LOG_CORE
,
LOG_LEVEL
[
logLevel
],
domain
,
tag
,
"%{public}s"
,
tmpFmt
);
(
void
)
HiLogPrint
(
INIT_LOG_INIT
,
LOG_LEVEL
[
logLevel
],
domain
,
tag
,
"%{public}s"
,
tmpFmt
);
#else
#ifdef INIT_DMESG
LogToDmesg
(
logLevel
,
tag
,
tmpFmt
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录