diff --git a/ohos.build b/ohos.build index de5e1fd00806d714d5bdef6a2c019e59090d268d..65c0a527fcb61a6c2e8772bcf88c691e7de01fa9 100644 --- a/ohos.build +++ b/ohos.build @@ -3,8 +3,8 @@ "parts": { "updater": { "module_list": [ - "//base/update/updater/services:updater_init.cfg", - "//base/update/updater/services:init.Hi3516DV300.updater.cfg", + "//base/update/updater/resources:updater_resources", + "//base/update/updater/services:updater_etc", "//base/update/updater/services/package:libupdaterpackage", "//base/update/updater/services/script:libupdaterscript", "//base/update/updater/services/log:libupdaterlog", diff --git a/resources/BUILD.gn b/resources/BUILD.gn new file mode 100755 index 0000000000000000000000000000000000000000..9696011aa438b40cc1fc6569d393681b7de28e39 --- /dev/null +++ b/resources/BUILD.gn @@ -0,0 +1,100 @@ +# 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 +# limitations under the License. + +import("//build/ohos.gni") + +updater_resouces_list = [ + "font.png", + "icon_error.png", + "progress_empty.png", + "progress_fill.png", + "loop00000.png", + "loop00001.png", + "loop00002.png", + "loop00003.png", + "loop00004.png", + "loop00005.png", + "loop00006.png", + "loop00007.png", + "loop00008.png", + "loop00009.png", + "loop00010.png", + "loop00011.png", + "loop00012.png", + "loop00013.png", + "loop00014.png", + "loop00015.png", + "loop00016.png", + "loop00017.png", + "loop00018.png", + "loop00019.png", + "loop00020.png", + "loop00021.png", + "loop00022.png", + "loop00023.png", + "loop00024.png", + "loop00025.png", + "loop00026.png", + "loop00027.png", + "loop00028.png", + "loop00029.png", + "loop00030.png", + "loop00031.png", + "loop00032.png", + "loop00033.png", + "loop00034.png", + "loop00035.png", + "loop00036.png", + "loop00037.png", + "loop00038.png", + "loop00039.png", + "loop00040.png", + "loop00041.png", + "loop00042.png", + "loop00043.png", + "loop00044.png", + "loop00045.png", + "loop00046.png", + "loop00047.png", + "loop00048.png", + "loop00049.png", + "loop00050.png", + "loop00051.png", + "loop00052.png", + "loop00053.png", + "loop00054.png", + "loop00055.png", + "loop00056.png", + "loop00057.png", + "loop00058.png", + "loop00059.png", + "loop00060.png", + "loop00061.png", +] + +updater_resources_target = [] + +foreach(file, updater_resouces_list) { + _name = "$file" + ohos_prebuilt_etc(_name) { + source = "//base/update/updater/resources/$file" + module_install_dir = "resources" + install_images = [ "updater" ] + part_name = "updater" + } + updater_resources_target += [ ":$_name" ] +} + +group("updater_resources") { + deps = updater_resources_target +} diff --git a/services/BUILD.gn b/services/BUILD.gn index 59a09ba13f03902e50ed08f7b165365a36788964..f7b606fcabbf77b0332281114d55b283ae26ed57 100644 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -16,13 +16,41 @@ import("//build/ohos.gni") SUBSYSTEM_DIR = "//base/update/updater" ohos_prebuilt_etc("updater_init.cfg") { - source = "//base/update/updater/services/etc/updater_init.cfg" - part_name = "updater" + source = "//base/update/updater/services/etc/init.cfg" + module_install_dir = "." + install_images = [ "updater" ] + part_name = "updater" } ohos_prebuilt_etc("init.Hi3516DV300.updater.cfg") { - source = "//device/hisilicon/hi3516dv300/build/rootfs/init.Hi3516DV300.updater.cfg" - part_name = "updater" + source = + "//device/hisilicon/hi3516dv300/build/rootfs/init.Hi3516DV300.updater.cfg" + module_install_dir = "." + install_images = [ "updater" ] + part_name = "updater" +} + +ohos_prebuilt_etc("signing_cert.crt") { + source = + "//device/hisilicon/hi3516dv300/build/updater_config/signing_cert.crt" + module_install_dir = "certificate" + install_images = [ "updater" ] + part_name = "updater" +} + +ohos_prebuilt_etc("fstab.updater") { + source = "//device/hisilicon/hi3516dv300/build/vendor/etc/fstab.updater" + install_images = [ "updater" ] + part_name = "updater" +} + +group("updater_etc") { + deps = [ + ":fstab.updater", + ":init.Hi3516DV300.updater.cfg", + ":signing_cert.crt", + ":updater_init.cfg", + ] } ohos_executable("updater") { @@ -74,7 +102,7 @@ ohos_executable("updater") { "//third_party/openssl:ssl_source", "//third_party/zlib:libz", ] - + install_images = [ "updater" ] install_enable = true part_name = "updater" } diff --git a/services/etc/updater_init.cfg b/services/etc/init.cfg similarity index 90% rename from services/etc/updater_init.cfg rename to services/etc/init.cfg index dbfb5ff7e3a4d447d9c895632a6927bf205d03bf..500a0ad19063486095dcb2bd32e83e2752820d72 100755 --- a/services/etc/updater_init.cfg +++ b/services/etc/init.cfg @@ -30,7 +30,7 @@ ], "services" : [{ "name" : "shell", - "path" : ["/system/bin/sh"], + "path" : ["/bin/sh"], "uid" : 0, "gid" : 2000, "once" : 0, @@ -39,7 +39,7 @@ "caps" : [4294967295] }, { "name" : "updater", - "path" : ["/system/bin/updater"], + "path" : ["/bin/updater"], "uid" : 0, "gid" : 0, "once" : 1, @@ -47,7 +47,7 @@ "caps" : [0, 1] }, { "name" : "ueventd", - "path" : ["/system/bin/updaterueventd"], + "path" : ["/bin/updaterueventd"], "uid" : 0, "gid" : 2000, "once" : 0, diff --git a/services/package/BUILD.gn b/services/package/BUILD.gn index 06506afa0222d3fd90aed400c10aec419dea7b13..92b4d61db36057ccd349a126508b6ea034a56270 100644 --- a/services/package/BUILD.gn +++ b/services/package/BUILD.gn @@ -30,6 +30,11 @@ config("package_config") { "pkg_package", "//third_party/bounds_checking_function/include", ] + if (current_cpu == "arm" && host_os != "mac") { + cflags = [ "-DOPENSSL_ARM_PLATFORM" ] + } else if (current_cpu == "arm64" && host_os != "mac") { + cflags = [ "-DOPENSSL_ARM64_PLATFORM" ] + } } ohos_static_library("libupdaterpackage") { @@ -50,7 +55,9 @@ ohos_static_library("libupdaterpackage") { "$SUBSYSTEM_DIR/pkg_package/pkg_zipfile.cpp", ] - deps = [ "//third_party/bounds_checking_function:libsec_static" ] + deps = [ + "//third_party/bounds_checking_function:libsec_static", + ] configs = [ ":package_config" ] } diff --git a/utils/BUILD.gn b/utils/BUILD.gn index 40974b1134c7a3e2ae74f769d1d6b0541e9fe9c6..f2f449a138bfcae8fae260442558c1fefc11adc1 100644 --- a/utils/BUILD.gn +++ b/utils/BUILD.gn @@ -14,7 +14,9 @@ import("//build/ohos.gni") ohos_static_library("libutils") { - sources = [ "utils.cpp" ] + sources = [ + "utils.cpp", + ] include_dirs = [ "include", @@ -23,11 +25,15 @@ ohos_static_library("libutils") { "//third_party/bounds_checking_function/include", ] - deps = [ "//third_party/bounds_checking_function:libsec_static" ] + deps = [ + "//third_party/bounds_checking_function:libsec_static", + ] } ohos_executable("updater_reboot") { - sources = [ "updater_reboot.cpp" ] + sources = [ + "updater_reboot.cpp", + ] include_dirs = [ "include", @@ -40,13 +46,15 @@ ohos_executable("updater_reboot") { "//base/update/updater/services/fs_manager:libfsmanager", "//base/update/updater/utils:libutils", ] - + install_images = [ "updater" ] install_enable = true part_name = "updater" } ohos_executable("write_updater") { - sources = [ "write_updater.cpp" ] + sources = [ + "write_updater.cpp", + ] include_dirs = [ "include",