BUILD.gn 4.3 KB
Newer Older
Z
zhong_ning 已提交
1 2 3 4 5 6 7 8 9 10 11
# 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
H
handyohos 已提交
12
# limitations under the License.
X
xionglei6 已提交
13
import("//base/startup/init_lite/begetd.gni")
Z
zhong_ning 已提交
14 15
import("//build/ohos.gni")

H
handyohos 已提交
16 17
ohos_executable("begetctl") {
  sources = [
X
xionglei6 已提交
18
    "bootchart_cmd.c",
X
xionglei6 已提交
19
    "init_cmd_reboot.c",
H
handyohos 已提交
20 21
    "main.c",
    "misc_daemon.cpp",
Y
yanghongliang 已提交
22
    "param_cmd.c",
X
xionglei6 已提交
23
    "sandbox.cpp",
H
handyohos 已提交
24
    "service_control.c",
X
xionglei6 已提交
25
    "shell/shell_bas.c",
H
handyohos 已提交
26 27 28 29
  ]

  defines = [ "INIT_AGENT" ]

Y
yanghongliang 已提交
30 31 32 33
  if (defined(product_name) && product_name == "rk3568") {
    defines += [ "PRODUCT_RK" ]
  }

Z
zhong_ning 已提交
34
  include_dirs = [
X
xionglei6 已提交
35
    ".",
X
xionglei6 已提交
36
    "shell",
H
handyohos 已提交
37 38
    "//base/startup/init_lite/services/include",
    "//base/startup/init_lite/services/log",
Z
zhong_ning 已提交
39 40
    "//base/startup/init_lite/interfaces/innerkits/include",
    "//base/startup/syspara_lite/interfaces/innerkits/native/syspara/include",
H
handyohos 已提交
41 42
    "//base/startup/init_lite/services/include/param/",
    "//base/startup/init_lite/services/param/include",
X
xionglei6 已提交
43
    "//base/startup/init_lite/services/loopevent/include",
H
handyohos 已提交
44
    "//third_party/bounds_checking_function/include",
X
xionglei6 已提交
45 46
    "//base/startup/init_lite/interfaces/innerkits/sandbox/include",
    "//utils/native/base/include",
Z
zhong_ning 已提交
47 48
  ]
  deps = [
49
    "//base/startup/init_lite/interfaces/innerkits:libbegetutil",
X
xionglei6 已提交
50
    "//base/startup/init_lite/interfaces/innerkits/sandbox:libsandbox_static",
H
handyohos 已提交
51 52 53
    "//base/startup/init_lite/services/log:agent_log",
    "//base/startup/init_lite/services/param:param_client",
    "//third_party/bounds_checking_function:libsec_static",
X
xionglei6 已提交
54
    "//utils/native/base:utils",
Z
zhong_ning 已提交
55
  ]
H
handyohos 已提交
56

X
xionglei6 已提交
57 58 59
  if (param_test) {
    sources += [ "//base/startup/init_lite/test/plugintest/plugin_param_cmd.c" ]
    deps += [
60
      "//base/startup/init_lite/interfaces/innerkits:libbeget_proxy",
X
xionglei6 已提交
61 62
      "//base/startup/init_lite/services/loopevent:loopevent",
      "//base/startup/init_lite/services/param/watcher:param_watcheragent",
X
xionglei6 已提交
63
      "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara",
X
xionglei6 已提交
64 65 66 67 68 69 70
    ]
    defines += [
      "OHOS_SERVICE_DUMP",
      "INIT_TEST",
    ]
  }

X
xionglei6 已提交
71 72 73 74 75
  if (build_selinux) {
    include_dirs += [
      "//third_party/selinux/libselinux/include/",
      "//base/security/selinux/interfaces/policycoreutils/include/",
    ]
X
xionglei6 已提交
76
    deps += [ "//third_party/selinux:libselinux" ]
X
xionglei6 已提交
77 78 79
    defines += [ "WITH_SELINUX" ]
  }

H
handyohos 已提交
80
  symlink_target_name = [
Y
yanghongliang 已提交
81 82 83 84 85 86 87 88 89
    "misc_daemon",
    "reboot",
    "devctl",
    "service",
    "service_control",
    "start_service",
    "stop_service",
    "service",
    "param",
X
xionglei6 已提交
90
    "sandbox",
H
handyohos 已提交
91 92
  ]

Z
zhong_ning 已提交
93 94
  install_images = [ "system" ]
  install_enable = true
H
handyohos 已提交
95

Z
zhong_ning 已提交
96 97
  part_name = "init"
}
X
xionglei6 已提交
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115

ohos_executable("paramshell") {
  sources = [
    "param_cmd.c",
    "shell/shell_bas.c",
    "shell/shell_main.c",
  ]

  defines = [ "INIT_AGENT" ]

  include_dirs = [
    ".",
    "shell",
    "//base/startup/init_lite/services/include",
    "//base/startup/init_lite/services/log",
    "//base/startup/init_lite/interfaces/innerkits/include",
    "//base/startup/syspara_lite/interfaces/innerkits/native/syspara/include",
    "//base/startup/init_lite/services/include/param/",
X
xionglei6 已提交
116
    "//base/startup/init_lite/services/loopevent/include",
X
xionglei6 已提交
117 118 119 120 121 122 123 124 125 126 127 128
    "//base/startup/init_lite/services/param/include",
    "//third_party/bounds_checking_function/include",
  ]
  deps = [
    "//base/startup/init_lite/services/log:agent_log",
    "//base/startup/init_lite/services/param:param_client",
    "//third_party/bounds_checking_function:libsec_static",
  ]

  if (param_test) {
    sources += [ "//base/startup/init_lite/test/plugintest/plugin_param_cmd.c" ]
    deps += [
129
      "//base/startup/init_lite/interfaces/innerkits:libbeget_proxy",
X
xionglei6 已提交
130 131
      "//base/startup/init_lite/services/loopevent:loopevent",
      "//base/startup/init_lite/services/param/watcher:param_watcheragent",
X
xionglei6 已提交
132
      "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara",
X
xionglei6 已提交
133 134 135 136
    ]
    defines += [
      "OHOS_SERVICE_DUMP",
      "INIT_TEST",
X
xionglei6 已提交
137 138 139 140 141 142 143 144
    ]
  }

  install_images = [ "system" ]
  install_enable = true

  part_name = "init"
}