• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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.
13
14import("//base/startup/init/begetd.gni")
15import("//build/ohos.gni")
16
17config("exported_header_files") {
18  visibility = [ ":*" ]
19  include_dirs = [
20    "./include",
21    "//base/customization/config_policy/interfaces/inner_api/include",
22  ]
23}
24
25ohos_static_library("sandbox") {
26  sources = [
27    "sandbox.c",
28    "sandbox_namespace.c",
29  ]
30  public_configs = [ ":exported_header_files" ]
31  include_dirs = [
32    "//third_party/bounds_checking_function/include",
33    "//third_party/cJSON",
34    "//base/startup/init/interfaces/innerkits/include",
35    "//base/startup/init/interfaces/innerkits/include",
36  ]
37  if (target_cpu == "arm64" || target_cpu == "x86_64" ||
38      target_cpu == "riscv64") {
39    defines = [ "SUPPORT_64BIT" ]
40  }
41  deps = [
42    ":chipset-sandbox.json",
43    ":system-sandbox.json",
44    "//base/customization/config_policy/frameworks/config_policy:configpolicy_util",
45    "//base/startup/init/services/utils:libinit_utils",
46  ]
47  part_name = "init"
48  subsystem_name = "startup"
49}
50
51ohos_prebuilt_etc("system-sandbox.json") {
52  if (target_cpu == "arm64" || target_cpu == "x86_64" ||
53      target_cpu == "riscv64") {
54    source = "system-sandbox64.json"
55  } else {
56    source = "system-sandbox.json"
57  }
58  output = "//base/startup/init/services/sandbox/system-sandbox.json"
59  part_name = "init"
60  subsystem_name = "startup"
61  module_install_dir = "etc/sandbox"
62  install_enable = true
63  install_images = [
64    "system",
65    "updater",
66  ]
67}
68
69ohos_prebuilt_etc("chipset-sandbox.json") {
70  if (target_cpu == "arm64" || target_cpu == "x86_64" ||
71      target_cpu == "riscv64") {
72    source = "chipset-sandbox64.json"
73  } else {
74    source = "chipset-sandbox.json"
75  }
76  output = "//base/startup/init/services/sandbox/chipset-sandbox.json"
77  part_name = "init"
78  subsystem_name = "startup"
79  module_install_dir = "etc/sandbox"
80  install_enable = true
81  install_images = [
82    "system",
83    "updater",
84  ]
85}
86