From e3906bfb7ad26f5c689d79712dff2f013d4d0625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E4=BD=B3=E4=BC=9F?= Date: Sat, 16 Aug 2025 15:26:34 +0800 Subject: [PATCH] =?UTF-8?q?Description:gn=E6=96=87=E4=BB=B6=E6=95=B4?= =?UTF-8?q?=E6=94=B9=20IssueNo:https://gitee.com/openharmony/startup=5Fini?= =?UTF-8?q?t/issues/ICTA3H=20Binary=20Source:No=20Signed-off-by:=20songjia?= =?UTF-8?q?wei9=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- begetd.gni | 7 +++++++ bundle.json | 5 ++--- interfaces/innerkits/BUILD.gn | 1 - .../init_module_engine/include/init_module_engine.h | 5 +++++ interfaces/innerkits/libbegetutil.versionscript | 1 + services/init/lite/BUILD.gn | 5 +++-- services/init/standard/BUILD.gn | 12 +++++------- test/unittest/BUILD.gn | 1 - 8 files changed, 23 insertions(+), 14 deletions(-) diff --git a/begetd.gni b/begetd.gni index 1bcc555e8..21fd20a51 100644 --- a/begetd.gni +++ b/begetd.gni @@ -12,6 +12,7 @@ # limitations under the License. init_innerkits_path = "//base/startup/init/interfaces/innerkits" +foundation_fscrypt_path = "//foundation/filemanagement/storage_service/storage_daemon" declare_args() { enable_ohos_startup_init_feature_watcher = true @@ -91,4 +92,10 @@ declare_args() { # init sasn support init_feature_support_asan = true + + # deps mksh + init_mksh_enable = true + if (defined(global_parts_info) && !defined(global_parts_info.thirdparty_mksh)) { + init_mksh_enable = false + } } diff --git a/bundle.json b/bundle.json index 4ea02f8e9..5c91a7e68 100755 --- a/bundle.json +++ b/bundle.json @@ -68,7 +68,6 @@ "bundle_framework", "selinux", "selinux_adapter", - "storage_service", "mbedtls", "zlib", "cJSON", @@ -77,10 +76,10 @@ "hicollie", "drivers_interface_partitionslot", "code_signature", - "runtime_core" + "runtime_core", + "mksh" ], "third_party": [ - "mksh", "e2fsprogs", "f2fs-tools" ] diff --git a/interfaces/innerkits/BUILD.gn b/interfaces/innerkits/BUILD.gn index 5730ca563..0858f3df0 100755 --- a/interfaces/innerkits/BUILD.gn +++ b/interfaces/innerkits/BUILD.gn @@ -54,7 +54,6 @@ if (defined(ohos_lite)) { ] sources = [] include_dirs = include_common - include_dirs += [ "//base/hiviewdfx/hilog_lite/interfaces/native/kits" ] public_configs = [ ":exported_header_files" ] deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", diff --git a/interfaces/innerkits/init_module_engine/include/init_module_engine.h b/interfaces/innerkits/init_module_engine/include/init_module_engine.h index c6d28d1fe..880aa06fb 100755 --- a/interfaces/innerkits/init_module_engine/include/init_module_engine.h +++ b/interfaces/innerkits/init_module_engine/include/init_module_engine.h @@ -31,6 +31,8 @@ extern "C" { #endif #endif +typedef char *(*PropertyValueProcessor)(const char *key, char *value); + int SystemWriteParam(const char *name, const char *value); int SystemUpdateConstParam(const char *name, const char *value); @@ -48,6 +50,9 @@ void RemoveCmdExecutor(const char *cmdName, int id); int DoJobNow(const char *jobName); int GetParameterFromCmdLine(const char *paramName, char *value, size_t valueLen); + +PropertyValueProcessor SetPropertyGetProcessor(PropertyValueProcessor processor); + #ifdef __cplusplus #if __cplusplus } diff --git a/interfaces/innerkits/libbegetutil.versionscript b/interfaces/innerkits/libbegetutil.versionscript index 2654833e4..f6437aef4 100644 --- a/interfaces/innerkits/libbegetutil.versionscript +++ b/interfaces/innerkits/libbegetutil.versionscript @@ -160,6 +160,7 @@ OH_StrDictGet; OH_ExtendableStrDictGet; OpenConsole; + SetPropertyGetProcessor; local: *; }; diff --git a/services/init/lite/BUILD.gn b/services/init/lite/BUILD.gn index e587b521a..b81b8cc80 100644 --- a/services/init/lite/BUILD.gn +++ b/services/init/lite/BUILD.gn @@ -55,7 +55,6 @@ executable("init") { "//base/startup/init/interfaces/innerkits/include/param", "//base/startup/init/services/init/include", "//third_party/cJSON", - "//base/hiviewdfx/hilog_lite/interfaces/native/kits", ] ldflags = [] @@ -94,9 +93,11 @@ executable("init") { ] deps += [ "//base/startup/init/services/param/linux:param_init", - "//third_party/mksh", ] external_deps += [ "toybox:toybox" ] + if (init_mksh_enable) { + external_deps += [ "mksh:sh" ] + } } if (init_feature_use_hook_mgr) { diff --git a/services/init/standard/BUILD.gn b/services/init/standard/BUILD.gn index 40ca30498..a2985c3aa 100644 --- a/services/init/standard/BUILD.gn +++ b/services/init/standard/BUILD.gn @@ -119,10 +119,7 @@ ohos_executable("init") { "//base/startup/init/services/utils:libinit_utils", ] deps += [ "//base/startup/init/services/param/base:param_base" ] - external_deps = [ - "config_policy:configpolicy_util_for_init_static", - "storage_service:libfscryptutils_static", - ] + external_deps = [ "config_policy:configpolicy_util_for_init_static" ] if (!defined(ohos_lite)) { include_dirs += [ @@ -135,7 +132,6 @@ ohos_executable("init") { } deps += [ "//base/startup/init/ueventd:libueventd_ramdisk_static" ] - external_deps += [ "storage_service:libfscryptutils_static" ] external_deps += [ "bounds_checking_function:libsec_shared", "cJSON:cjson_static", @@ -144,9 +140,9 @@ ohos_executable("init") { deps += [ "//base/startup/init/interfaces/innerkits/init_module_engine:libinit_stub_versionscript" ] deps += [ "//base/startup/init/interfaces/innerkits/init_module_engine:init_module_engine_sources" ] deps += [ "//base/startup/init/services/modules:static_modules" ] + deps += [ "${foundation_fscrypt_path}/libfscrypt:libfscryptutils_static" ] external_deps += [ "hilog:libhilog", - "storage_service:libfscryptutils_static", ] defines = [] if (defined(global_parts_info) && @@ -175,9 +171,11 @@ ohos_executable("init") { } if (use_musl) { external_deps += [ - "mksh:sh", "toybox:toybox", ] + if (init_mksh_enable) { + external_deps += [ "mksh:sh" ] + } } if (build_seccomp) { diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn index 38c71982e..37dee5217 100755 --- a/test/unittest/BUILD.gn +++ b/test/unittest/BUILD.gn @@ -361,7 +361,6 @@ ohos_unittest("init_unittest") { "init:libinit_module_engine", "mbedtls:mbedtls_shared", "selinux:libselinux", - "storage_service:libfscryptutils_static", "zlib:libz", ] if (defined(global_parts_info) && -- Gitee