From f09f830d397d1c4b5d42fb67c08207bcf0645715 Mon Sep 17 00:00:00 2001 From: taiyipei Date: Wed, 6 Apr 2022 00:38:29 -0700 Subject: [PATCH 1/5] add syscap lib for mini and small system Signed-off-by: taiyipei --- interfaces/innerkits/syscap/BUILD.gn | 39 ++++++++++++++++++++++++++++ services/param/BUILD.gn | 1 - services/utils/BUILD.gn | 31 ++++++++++------------ 3 files changed, 53 insertions(+), 18 deletions(-) create mode 100755 interfaces/innerkits/syscap/BUILD.gn mode change 100644 => 100755 services/param/BUILD.gn mode change 100644 => 100755 services/utils/BUILD.gn diff --git a/interfaces/innerkits/syscap/BUILD.gn b/interfaces/innerkits/syscap/BUILD.gn new file mode 100755 index 000000000..c5258b5c1 --- /dev/null +++ b/interfaces/innerkits/syscap/BUILD.gn @@ -0,0 +1,39 @@ +# Copyright (c) 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. + +import("//build/ohos.gni") + +config("syscap_config") { + include_dirs = [ "../include" ] +} + +ohos_shared_library("syscap") { + sources = [ "init_syscap.c" ] + + include_dirs = [ + "../include", + "../../../services/include/param", + ] + deps = [ + "../../../services/log:init_log", + "../../../services/param:param_client", + "//third_party/bounds_checking_function:libsec_shared", + ] + + public_configs = [ ":syscap_config" ] + part_name = "init" + install_images = [ + "system", + "updater", + ] +} \ No newline at end of file diff --git a/services/param/BUILD.gn b/services/param/BUILD.gn old mode 100644 new mode 100755 index dd2edbfa7..9f26848cf --- a/services/param/BUILD.gn +++ b/services/param/BUILD.gn @@ -116,7 +116,6 @@ ohos_shared_library("param_client") { } deps = [ - "//base/startup/init_lite/services/log:agent_log", "//third_party/bounds_checking_function:libsec_static", ] install_images = [ diff --git a/services/utils/BUILD.gn b/services/utils/BUILD.gn old mode 100644 new mode 100755 index bf6f85f4b..86acca7fc --- a/services/utils/BUILD.gn +++ b/services/utils/BUILD.gn @@ -10,6 +10,20 @@ # 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_static_library("libinit_utils") { + sources = [ "init_utils.c" ] + include_dirs = [ + "//third_party/bounds_checking_function/include", + "//base/startup/init_lite/services/log", + "//base/startup/init_lite/interfaces/innerkits/include", + "//base/startup/init_lite/services/include", + ] + deps = [ "//third_party/bounds_checking_function:libsec_static" ] + defines = [ "_GNU_SOURCE" ] + part_name = "init" +} if (defined(ohos_lite)) { static_library("libinit_tools") { @@ -29,8 +43,6 @@ if (defined(ohos_lite)) { defines = [ "_GNU_SOURCE" ] } } else { - import("//build/ohos.gni") - ohos_static_library("libinit_tools") { sources = [ "//base/startup/init_lite/services/utils/init_hashmap.c", @@ -48,19 +60,4 @@ if (defined(ohos_lite)) { defines = [ "_GNU_SOURCE" ] part_name = "init" } - - ohos_static_library("libinit_utils") { - sources = [ "init_utils.c" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//base/startup/init_lite/services/log", - "//base/startup/init_lite/interfaces/innerkits/include", - "//base/startup/init_lite/services/include", - ] - - deps = [ "//third_party/bounds_checking_function:libsec_static" ] - defines = [ "_GNU_SOURCE" ] - part_name = "init" - } } From c0c3c5f7a6ce79198b2beb1b0b96c4f8d6b76031 Mon Sep 17 00:00:00 2001 From: taiyipei Date: Thu, 7 Apr 2022 01:06:41 -0700 Subject: [PATCH 2/5] fix gn check issue Signed-off-by: taiyipei --- interfaces/innerkits/syscap/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/innerkits/syscap/BUILD.gn b/interfaces/innerkits/syscap/BUILD.gn index c5258b5c1..f0096cd46 100755 --- a/interfaces/innerkits/syscap/BUILD.gn +++ b/interfaces/innerkits/syscap/BUILD.gn @@ -36,4 +36,4 @@ ohos_shared_library("syscap") { "system", "updater", ] -} \ No newline at end of file +} From 9c3579a1e02693ba7654a54a162f3c45a99d5a88 Mon Sep 17 00:00:00 2001 From: taiyipei Date: Thu, 7 Apr 2022 01:17:36 -0700 Subject: [PATCH 3/5] fix standard compile issue Signed-off-by: taiyipei --- services/param/BUILD.gn | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/services/param/BUILD.gn b/services/param/BUILD.gn index 9f26848cf..d35275b28 100755 --- a/services/param/BUILD.gn +++ b/services/param/BUILD.gn @@ -115,9 +115,10 @@ ohos_shared_library("param_client") { } } - deps = [ - "//third_party/bounds_checking_function:libsec_static", - ] + deps = [ "//third_party/bounds_checking_function:libsec_static" ] + if (is_standard_system) { + deps += [ "//base/startup/init_lite/services/log:agent_log" ] + } install_images = [ "system", "updater", From 10cc7bb8c82bf3b1866540edffcabdc0321198e8 Mon Sep 17 00:00:00 2001 From: taiyipei Date: Thu, 7 Apr 2022 04:28:31 -0700 Subject: [PATCH 4/5] remove updater installation Signed-off-by: taiyipei --- interfaces/innerkits/syscap/BUILD.gn | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/interfaces/innerkits/syscap/BUILD.gn b/interfaces/innerkits/syscap/BUILD.gn index f0096cd46..b3e661b31 100755 --- a/interfaces/innerkits/syscap/BUILD.gn +++ b/interfaces/innerkits/syscap/BUILD.gn @@ -33,7 +33,6 @@ ohos_shared_library("syscap") { public_configs = [ ":syscap_config" ] part_name = "init" install_images = [ - "system", - "updater", + "system" ] } From 85a3f2539744473ccdfc0fd4f9d60a10a85f545c Mon Sep 17 00:00:00 2001 From: taiyipei Date: Thu, 7 Apr 2022 04:52:45 -0700 Subject: [PATCH 5/5] fix code check Signed-off-by: taiyipei --- interfaces/innerkits/syscap/BUILD.gn | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/interfaces/innerkits/syscap/BUILD.gn b/interfaces/innerkits/syscap/BUILD.gn index b3e661b31..0b537f43e 100755 --- a/interfaces/innerkits/syscap/BUILD.gn +++ b/interfaces/innerkits/syscap/BUILD.gn @@ -32,7 +32,5 @@ ohos_shared_library("syscap") { public_configs = [ ":syscap_config" ] part_name = "init" - install_images = [ - "system" - ] + install_images = [ "system" ] }