• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13import("//base/startup/init/begetd.gni")
14if (!defined(ohos_lite)) {
15  import("//build/ohos.gni")
16  import("//build/ohos/sa_profile/sa_profile.gni")
17
18  ohos_sa_profile("device_info_profile") {
19    sources = [ "etc/3902.json" ]
20    part_name = "init"
21  }
22
23  ohos_prebuilt_etc("device_info.cfg") {
24    source = "etc/deviceinfoservice.cfg"
25    relative_install_dir = "init"
26    part_name = "init"
27    subsystem_name = "startup"
28  }
29
30  ohos_shared_library("deviceinfoservice") {
31    sources = [
32      "//base/startup/init/interfaces/innerkits/syspara/param_comm.c",
33      "device_info_service.cpp",
34    ]
35
36    branch_protector_ret = "pac_ret"
37    sanitize = {
38      cfi = true
39      cfi_cross_dso = true
40      debug = false
41    }
42
43    shlib_type = "sa"
44
45    include_dirs = [
46      ".",
47      "//base/startup/init/interfaces/innerkits/include",
48      "//base/startup/init/interfaces/innerkits/include/param",
49      "//base/startup/init/interfaces/innerkits/include/syspara",
50      "//base/startup/init/interfaces/innerkits/syspara",
51      "//base/startup/init/interfaces/hals",
52    ]
53    defines = [
54      "INIT_AGENT",
55      "_GNU_SOURCE",
56      "USE_MBEDTLS",
57      "DINFO_TAG=\"DeviceInfoService\"",
58    ]
59    deps = [
60      "//base/startup/init/interfaces/innerkits:deviceinfo_stub",
61      "//base/startup/init/interfaces/innerkits:libbegetutil",
62      "//base/startup/init/services/log:agent_log",
63      "//base/startup/init/services/modules/udid:libudidcomm",
64      "//base/startup/init/services/utils:libinit_utils",
65    ]
66
67    external_deps = [
68      "bounds_checking_function:libsec_shared",
69      "c_utils:utils",
70      "hilog:libhilog",
71      "ipc:ipc_single",
72      "safwk:system_ability_fwk",
73      "samgr:samgr_proxy",
74    ]
75    if (defined(global_parts_info) &&
76        defined(global_parts_info.security_access_token)) {
77      external_deps += [ "access_token:libaccesstoken_sdk" ]
78      defines += [ "INIT_SUPPORT_ACCESS_TOKEN" ]
79    }
80    install_images = [ "system" ]
81    part_name = "init"
82    subsystem_name = "startup"
83  }
84}
85
86group("device_info_group") {
87  if (!defined(ohos_lite) && enable_ohos_startup_init_feature_deviceinfo) {
88    deps = [
89      ":device_info.cfg",
90      ":device_info_profile",
91      ":deviceinfoservice",
92    ]
93  }
94}
95