BUILD.gn 6.6 KB
Newer Older
M
Mupceet 已提交
1
# Copyright (c) 2020-2022 Huawei Device Co., Ltd.
2 3 4 5 6 7 8 9 10 11 12 13 14 15
# 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.

if (defined(ohos_lite)) {
  copy("ohos.para") {
M
init  
Mupceet 已提交
16
    sources = [ "//base/startup/init/services/etc/param/ohos.para" ]
17 18 19 20
    outputs = [ "$root_out_dir/system/etc/param/ohos.para" ]
  }

  copy("ohos.para.dac") {
M
init  
Mupceet 已提交
21
    sources = [ "//base/startup/init/services/etc/param/ohos.para.dac" ]
22 23 24
    outputs = [ "$root_out_dir/system/etc/param/ohos.para.dac" ]
  }
  copy("ohos.const") {
M
init  
Mupceet 已提交
25 26
    sources =
        [ "//base/startup/init/services/etc_lite/param/ohos_const/ohos.para" ]
27 28 29 30
    outputs = [ "$root_out_dir/system/etc/param/ohos_const/ohos.para" ]
  }

  copy("ohos.passwd") {
M
init  
Mupceet 已提交
31
    sources = [ "//base/startup/init/services/etc_lite/passwd" ]
32 33 34
    outputs = [ "$root_out_dir/etc/passwd" ]
  }
  copy("ohos.group") {
M
init  
Mupceet 已提交
35
    sources = [ "//base/startup/init/services/etc_lite/group" ]
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
    outputs = [ "$root_out_dir/etc/group" ]
  }

  group("etc_files") {
    deps = [
      ":ohos.const",
      ":ohos.para",
      ":ohos.para.dac",
    ]
    if (ohos_kernel_type == "linux") {
      deps += [
        ":ohos.group",
        ":ohos.passwd",
      ]
    }
  }
} else {
M
init  
Mupceet 已提交
53
  import("//base/startup/init/services/etc/param/param_fixer.gni")
54 55 56 57 58
  import("//build/ohos.gni")

  # init etc files group
  ohos_prebuilt_etc("init.cfg") {
    if (!enable_ramdisk) {
M
init  
Mupceet 已提交
59
      source = "//base/startup/init/services/etc/init.without_two_stages.cfg"
60
    } else {
M
init  
Mupceet 已提交
61
      source = "//base/startup/init/services/etc/init.cfg"
62 63
    }
    part_name = "init"
64
    subsystem_name = "startup"
65 66 67
  }

  ohos_prebuilt_etc("watchdog.cfg") {
M
init  
Mupceet 已提交
68
    source = "//base/startup/init/services/etc/watchdog.cfg"
69 70
    relative_install_dir = "init"
    part_name = "init"
71
    subsystem_name = "startup"
72 73 74
  }

  ohos_prebuilt_etc("console.cfg") {
M
init  
Mupceet 已提交
75
    source = "//base/startup/init/services/etc/console.cfg"
76 77
    relative_install_dir = "init"
    part_name = "init"
78
    subsystem_name = "startup"
79 80 81
  }

  ohos_prebuilt_etc("ueventd.cfg") {
M
init  
Mupceet 已提交
82
    source = "//base/startup/init/services/etc/ueventd.cfg"
83 84
    relative_install_dir = "init"
    part_name = "init"
85
    subsystem_name = "startup"
86 87 88
  }

  ohos_prebuilt_etc("passwd") {
M
init  
Mupceet 已提交
89
    source = "//base/startup/init/services/etc/passwd"
90 91 92 93 94
    install_images = [
      "system",
      "updater",
    ]
    part_name = "init"
95
    subsystem_name = "startup"
96 97 98
  }

  ohos_prebuilt_etc("group") {
M
init  
Mupceet 已提交
99
    source = "//base/startup/init/services/etc/group"
100 101 102 103 104
    install_images = [
      "system",
      "updater",
    ]
    part_name = "init"
105
    subsystem_name = "startup"
106 107 108
  }

  ohos_prebuilt_etc("init.usb.cfg") {
M
init  
Mupceet 已提交
109
    source = "//base/startup/init/services/etc/init.usb.cfg"
110
    part_name = "init"
111
    subsystem_name = "startup"
112 113 114
  }

  ohos_prebuilt_para("ohos.para") {
M
init  
Mupceet 已提交
115
    source = "//base/startup/init/services/etc/param/ohos.para"
Y
yichengzhao 已提交
116 117 118 119
    install_images = [
      "system",
      "updater",
    ]
120
    part_name = "init"
121
    subsystem_name = "startup"
122
    if (target_cpu == "arm64") {
123
      extra_paras = [ "const.product.cpu.abilist=arm64-v8a" ]
124 125 126 127
    }
    module_install_dir = "etc/param"
  }

128
  ohos_prebuilt_para("ohos.para.dac") {
M
init  
Mupceet 已提交
129
    source = "//base/startup/init/services/etc/param/ohos.para.dac"
Y
yichengzhao 已提交
130 131 132 133
    install_images = [
      "system",
      "updater",
    ]
134
    part_name = "init"
135
    subsystem_name = "startup"
136 137 138
    module_install_dir = "etc/param"
  }

139
  ohos_prebuilt_para("ohos_const.para") {
M
init  
Mupceet 已提交
140
    source = "//base/startup/init/services/etc/param/ohos_const/ohos.para"
141
    part_name = "init"
142
    subsystem_name = "startup"
143 144 145
    module_install_dir = "etc/param/ohos_const"
  }

C
cheng_jinsong 已提交
146 147 148 149 150 151 152
  ohos_prebuilt_para("ohos.para.size") {
    source = "//base/startup/init/services/etc/param/ohos.para.size"
    install_images = [
      "system",
      "updater",
    ]
    part_name = "init"
153
    subsystem_name = "startup"
C
cheng_jinsong 已提交
154 155 156
    module_install_dir = "etc/param"
  }

157
  ohos_prebuilt_etc("boot.group") {
M
init  
Mupceet 已提交
158
    source = "//base/startup/init/services/etc/device.boot.group.cfg"
159
    part_name = "init"
160
    subsystem_name = "startup"
161 162 163
  }

  ohos_prebuilt_etc("syscap.para") {
164
    source = "${preloader_output_dir}/system/etc/param/syscap.para"
165 166
    module_install_dir = "etc/param/"
    part_name = "init"
167
    subsystem_name = "startup"
168 169 170
  }

  ohos_prebuilt_etc("syscap.json") {
171
    source = "${preloader_output_dir}/system/etc/syscap.json"
172
    part_name = "init"
173
    subsystem_name = "startup"
174 175 176
  }

  ohos_prebuilt_etc("systemcapability.json") {
177
    source = "${preloader_output_dir}/system/etc/SystemCapability.json"
178
    part_name = "init"
179
    subsystem_name = "startup"
180 181
  }

182 183 184
  ohos_prebuilt_etc("features.json") {
    source = "${preloader_output_dir}/features.json"
    part_name = "init"
185
    subsystem_name = "startup"
186 187
  }

188 189
  ohos_prebuilt_etc("system-sandbox.json") {
    if (target_cpu == "arm64") {
M
init  
Mupceet 已提交
190
      source = "//base/startup/init/interfaces/innerkits/sandbox/system-sandbox64.json"
191
    } else {
M
init  
Mupceet 已提交
192 193
      source =
          "//base/startup/init/interfaces/innerkits/sandbox/system-sandbox.json"
194
    }
195 196
    output =
        "//base/startup/init/interfaces/innerkits/sandbox/system-sandbox.json"
197
    part_name = "init"
198
    subsystem_name = "startup"
199 200 201 202 203
    module_install_dir = "etc/sandbox"
  }

  ohos_prebuilt_etc("chipset-sandbox.json") {
    if (target_cpu == "arm64") {
M
init  
Mupceet 已提交
204
      source = "//base/startup/init/interfaces/innerkits/sandbox/chipset-sandbox64.json"
205
    } else {
M
init  
Mupceet 已提交
206
      source = "//base/startup/init/interfaces/innerkits/sandbox/chipset-sandbox.json"
207
    }
208 209
    output =
        "//base/startup/init/interfaces/innerkits/sandbox/chipset-sandbox.json"
210
    part_name = "init"
211
    subsystem_name = "startup"
212 213 214 215
    module_install_dir = "etc/sandbox"
  }

  ohos_prebuilt_etc("init.reboot") {
M
init  
Mupceet 已提交
216
    source = "//base/startup/init/services/etc/init.reboot.cfg"
217
    part_name = "init"
218
    subsystem_name = "startup"
219 220 221 222 223 224 225 226
    module_install_dir = "etc/init"
  }

  group("etc_files") {
    deps = [
      ":boot.group",
      ":chipset-sandbox.json",
      ":console.cfg",
227
      ":features.json",
228 229 230 231 232 233
      ":group",
      ":init.cfg",
      ":init.reboot",
      ":init.usb.cfg",
      ":ohos.para",
      ":ohos.para.dac",
C
cheng_jinsong 已提交
234
      ":ohos.para.size",
235 236 237 238 239 240 241 242 243 244
      ":ohos_const.para",
      ":passwd",
      ":syscap.json",
      ":syscap.para",
      ":system-sandbox.json",
      ":systemcapability.json",
      ":ueventd.cfg",
    ]
  }
}