未验证 提交 3678d901 编写于 作者: O openharmony_ci 提交者: Gitee

!1572 增加特性开关-startup_init_with_param_base

Merge pull request !1572 from cheng_jinsong/init-feature-musl
...@@ -32,4 +32,9 @@ declare_args() { ...@@ -32,4 +32,9 @@ declare_args() {
config_ohos_startup_init_lite_memory_size = 5120 config_ohos_startup_init_lite_memory_size = 5120
# boot_kernel_extended_cmdline for extend cmdline # boot_kernel_extended_cmdline for extend cmdline
startup_init_with_param_base = false
if (!use_musl) {
startup_init_with_param_base = true
}
} }
...@@ -85,7 +85,7 @@ if (defined(ohos_lite)) { ...@@ -85,7 +85,7 @@ if (defined(ohos_lite)) {
defines += [ "__LINUX__" ] defines += [ "__LINUX__" ]
deps += [ deps += [
"//base/startup/init/services/loopevent:loopevent", "//base/startup/init/services/loopevent:loopevent",
"//base/startup/init/services/param/base:parameterbase", "//base/startup/init/services/param/base:param_base",
"//base/startup/init/services/param/linux:param_client", "//base/startup/init/services/param/linux:param_client",
] ]
} }
...@@ -194,11 +194,7 @@ if (defined(ohos_lite)) { ...@@ -194,11 +194,7 @@ if (defined(ohos_lite)) {
"//third_party/bounds_checking_function:libsec_shared", "//third_party/bounds_checking_function:libsec_shared",
"//third_party/mbedtls:mbedtls_shared", "//third_party/mbedtls:mbedtls_shared",
] ]
if (use_musl == false) { deps += [ "//base/startup/init/services/param/base:param_base" ]
deps += [ "//base/startup/init/services/param/base:parameterbase" ]
} else {
deps += [ "//base/startup/init/services/param/base:parameterbase_ext" ]
}
external_deps = [ external_deps = [
"c_utils:utils", "c_utils:utils",
"hilog_native:libhilog_base", "hilog_native:libhilog_base",
...@@ -291,11 +287,7 @@ if (defined(ohos_lite)) { ...@@ -291,11 +287,7 @@ if (defined(ohos_lite)) {
"//third_party/bounds_checking_function:libsec_shared", "//third_party/bounds_checking_function:libsec_shared",
"//third_party/mbedtls:mbedtls_shared", "//third_party/mbedtls:mbedtls_shared",
] ]
if (use_musl == false) { deps += [ "//base/startup/init/services/param/base:param_base" ]
deps += [ "//base/startup/init/services/param/base:parameterbase" ]
} else {
deps += [ "//base/startup/init/services/param/base:parameterbase_ext" ]
}
external_deps = [ external_deps = [
"c_utils:utils", "c_utils:utils",
"hilog_native:libhilog_base", "hilog_native:libhilog_base",
......
...@@ -187,11 +187,7 @@ if (defined(ohos_lite)) { ...@@ -187,11 +187,7 @@ if (defined(ohos_lite)) {
"//base/startup/init/services/utils:libinit_utils", "//base/startup/init/services/utils:libinit_utils",
"//third_party/bounds_checking_function:libsec_static", "//third_party/bounds_checking_function:libsec_static",
] ]
if (use_musl == false) { deps += [ "//base/startup/init/services/param/base:param_base" ]
deps += [ "//base/startup/init/services/param/base:parameterbase" ]
} else {
deps += [ "//base/startup/init/services/param/base:parameterbase_ext" ]
}
external_deps = [ external_deps = [
"c_utils:utils", "c_utils:utils",
"hilog_native:libhilog_base", "hilog_native:libhilog_base",
......
...@@ -49,6 +49,7 @@ executable("init") { ...@@ -49,6 +49,7 @@ executable("init") {
include_dirs = [ include_dirs = [
"//base/startup/init/interfaces/innerkits/include", "//base/startup/init/interfaces/innerkits/include",
"//base/startup/init/interfaces/innerkits/fd_holder", "//base/startup/init/interfaces/innerkits/fd_holder",
"//base/startup/init/services/include/param",
"//base/startup/init/services/init/include", "//base/startup/init/services/init/include",
"//third_party/cJSON", "//third_party/cJSON",
"//third_party/bounds_checking_function/include", "//third_party/bounds_checking_function/include",
...@@ -61,7 +62,7 @@ executable("init") { ...@@ -61,7 +62,7 @@ executable("init") {
"//base/startup/init/services/log:init_log", "//base/startup/init/services/log:init_log",
"//base/startup/init/services/loopevent:loopevent", "//base/startup/init/services/loopevent:loopevent",
"//base/startup/init/services/modules/init_hook:inithook", "//base/startup/init/services/modules/init_hook:inithook",
"//base/startup/init/services/param/base:parameterbase", "//base/startup/init/services/param/base:param_base",
"//base/startup/init/services/utils:libinit_utils", "//base/startup/init/services/utils:libinit_utils",
"//build/lite/config/component/cJSON:cjson_static", "//build/lite/config/component/cJSON:cjson_static",
"//third_party/bounds_checking_function:libsec_static", "//third_party/bounds_checking_function:libsec_static",
......
...@@ -69,11 +69,7 @@ ohos_executable("init") { ...@@ -69,11 +69,7 @@ ohos_executable("init") {
"//base/startup/init/services/sandbox:sandbox", "//base/startup/init/services/sandbox:sandbox",
"//base/startup/init/services/utils:libinit_utils", "//base/startup/init/services/utils:libinit_utils",
] ]
if (use_musl == false) { deps += [ "//base/startup/init/services/param/base:param_base" ]
deps += [ "//base/startup/init/services/param/base:parameterbase" ]
} else {
deps += [ "//base/startup/init/services/param/base:parameterbase_ext" ]
}
deps += [ deps += [
"//base/customization/config_policy/frameworks/config_policy:configpolicy_util_for_init_static", "//base/customization/config_policy/frameworks/config_policy:configpolicy_util_for_init_static",
......
...@@ -19,7 +19,7 @@ group("parameter") { ...@@ -19,7 +19,7 @@ group("parameter") {
if (defined(ohos_lite)) { if (defined(ohos_lite)) {
if (ohos_kernel_type == "linux") { if (ohos_kernel_type == "linux") {
deps += [ deps += [
"base:parameterbase", "base:param_base",
"linux:param_client", "linux:param_client",
"linux:param_init", "linux:param_init",
] ]
...@@ -31,7 +31,7 @@ group("parameter") { ...@@ -31,7 +31,7 @@ group("parameter") {
} }
} else { } else {
deps += [ deps += [
"base:parameterbase", "base:param_base",
"linux:param_client", "linux:param_client",
"linux:param_init", "linux:param_init",
] ]
......
...@@ -75,7 +75,7 @@ if (defined(ohos_lite)) { ...@@ -75,7 +75,7 @@ if (defined(ohos_lite)) {
} }
} }
} else { } else {
if (use_musl) { if (!startup_init_with_param_base) {
inherited_configs = [ inherited_configs = [
"//build/config/compiler:afdo", "//build/config/compiler:afdo",
"//build/config/compiler:afdo_optimize_size", "//build/config/compiler:afdo_optimize_size",
...@@ -113,13 +113,13 @@ if (defined(ohos_lite)) { ...@@ -113,13 +113,13 @@ if (defined(ohos_lite)) {
deps = [] deps = []
if (use_musl) { if (use_musl) {
defines += [ "__MUSL__" ]
}
if (!startup_init_with_param_base) {
ldflags = [ "-nostdlib" ] ldflags = [ "-nostdlib" ]
configs -= inherited_configs configs -= inherited_configs
configs += [ "//build/config/compiler:compiler" ] configs += [ "//build/config/compiler:compiler" ]
defines += [ defines += [ "PARAM_BASE" ]
"PARAM_BASE",
"__MUSL__",
]
} else { } else {
include_dirs += [ "//third_party/bounds_checking_function/include" ] include_dirs += [ "//third_party/bounds_checking_function/include" ]
sources += [ "//base/startup/init/services/log/init_commlog.c" ] sources += [ "//base/startup/init/services/log/init_commlog.c" ]
...@@ -174,3 +174,15 @@ if (defined(ohos_lite)) { ...@@ -174,3 +174,15 @@ if (defined(ohos_lite)) {
subsystem_name = "startup" subsystem_name = "startup"
} }
} }
group("param_base") {
if (defined(ohos_lite)) {
deps = [ ":parameterbase" ]
} else {
if (startup_init_with_param_base) {
deps = [ ":parameterbase" ]
} else {
deps = [ ":parameterbase_ext" ]
}
}
}
...@@ -10,13 +10,14 @@ ...@@ -10,13 +10,14 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import("//base/startup/init/begetd.gni")
if (defined(ohos_lite)) { if (defined(ohos_lite)) {
if (ohos_kernel_type == "linux") { if (ohos_kernel_type == "linux") {
service_ueventd_deps = [ service_ueventd_deps = [
"//base/startup/init/interfaces/innerkits/socket:libsocket", "//base/startup/init/interfaces/innerkits/socket:libsocket",
"//base/startup/init/services/log:init_log", "//base/startup/init/services/log:init_log",
"//base/startup/init/services/param/base:parameterbase", "//base/startup/init/services/param/base:param_base",
"//base/startup/init/services/utils:libinit_utils", "//base/startup/init/services/utils:libinit_utils",
"//third_party/bounds_checking_function:libsec_static", "//third_party/bounds_checking_function:libsec_static",
] ]
...@@ -113,11 +114,7 @@ if (defined(ohos_lite)) { ...@@ -113,11 +114,7 @@ if (defined(ohos_lite)) {
deps = service_ueventd_deps deps = service_ueventd_deps
deps += [ "//base/startup/init/services/param/linux:param_client" ] deps += [ "//base/startup/init/services/param/linux:param_client" ]
cflags = [] cflags = []
if (use_musl == false) { deps += [ "//base/startup/init/services/param/base:param_base" ]
deps += [ "//base/startup/init/services/param/base:parameterbase" ]
} else {
deps += [ "//base/startup/init/services/param/base:parameterbase_ext" ]
}
if (build_selinux) { if (build_selinux) {
external_deps = [ "selinux:librestorecon" ] external_deps = [ "selinux:librestorecon" ]
cflags += [ "-DWITH_SELINUX" ] cflags += [ "-DWITH_SELINUX" ]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册