提交 f202508b 编写于 作者: O openharmony_ci 提交者: Gitee

!195 构建qemu-arm-linux-min产品最小部件集

Merge pull request !195 from handy/121822
# 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.
declare_args() {
param_feature_watcher = true
}
......@@ -92,6 +92,7 @@ if (defined(ohos_lite)) {
}
}
} else {
import("//base/startup/init_lite/begetd.gni")
import("//build/ohos.gni")
ohos_executable("init") {
......@@ -179,11 +180,15 @@ if (defined(ohos_lite)) {
"//base/startup/init_lite/interfaces/innerkits/socket:libsocket",
"//base/startup/init_lite/services/param:param_client",
"//base/startup/init_lite/services/param:param_service",
"//base/startup/init_lite/services/param:param_watcher",
"//base/startup/init_lite/services/param:param_watcher.rc",
"//base/startup/init_lite/services/param:param_watcheragent",
"//base/startup/init_lite/services/param/watcher/sa_profile:param_watcher_profile",
]
if (param_feature_watcher) {
deps += [
"//base/startup/init_lite/services/param/watcher:param_watcher",
"//base/startup/init_lite/services/param/watcher:param_watcher.rc",
"//base/startup/init_lite/services/param/watcher:param_watcheragent",
"//base/startup/init_lite/services/param/watcher/sa_profile:param_watcher_profile",
]
}
}
# init etc files group
......
......@@ -17,16 +17,6 @@ declare_args() {
param_test = "false"
}
ohos_prebuilt_etc("param_watcher.rc") {
if (use_musl) {
source = "watcher/etc/param_watcher.cfg"
} else {
source = "watcher/etc/param_watcher.rc"
}
relative_install_dir = "init"
part_name = "init"
}
ohos_static_library("param_service") {
sources = [
"//base/startup/init_lite/services/utils/init_utils.c",
......@@ -121,88 +111,3 @@ ohos_shared_library("param_client") {
]
part_name = "init"
}
ohos_shared_library("param_watcheragent") {
sources = [
"watcher/agent/watcher.cpp",
"watcher/agent/watcher_manager_kits.cpp",
"watcher/agent/watcher_manager_proxy.cpp",
"watcher/agent/watcher_stub.cpp",
]
include_dirs = [
"include",
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/services/param/watcher/include",
"//base/startup/init_lite/services/param/watcher/agent",
"//base/startup/init_lite/services/include",
"//base/startup/init_lite/services/log",
"//base/update/updateservice/interfaces/innerkits/include",
]
defines = [ "INIT_AGENT" ]
deps = [
"//base/startup/init_lite/services/log:agent_log",
"//base/startup/init_lite/services/param:param_client",
"//third_party/bounds_checking_function:libsec_static",
"//utils/native/base:utils",
]
external_deps = [
"hiviewdfx_hilog_native:libhilog",
"ipc:ipc_core",
"safwk:system_ability_fwk",
"samgr_standard:samgr_proxy",
]
part_name = "init"
}
ohos_shared_library("param_watcher") {
sources = [
"//base/startup/init_lite/services/utils/list.c",
"watcher/proxy/watcher_manager.cpp",
"watcher/proxy/watcher_manager_stub.cpp",
"watcher/proxy/watcher_proxy.cpp",
]
include_dirs = [
"include",
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/services/param/watcher/proxy",
"//base/startup/init_lite/services/param/watcher/include",
"//base/startup/init_lite/services/include",
"//base/startup/init_lite/services/log",
"//third_party/libuv/include",
"//third_party/cJSON",
"//utils/native/base/include",
"//utils/system/safwk/native/include",
"//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include",
"//foundation/distributedschedule/safwk/services/safwk/include",
"//foundation/distributedschedule/safwk/interfaces/innerkits/safwk",
"//foundation/distributedschedule/samgr/adapter/interfaces/innerkits/include",
"//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include",
]
defines = [
"INIT_AGENT",
"ENABLE_HILOG",
]
deps = [
"//base/startup/init_lite/services/log:agent_log",
"//base/startup/init_lite/services/param:param_client",
"//third_party/bounds_checking_function:libsec_static",
"//utils/native/base:utils",
]
external_deps = [
"hiviewdfx_hilog_native:libhilog",
"ipc:ipc_core",
"safwk:system_ability_fwk",
"samgr_standard:samgr_proxy",
]
install_images = [ "system" ]
part_name = "init"
}
# 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")
ohos_prebuilt_etc("param_watcher.rc") {
if (use_musl) {
source = "etc/param_watcher.cfg"
} else {
source = "etc/param_watcher.rc"
}
relative_install_dir = "init"
part_name = "init"
}
ohos_shared_library("param_watcheragent") {
sources = [
"agent/watcher.cpp",
"agent/watcher_manager_kits.cpp",
"agent/watcher_manager_proxy.cpp",
"agent/watcher_stub.cpp",
]
include_dirs = [
"//base/startup/init_lite/services/param/include",
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/services/param/watcher/include",
"//base/startup/init_lite/services/param/watcher/agent",
"//base/startup/init_lite/services/include",
"//base/startup/init_lite/services/log",
"//base/update/updateservice/interfaces/innerkits/include",
]
defines = [ "INIT_AGENT" ]
deps = [
"//base/startup/init_lite/services/log:agent_log",
"//base/startup/init_lite/services/param:param_client",
"//third_party/bounds_checking_function:libsec_static",
"//utils/native/base:utils",
]
external_deps = [
"hiviewdfx_hilog_native:libhilog",
"ipc:ipc_core",
"safwk:system_ability_fwk",
"samgr_standard:samgr_proxy",
]
part_name = "init"
}
ohos_shared_library("param_watcher") {
sources = [
"//base/startup/init_lite/services/utils/list.c",
"proxy/watcher_manager.cpp",
"proxy/watcher_manager_stub.cpp",
"proxy/watcher_proxy.cpp",
]
include_dirs = [
"//base/startup/init_lite/services/param/include",
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/services/param/watcher/proxy",
"//base/startup/init_lite/services/param/watcher/include",
"//base/startup/init_lite/services/include",
"//base/startup/init_lite/services/log",
"//third_party/libuv/include",
"//third_party/cJSON",
"//utils/native/base/include",
"//utils/system/safwk/native/include",
"//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include",
"//foundation/distributedschedule/safwk/services/safwk/include",
"//foundation/distributedschedule/safwk/interfaces/innerkits/safwk",
"//foundation/distributedschedule/samgr/adapter/interfaces/innerkits/include",
"//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include",
]
defines = [
"INIT_AGENT",
"ENABLE_HILOG",
]
deps = [
"//base/startup/init_lite/services/log:agent_log",
"//base/startup/init_lite/services/param:param_client",
"//third_party/bounds_checking_function:libsec_static",
"//utils/native/base:utils",
]
external_deps = [
"hiviewdfx_hilog_native:libhilog",
"ipc:ipc_core",
"safwk:system_ability_fwk",
"samgr_standard:samgr_proxy",
]
install_images = [ "system" ]
part_name = "init"
}
......@@ -422,7 +422,7 @@ ohos_fuzztest("SystemWatchParameterFuzzTest") {
deps = [
"//base/startup/init_lite/services/log:agent_log",
"//base/startup/init_lite/services/param:param_client",
"//base/startup/init_lite/services/param:param_watcheragent",
"//base/startup/init_lite/services/param/watcher:param_watcheragent",
"//third_party/bounds_checking_function:libsec_static",
"//utils/native/base:utils",
]
......
......@@ -10,6 +10,7 @@
# 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("//base/startup/init_lite/begetd.gni")
import("//build/test.gni")
config("utest_config") {
......@@ -71,13 +72,6 @@ ohos_unittest("init_ut") {
"//base/startup/init_lite/services/param/trigger/trigger_checker.c",
"//base/startup/init_lite/services/param/trigger/trigger_manager.c",
"//base/startup/init_lite/services/param/trigger/trigger_processor.c",
"//base/startup/init_lite/services/param/watcher/agent/watcher.cpp",
"//base/startup/init_lite/services/param/watcher/agent/watcher_manager_kits.cpp",
"//base/startup/init_lite/services/param/watcher/agent/watcher_manager_proxy.cpp",
"//base/startup/init_lite/services/param/watcher/agent/watcher_stub.cpp",
"//base/startup/init_lite/services/param/watcher/proxy/watcher_manager.cpp",
"//base/startup/init_lite/services/param/watcher/proxy/watcher_manager_stub.cpp",
"//base/startup/init_lite/services/param/watcher/proxy/watcher_proxy.cpp",
"//base/startup/init_lite/services/utils/init_utils.c",
"//base/startup/init_lite/services/utils/list.c",
"//base/startup/init_lite/ueventd/ueventd.c",
......@@ -87,6 +81,20 @@ ohos_unittest("init_ut") {
"//base/startup/init_lite/ueventd/ueventd_socket.c",
]
if (param_feature_watcher) {
sources += [
"//base/startup/init_lite/services/param/watcher/agent/watcher.cpp",
"//base/startup/init_lite/services/param/watcher/agent/watcher_manager_kits.cpp",
"//base/startup/init_lite/services/param/watcher/agent/watcher_manager_proxy.cpp",
"//base/startup/init_lite/services/param/watcher/agent/watcher_stub.cpp",
"//base/startup/init_lite/services/param/watcher/proxy/watcher_manager.cpp",
"//base/startup/init_lite/services/param/watcher/proxy/watcher_manager_stub.cpp",
"//base/startup/init_lite/services/param/watcher/proxy/watcher_proxy.cpp",
"param/watcher_agent_unittest.cpp",
"param/watcher_proxy_unittest.cpp",
]
}
sources += [
"init/cmds_unittest.cpp",
"init/init_reboot_unittest.cpp",
......@@ -100,8 +108,6 @@ ohos_unittest("init_ut") {
"param/param_unittest.cpp",
"param/selinux_unittest.cpp",
"param/trigger_unittest.cpp",
"param/watcher_agent_unittest.cpp",
"param/watcher_proxy_unittest.cpp",
"ueventd/ueventd_config_unittest.cpp",
]
......@@ -152,12 +158,15 @@ ohos_unittest("init_ut") {
"PARAM_SUPPORT_DAC",
]
external_deps = [
"hiviewdfx_hilog_native:libhilog",
"ipc:ipc_core",
"safwk:system_ability_fwk",
"samgr_standard:samgr_proxy",
]
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
if (param_feature_watcher) {
external_deps += [
"ipc:ipc_core",
"safwk:system_ability_fwk",
"samgr_standard:samgr_proxy",
]
}
cflags_cc = [ "-fexceptions" ]
}
......
......@@ -121,6 +121,7 @@ static void HandleUevent(const struct Uevent *uevent)
static void HandleUeventRequired(const struct Uevent *uevent, char **devices, int num)
{
const char *deviceName;
INIT_ERROR_CHECK(devices != NULL && num > 0, return, "Fault paramters");
if (uevent->action == ACTION_ADD) {
ChangeSysAttributePermissions(uevent->syspath);
......@@ -130,9 +131,16 @@ static void HandleUeventRequired(const struct Uevent *uevent, char **devices, in
if (type == SUBSYSTEM_BLOCK) {
for (int i = 0; i < num; i++) {
if (uevent->partitionName == NULL) {
break;
}
if (strstr(devices[i], uevent->partitionName) != NULL) {
INIT_LOGI("Match with %s for %s", devices[i], uevent->syspath);
deviceName = strstr(devices[i], "/dev/block");
if (deviceName != NULL) {
deviceName += sizeof("/dev/block") - 1;
if (strstr(uevent->syspath, deviceName) != NULL) {
HandleBlockDeviceEvent(uevent);
break;
}
}
} else if (strstr(devices[i], uevent->partitionName) != NULL) {
INIT_LOGI("Handle block device partitionName %s", uevent->partitionName);
HandleBlockDeviceEvent(uevent);
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册