From 0660e9db14b2994241ea85a2710605aeec4a73b6 Mon Sep 17 00:00:00 2001 From: handyohos Date: Thu, 23 Dec 2021 14:18:36 +0800 Subject: [PATCH] fix: add libbegetutil for init component. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 对init部件的依赖统一到libbegetutil模块。 fix #I4NSE7 Signed-off-by: handyohos Change-Id: I297f12628268ba13df26d96f46885765302b0cc9 --- interfaces/innerkits/BUILD.gn | 71 +++++++++++++++++++ interfaces/innerkits/dynamic_service/BUILD.gn | 29 -------- interfaces/innerkits/file/BUILD.gn | 40 ----------- interfaces/innerkits/fs_manager/BUILD.gn | 48 ------------- interfaces/innerkits/reboot/BUILD.gn | 40 ----------- interfaces/innerkits/socket/BUILD.gn | 42 ----------- ohos.build | 18 ++++- services/BUILD.gn | 7 +- services/begetctl/BUILD.gn | 3 +- test/fuzztest/BUILD.gn | 12 ++-- 10 files changed, 96 insertions(+), 214 deletions(-) create mode 100755 interfaces/innerkits/BUILD.gn delete mode 100755 interfaces/innerkits/dynamic_service/BUILD.gn delete mode 100755 interfaces/innerkits/file/BUILD.gn delete mode 100755 interfaces/innerkits/fs_manager/BUILD.gn delete mode 100755 interfaces/innerkits/reboot/BUILD.gn delete mode 100755 interfaces/innerkits/socket/BUILD.gn diff --git a/interfaces/innerkits/BUILD.gn b/interfaces/innerkits/BUILD.gn new file mode 100755 index 00000000..e843d918 --- /dev/null +++ b/interfaces/innerkits/BUILD.gn @@ -0,0 +1,71 @@ +# Copyright (c) 2021 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. + +import("//base/startup/init_lite/begetd.gni") +import("//build/ohos.gni") + +config("exported_header_files") { + visibility = [ ":*" ] + include_dirs = [ "include/" ] +} + +fs_manager_sources = [ + "fs_manager/fs_manager_log.c", + "fs_manager/fstab.c", + "fs_manager/fstab_mount.c", +] + +ohos_shared_library("libbegetutil") { + sources = [ + "file/init_file.c", + "reboot/init_reboot_innerkits.c", + "socket/init_socket.c", + ] + sources += fs_manager_sources + + include_dirs = [ + "./include", + "//base/startup/init_lite/services/log", + "//third_party/bounds_checking_function/include", + "//base/startup/init_lite/services/include", + "//base/startup/init_lite/services/include/param", + "//base/startup/syspara_lite/hals/parameter/include", + ] + deps = [ + "//base/startup/init_lite/services/log:init_log", + "//base/startup/init_lite/services/param:param_client", + "//base/startup/init_lite/services/utils:libinit_utils", + "//third_party/bounds_checking_function:libsec_shared", + "//third_party/openssl:libcrypto_static", + "//utils/native/base:utils", + ] + + public_configs = [ ":exported_header_files" ] + part_name = "init" + install_images = [ + "system", + "updater", + ] +} + +# 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" +} diff --git a/interfaces/innerkits/dynamic_service/BUILD.gn b/interfaces/innerkits/dynamic_service/BUILD.gn deleted file mode 100755 index 460cd063..00000000 --- a/interfaces/innerkits/dynamic_service/BUILD.gn +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2021 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. - -import("//build/ohos.gni") -ohos_shared_library("dynamic_service") { - sources = [ "dynamic_service.c" ] - - include_dirs = [ - "//base/startup/syspara_lite/interfaces/innerkits/native/syspara/include", - "//base/startup/init_lite/interfaces/innerkits/include", - ] - - deps = [ - "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara", - ] - external_deps = [ "hiviewdfx_hilog_native:libhilog" ] - install_images = [ "system" ] - part_name = "init" -} diff --git a/interfaces/innerkits/file/BUILD.gn b/interfaces/innerkits/file/BUILD.gn deleted file mode 100755 index a3b69e35..00000000 --- a/interfaces/innerkits/file/BUILD.gn +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 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. -import("//build/ohos.gni") -service_file_sources = - [ "//base/startup/init_lite/interfaces/innerkits/file/init_file.c" ] -service_file_include = [ - "//base/startup/init_lite/interfaces/innerkits/include", - "//base/startup/init_lite/services/log", - "//base/startup/init_lite/services/include", - "//third_party/bounds_checking_function/include", -] -service_file_deps = [ - "//base/startup/init_lite/services/log:init_log", - "//base/startup/init_lite/services/utils:libinit_utils", - "//third_party/bounds_checking_function:libsec_static", -] - -ohos_static_library("libfile_static") { - sources = service_file_sources - include_dirs = service_file_include - deps = service_file_deps -} - -ohos_shared_library("libfile") { - sources = service_file_sources - include_dirs = service_file_include - deps = service_file_deps - part_name = "init" - install_images = [ "system" ] -} diff --git a/interfaces/innerkits/fs_manager/BUILD.gn b/interfaces/innerkits/fs_manager/BUILD.gn deleted file mode 100755 index c745b3d2..00000000 --- a/interfaces/innerkits/fs_manager/BUILD.gn +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) 2021 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. - -import("//build/ohos.gni") - -fs_manager_sources = [ - "fs_manager_log.c", - "fstab.c", - "fstab_mount.c", -] - -fs_manager_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", -] - -fs_manager_deps = [ - "//base/startup/init_lite/services/log:init_log", - "//base/startup/init_lite/services/utils:libinit_utils", - "//third_party/bounds_checking_function:libsec_static", -] - -ohos_shared_library("libfsmanager_shared") { - sources = fs_manager_sources - deps = fs_manager_deps - include_dirs = fs_manager_include_dirs - part_name = "init" - install_images = [ "system" ] -} - -ohos_static_library("libfsmanager_static") { - sources = fs_manager_sources - deps = fs_manager_deps - include_dirs = fs_manager_include_dirs - part_name = "init" -} diff --git a/interfaces/innerkits/reboot/BUILD.gn b/interfaces/innerkits/reboot/BUILD.gn deleted file mode 100755 index 38b1a594..00000000 --- a/interfaces/innerkits/reboot/BUILD.gn +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 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. -import("//build/ohos.gni") - -service_reboot_sources = [ "//base/startup/init_lite/interfaces/innerkits/reboot/init_reboot_innerkits.c" ] -service_reboot_include = [ - "//base/startup/init_lite/interfaces/innerkits/include", - "//base/startup/init_lite/services/include/param", - "//third_party/bounds_checking_function/include", - "//base/startup/init_lite/services/log", -] -service_reboot_deps = [ - "//base/startup/init_lite/services/log:init_log", - "//base/startup/init_lite/services/param:param_client", - "//third_party/bounds_checking_function:libsec_static", -] - -ohos_static_library("libreboot_static") { - sources = service_reboot_sources - include_dirs = service_reboot_include - deps = service_reboot_deps -} - -ohos_shared_library("libreboot") { - sources = service_reboot_sources - include_dirs = service_reboot_include - deps = service_reboot_deps - part_name = "init" - install_images = [ "system" ] -} diff --git a/interfaces/innerkits/socket/BUILD.gn b/interfaces/innerkits/socket/BUILD.gn deleted file mode 100755 index 273c04d5..00000000 --- a/interfaces/innerkits/socket/BUILD.gn +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) 2021 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. - -import("//build/ohos.gni") -service_socket_sources = - [ "//base/startup/init_lite/interfaces/innerkits/socket/init_socket.c" ] -service_socket_include = [ - "//base/startup/init_lite/interfaces/innerkits/include", - "//base/startup/init_lite/services/log", - "//third_party/bounds_checking_function/include", -] -service_socket_deps = [ - "//base/startup/init_lite/services/log:init_log", - "//third_party/bounds_checking_function:libsec_static", -] - -ohos_static_library("libsocket_static") { - sources = service_socket_sources - include_dirs = service_socket_include - deps = service_socket_deps -} - -ohos_shared_library("libsocket") { - sources = service_socket_sources - include_dirs = service_socket_include - deps = service_socket_deps - part_name = "init" - install_images = [ - "system", - "updater", - ] -} diff --git a/ohos.build b/ohos.build index 9e0be28a..d3f5d5dd 100755 --- a/ohos.build +++ b/ohos.build @@ -6,7 +6,23 @@ "//base/startup/init_lite/services:startup_init", "//base/startup/init_lite/ueventd:startup_ueventd", "//base/startup/init_lite/watchdog:watchdog", - "//base/startup/init_lite/services/begetctl:begetctl" + "//base/startup/init_lite/services/begetctl:begetctl", + "//base/startup/init_lite/interfaces/innerkits:libbegetutil" + ], + "inner_kits": [{ + "header": { + "header_files": [ + "init_socket.h", + "dynamic_service.h", + "init_file.h", + "fs_manager/fs_manager_log.h", + "fs_manager/fs_manager.h", + "init_reboot.h" + ], + "header_base": "//base/startup/init_lite/interfaces/innerkits/include/" + }, + "name": "//base/startup/init_lite/interfaces/innerkits:libbegetutil" + } ], "test_list": [ "//base/startup/init_lite/test/unittest:init_test" diff --git a/services/BUILD.gn b/services/BUILD.gn index f16362a7..0bbab638 100755 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -123,7 +123,7 @@ if (defined(ohos_lite)) { "//third_party/libuv/include", ] deps = [ - "//base/startup/init_lite/interfaces/innerkits/fs_manager:libfsmanager_static", + "//base/startup/init_lite/interfaces/innerkits:libfsmanager_static", "//base/startup/init_lite/services/log:init_log", "//base/startup/init_lite/services/param:param_service", "//base/startup/init_lite/ueventd:libueventd_static", @@ -173,11 +173,6 @@ if (defined(ohos_lite)) { deps = [ ":init", ":init_etc", - "//base/startup/init_lite/interfaces/innerkits/dynamic_service:dynamic_service", - "//base/startup/init_lite/interfaces/innerkits/file:libfile", - "//base/startup/init_lite/interfaces/innerkits/fs_manager:libfsmanager_shared", - "//base/startup/init_lite/interfaces/innerkits/reboot:libreboot", - "//base/startup/init_lite/interfaces/innerkits/socket:libsocket", "//base/startup/init_lite/services/param:param_client", "//base/startup/init_lite/services/param:param_service", ] diff --git a/services/begetctl/BUILD.gn b/services/begetctl/BUILD.gn index 09435241..d8ac5ecd 100755 --- a/services/begetctl/BUILD.gn +++ b/services/begetctl/BUILD.gn @@ -40,8 +40,7 @@ ohos_executable("begetctl") { "//base/update/updateservice/interfaces/innerkits/include", ] deps = [ - "//base/startup/init_lite/interfaces/innerkits/fs_manager:libfsmanager_shared", - "//base/startup/init_lite/interfaces/innerkits/reboot:libreboot_static", + "//base/startup/init_lite/interfaces/innerkits:libbegetutil", "//base/startup/init_lite/services/log:agent_log", "//base/startup/init_lite/services/param:param_client", "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara", diff --git a/test/fuzztest/BUILD.gn b/test/fuzztest/BUILD.gn index f4878cd3..5fbe616e 100644 --- a/test/fuzztest/BUILD.gn +++ b/test/fuzztest/BUILD.gn @@ -33,7 +33,7 @@ ohos_fuzztest("DoRebootFuzzTest") { include_dirs = [ "//base/startup/init_lite/interfaces/innerkits/include" ] deps = [ - "//base/startup/init_lite/interfaces/innerkits/reboot:libreboot_static", + "//base/startup/init_lite/interfaces/innerkits:libbegetutil", "//base/startup/init_lite/services/log:init_log", "//base/startup/init_lite/services/param:param_client", "//third_party/bounds_checking_function:libsec_static", @@ -56,7 +56,7 @@ ohos_fuzztest("GetControlFileFuzzTest") { include_dirs = [ "//base/startup/init_lite/interfaces/innerkits/include" ] deps = [ - "//base/startup/init_lite/interfaces/innerkits/file:libfile", + "//base/startup/init_lite/interfaces/innerkits:libbegetutil", "//base/startup/init_lite/services/log:init_log", "//base/startup/init_lite/services/utils:libinit_utils", "//third_party/bounds_checking_function:libsec_static", @@ -79,7 +79,7 @@ ohos_fuzztest("GetControlSocketFuzzTest") { include_dirs = [ "//base/startup/init_lite/interfaces/innerkits/include" ] deps = [ - "//base/startup/init_lite/interfaces/innerkits/socket:libsocket", + "//base/startup/init_lite/interfaces/innerkits:libbegetutil", "//base/startup/init_lite/services/log:init_log", "//third_party/bounds_checking_function:libsec_static", ] @@ -104,7 +104,7 @@ ohos_fuzztest("MountAllFstabFuzzTest") { ] deps = [ - "//base/startup/init_lite/interfaces/innerkits/fs_manager:libfsmanager_static", + "//base/startup/init_lite/interfaces/innerkits:libbegetutil", "//base/startup/init_lite/services/log:init_log", "//base/startup/init_lite/services/utils:libinit_utils", "//base/startup/init_lite/test/fuzztest:libfuzz_utils", @@ -152,7 +152,7 @@ ohos_fuzztest("StartDynamicProcessFuzzTest") { include_dirs = [ "//base/startup/init_lite/interfaces/innerkits/include" ] deps = [ - "//base/startup/init_lite/interfaces/innerkits/dynamic_service:dynamic_service", + "//base/startup/init_lite/interfaces/innerkits:libbegetutil", "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara", ] external_deps = [ "hiviewdfx_hilog_native:libhilog" ] @@ -173,7 +173,7 @@ ohos_fuzztest("StopDynamicProcessFuzzTest") { include_dirs = [ "//base/startup/init_lite/interfaces/innerkits/include" ] deps = [ - "//base/startup/init_lite/interfaces/innerkits/dynamic_service:dynamic_service", + "//base/startup/init_lite/interfaces/innerkits:libbegetutil", "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara", ] external_deps = [ "hiviewdfx_hilog_native:libhilog" ] -- GitLab