diff --git a/interfaces/innerkits/BUILD.gn b/interfaces/innerkits/BUILD.gn new file mode 100755 index 0000000000000000000000000000000000000000..e843d9186aa5f0ba6faf27174b326846aacd7c14 --- /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 460cd06376e3699c81e32b51718522d409c87def..0000000000000000000000000000000000000000 --- 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 a3b69e35516439892b027be5f06f6bd0fe55f014..0000000000000000000000000000000000000000 --- 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 c745b3d238ffbb33b9f19add30490f0b38b0f1ff..0000000000000000000000000000000000000000 --- 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 38b1a5940106e7967eb1d49d1a6e22c3342e3bf1..0000000000000000000000000000000000000000 --- 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 273c04d509ffba15ed70192354366f759c2ce2a7..0000000000000000000000000000000000000000 --- 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 9e0be28a9c1e1d9366253e794e98cfd67ba0155a..d3f5d5dd6a884a92a42ef29cca465df632d36d71 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 f16362a71047816e0eab90c55b22c51e9a7554d0..0bbab6380bccc6025cd68621af905d43151a23c6 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 0943524179e3ceb4aedfb888aea805c5ca484026..d8ac5ecd4a72f8b2bf0807cc7ed8902802b360d4 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 f4878cd31f57c742ce9ae4bc4bb33fb2d450eaaf..5fbe616e629c9786676c673fde5a9ed46956178e 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" ]