Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
79b28a63
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
12 个月 前同步成功
通知
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
79b28a63
编写于
11月 03, 2022
作者:
L
longzhuokun
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
解耦产品配置hal层依赖
Signed-off-by:
N
zk
<
longzhuokun1@huawei.com
>
上级
a1eab9e3
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
308 addition
and
5 deletion
+308
-5
interfaces/hals/utils/sys_param/BUILD.gn
interfaces/hals/utils/sys_param/BUILD.gn
+26
-0
interfaces/hals/utils/sys_param/hal_sys_param.c
interfaces/hals/utils/sys_param/hal_sys_param.c
+125
-0
interfaces/hals/utils/token/BUILD.gn
interfaces/hals/utils/token/BUILD.gn
+22
-0
interfaces/hals/utils/token/hal_token.c
interfaces/hals/utils/token/hal_token.c
+103
-0
interfaces/innerkits/BUILD.gn
interfaces/innerkits/BUILD.gn
+11
-1
interfaces/innerkits/token/BUILD.gn
interfaces/innerkits/token/BUILD.gn
+10
-2
test/unittest/lite/BUILD.gn
test/unittest/lite/BUILD.gn
+11
-2
未找到文件。
interfaces/hals/utils/sys_param/BUILD.gn
0 → 100644
浏览文件 @
79b28a63
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
static_library("hal_sys_param") {
sources = [ "hal_sys_param.c" ]
include_dirs = [ "//base/startup/init/interfaces/hals" ]
defines = [
"INCREMENTAL_VERSION=\"${ohos_version}\"",
"BUILD_TYPE=\"${ohos_build_type}\"",
"BUILD_USER=\"${ohos_build_user}\"",
"BUILD_TIME=\"${ohos_build_time}\"",
"BUILD_HOST=\"${ohos_build_host}\"",
"BUILD_ROOTHASH=\"${ohos_build_roothash}\"",
]
}
interfaces/hals/utils/sys_param/hal_sys_param.c
0 → 100644
浏览文件 @
79b28a63
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "hal_sys_param.h"
static
const
char
OHOS_ABI_LIST
[]
=
{
"****"
};
static
const
char
OHOS_BOOTLOADER_VERSION
[]
=
{
"bootloader"
};
static
const
char
OHOS_BRAND
[]
=
{
"****"
};
static
const
char
OHOS_DEVICE_TYPE
[]
=
{
"****"
};
static
const
char
OHOS_DISPLAY_VERSION
[]
=
{
"OpenHarmony 3.1"
};
static
const
char
OHOS_HARDWARE_MODEL
[]
=
{
"****"
};
static
const
char
OHOS_HARDWARE_PROFILE
[]
=
{
"aout:true,display:true"
};
static
const
char
OHOS_MARKET_NAME
[]
=
{
"****"
};
static
const
char
OHOS_MANUFACTURE
[]
=
{
"****"
};
static
const
char
OHOS_PRODUCT_MODEL
[]
=
{
"****"
};
static
const
char
OHOS_PRODUCT_SERIES
[]
=
{
"****"
};
static
const
char
OHOS_SERIAL
[]
=
{
"****"
};
// provided by OEM.
static
const
char
OHOS_SOFTWARE_MODEL
[]
=
{
"****"
};
static
const
int
OHOS_FIRST_API_VERSION
=
1
;
__attribute__
((
weak
))
const
char
*
HalGetDeviceType
(
void
)
{
return
OHOS_DEVICE_TYPE
;
}
__attribute__
((
weak
))
const
char
*
HalGetManufacture
(
void
)
{
return
OHOS_MANUFACTURE
;
}
__attribute__
((
weak
))
const
char
*
HalGetBrand
(
void
)
{
return
OHOS_BRAND
;
}
__attribute__
((
weak
))
const
char
*
HalGetMarketName
(
void
)
{
return
OHOS_MARKET_NAME
;
}
__attribute__
((
weak
))
const
char
*
HalGetProductSeries
(
void
)
{
return
OHOS_PRODUCT_SERIES
;
}
__attribute__
((
weak
))
const
char
*
HalGetProductModel
(
void
)
{
return
OHOS_PRODUCT_MODEL
;
}
__attribute__
((
weak
))
const
char
*
HalGetSoftwareModel
(
void
)
{
return
OHOS_SOFTWARE_MODEL
;
}
__attribute__
((
weak
))
const
char
*
HalGetHardwareModel
(
void
)
{
return
OHOS_HARDWARE_MODEL
;
}
__attribute__
((
weak
))
const
char
*
HalGetHardwareProfile
(
void
)
{
return
OHOS_HARDWARE_PROFILE
;
}
__attribute__
((
weak
))
const
char
*
HalGetSerial
(
void
)
{
return
OHOS_SERIAL
;
}
__attribute__
((
weak
))
const
char
*
HalGetBootloaderVersion
(
void
)
{
return
OHOS_BOOTLOADER_VERSION
;
}
__attribute__
((
weak
))
const
char
*
HalGetAbiList
(
void
)
{
return
OHOS_ABI_LIST
;
}
__attribute__
((
weak
))
const
char
*
HalGetDisplayVersion
(
void
)
{
return
OHOS_DISPLAY_VERSION
;
}
__attribute__
((
weak
))
const
char
*
HalGetIncrementalVersion
(
void
)
{
return
INCREMENTAL_VERSION
;
}
__attribute__
((
weak
))
const
char
*
HalGetBuildType
(
void
)
{
return
BUILD_TYPE
;
}
__attribute__
((
weak
))
const
char
*
HalGetBuildUser
(
void
)
{
return
BUILD_USER
;
}
__attribute__
((
weak
))
const
char
*
HalGetBuildHost
(
void
)
{
return
BUILD_HOST
;
}
__attribute__
((
weak
))
const
char
*
HalGetBuildTime
(
void
)
{
return
BUILD_TIME
;
}
__attribute__
((
weak
))
int
HalGetFirstApiVersion
(
void
)
{
return
OHOS_FIRST_API_VERSION
;
}
\ No newline at end of file
interfaces/hals/utils/token/BUILD.gn
0 → 100644
浏览文件 @
79b28a63
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
static_library("static_hal_token") {
sources = [ "hal_token.c" ]
include_dirs = [
"//base/startup/init/interfaces/hals",
"//commonlibrary/utils_lite/include",
]
deps = []
}
interfaces/hals/utils/token/hal_token.c
0 → 100644
浏览文件 @
79b28a63
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "hal_token.h"
#include "ohos_errno.h"
#include "ohos_types.h"
__attribute__
((
weak
))
static
int
OEMReadToken
(
char
*
token
,
unsigned
int
len
)
{
// OEM need add here, read token from device
(
void
)(
token
);
(
void
)(
len
);
return
EC_SUCCESS
;
}
__attribute__
((
weak
))
static
int
OEMWriteToken
(
const
char
*
token
,
unsigned
int
len
)
{
// OEM need add here, write token to device
(
void
)(
token
);
(
void
)(
len
);
return
EC_SUCCESS
;
}
__attribute__
((
weak
))
static
int
OEMGetAcKey
(
char
*
acKey
,
unsigned
int
len
)
{
// OEM need add here, get AcKey
(
void
)(
acKey
);
(
void
)(
len
);
return
EC_SUCCESS
;
}
__attribute__
((
weak
))
static
int
OEMGetProdId
(
char
*
productId
,
unsigned
int
len
)
{
// OEM need add here, get ProdId
(
void
)(
productId
);
(
void
)(
len
);
return
EC_SUCCESS
;
}
__attribute__
((
weak
))
static
int
OEMGetProdKey
(
char
*
productKey
,
unsigned
int
len
)
{
// OEM need add here, get ProdKey
(
void
)(
productKey
);
(
void
)(
len
);
return
EC_SUCCESS
;
}
__attribute__
((
weak
))
int
HalReadToken
(
char
*
token
,
unsigned
int
len
)
{
if
(
token
==
NULL
)
{
return
EC_FAILURE
;
}
return
OEMReadToken
(
token
,
len
);
}
__attribute__
((
weak
))
int
HalWriteToken
(
const
char
*
token
,
unsigned
int
len
)
{
if
(
token
==
NULL
)
{
return
EC_FAILURE
;
}
return
OEMWriteToken
(
token
,
len
);
}
__attribute__
((
weak
))
int
HalGetAcKey
(
char
*
acKey
,
unsigned
int
len
)
{
if
(
acKey
==
NULL
)
{
return
EC_FAILURE
;
}
return
OEMGetAcKey
(
acKey
,
len
);
}
__attribute__
((
weak
))
int
HalGetProdId
(
char
*
productId
,
unsigned
int
len
)
{
if
(
productId
==
NULL
)
{
return
EC_FAILURE
;
}
return
OEMGetProdId
(
productId
,
len
);
}
__attribute__
((
weak
))
int
HalGetProdKey
(
char
*
productKey
,
unsigned
int
len
)
{
if
(
productKey
==
NULL
)
{
return
EC_FAILURE
;
}
return
OEMGetProdKey
(
productKey
,
len
);
}
\ No newline at end of file
interfaces/innerkits/BUILD.gn
浏览文件 @
79b28a63
...
@@ -109,7 +109,17 @@ if (defined(ohos_lite)) {
...
@@ -109,7 +109,17 @@ if (defined(ohos_lite)) {
sources = []
sources = []
if (enable_ohos_startup_init_feature_begetctl_liteos) {
if (enable_ohos_startup_init_feature_begetctl_liteos) {
deps += [ "$ohos_product_adapter_dir/utils/sys_param:hal_sysparam" ]
PRODUCT_HAL_SYSPARAM_PATH =
rebase_path("//${ohos_product_adapter_dir}/utils/sys_param")
cmd = "if [ -f ${PRODUCT_HAL_SYSPARAM_PATH}/BUILD.gn ]; then echo true; else echo false; fi"
PRODUCT_HAL_SYSPARAM_EXISTS =
exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value")
if (PRODUCT_HAL_SYSPARAM_EXISTS) {
deps += [ "$ohos_product_adapter_dir/utils/sys_param:hal_sysparam" ]
}
deps += [
"//base/startup/init/interfaces/hals/utils/sys_param:hal_sys_param",
]
defines += [ "LITEOS_SUPPORT" ]
defines += [ "LITEOS_SUPPORT" ]
sources += syspara_sources
sources += syspara_sources
} else {
} else {
...
...
interfaces/innerkits/token/BUILD.gn
浏览文件 @
79b28a63
...
@@ -44,8 +44,16 @@ if (ohos_kernel_type == "liteos_m") {
...
@@ -44,8 +44,16 @@ if (ohos_kernel_type == "liteos_m") {
"//base/startup/init/interfaces/innerkits/token",
"//base/startup/init/interfaces/innerkits/token",
"//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite",
"//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite",
]
]
PRODUCT_HAL_TOKEN_PATH =
deps = [ "$ohos_product_adapter_dir/utils/token:hal_token_static" ]
rebase_path("//${ohos_product_adapter_dir}/utils/token")
cmd = "if [ -f ${PRODUCT_HAL_TOKEN_PATH}/BUILD.gn ]; then echo true; else echo false; fi"
PRODUCT_HAL_TOKEN_EXISTS =
exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value")
if (PRODUCT_HAL_TOKEN_EXISTS) {
deps += [ "$ohos_product_adapter_dir/utils/token:hal_token_static" ]
}
deps +=
[ "//base/startup/init/interfaces/hals/utils/token:static_hal_token" ]
}
}
}
}
...
...
test/unittest/lite/BUILD.gn
浏览文件 @
79b28a63
...
@@ -142,10 +142,19 @@ if (defined(ohos_lite)) {
...
@@ -142,10 +142,19 @@ if (defined(ohos_lite)) {
# add cfg.h
# add cfg.h
if (enable_ohos_startup_init_feature_begetctl_liteos) {
if (enable_ohos_startup_init_feature_begetctl_liteos) {
PRODUCT_HAL_SYSPARAM_PATH =
rebase_path("//${ohos_product_adapter_dir}/utils/sys_param")
cmd = "if [ -f ${PRODUCT_HAL_SYSPARAM_PATH}/BUILD.gn ]; then echo true; else echo false; fi"
PRODUCT_HAL_SYSPARAM_EXISTS =
exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value")
if (PRODUCT_HAL_SYSPARAM_EXISTS) {
deps += [ "$ohos_product_adapter_dir/utils/sys_param:hal_sysparam" ]
}
deps += [
deps += [
"$ohos_product_adapter_dir/utils/sys_param:hal_sysparam",
"//base/startup/init/interfaces/hals/utils/sys_param:hal_sys_param",
"//base/startup/init/services/param/liteos:lite_ohos_param_to",
]
]
deps +=
[ "//base/startup/init/services/param/liteos:lite_ohos_param_to" ]
include_dirs += [ "$root_out_dir/gen/init" ]
include_dirs += [ "$root_out_dir/gen/init" ]
defines += [ "PARAM_LOAD_CFG_FROM_CODE" ]
defines += [ "PARAM_LOAD_CFG_FROM_CODE" ]
}
}
...
...
鸿蒙社区
@harmonycommunity
mentioned in commit
3cc465d4
·
11月 18, 2022
mentioned in commit
3cc465d4
mentioned in commit 3cc465d454183ce283ff7def7a76d34da961abc8
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录