blob: 71d41b2755c473358d004e21e0e2a712673d53fe [file] [log] [blame]
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//common-mk/generate-dbus-proxies.gni")
import("//common-mk/install_seccomp_policy.gni")
group("all") {
deps = [
":dbus-proxies",
":diagnostics_seccomp",
":install_dbus_config",
":install_init_config",
":install_tmpfiles_config",
"//diagnostics/cros_health_tool:cros-health-tool",
"//diagnostics/cros_healthd:cros_healthd",
"//diagnostics/cros_healthd/routines:floating-point-accuracy",
"//diagnostics/cros_healthd/routines:prime-search",
"//diagnostics/cros_healthd/routines:smartctl-check",
"//diagnostics/cros_healthd/routines:urandom",
"//diagnostics/wilco_dtc_supportd:wilco_dtc_supportd",
]
if (use.test) {
deps += [
"//diagnostics/cros_healthd:cros_healthd_test",
"//diagnostics/wilco_dtc_supportd:wilco_dtc_supportd_test",
]
}
if (use.fuzzer) {
deps += [ "//diagnostics/cros_healthd/fetchers:fetch_system_info_fuzzer" ]
}
}
group("dbus-proxies") {
deps = [
":bluetooth-proxies",
":cras-proxies",
":fwupd-proxies",
]
}
generate_dbus_proxies("bluetooth-proxies") {
dbus_service_config = "dbus_bindings/bluetooth/dbus-service-config.json"
proxy_output_file =
"include/diagnostics/dbus_bindings/bluetooth/dbus-proxies.h"
mock_output_file =
"include/diagnostics/dbus_bindings/bluetooth/dbus-proxy-mocks.h"
proxy_path_in_mocks = "diagnostics/dbus_bindings/bluetooth/dbus-proxies.h"
sources = [
"dbus_bindings/bluetooth/org.bluez.Adapter1.xml",
"dbus_bindings/bluetooth/org.bluez.Device1.xml",
]
}
generate_dbus_proxies("cras-proxies") {
sources =
[ "${sysroot}/usr/share/dbus-1/interfaces/org.chromium.cras.Control.xml" ]
proxy_output_file = "include/cras/dbus-proxies.h"
mock_output_file = "include/cras/dbus-proxy-mocks.h"
}
generate_dbus_proxies("fwupd-proxies") {
sources =
[ "${sysroot}/usr/share/dbus-1/interfaces/org.freedesktop.fwupd.xml" ]
proxy_output_file = "include/fwupd/dbus-proxies.h"
mock_output_file = "include/fwupd/dbus-proxy-mocks.h"
}
install_seccomp_policy("diagnostics_seccomp") {
_arch = getenv("ARCH")
sources = [
"cros_healthd/seccomp/${_arch}/ectool_i2cread-seccomp.policy",
"cros_healthd/seccomp/${_arch}/ectool_pwmgetfanrpm-seccomp.policy",
"cros_healthd/seccomp/${_arch}/iw-seccomp.policy",
"cros_healthd/seccomp/${_arch}/memtester-seccomp.policy",
"init/${_arch}/cros_healthd-seccomp.policy",
]
install_path = "/usr/share/policy"
if (use.wilco) {
sources += [
"init/${_arch}/wilco-dtc-e2fsck-seccomp.policy",
"init/${_arch}/wilco-dtc-resize2fs-seccomp.policy",
"init/${_arch}/wilco_dtc_supportd-seccomp.policy",
]
}
}
install_config("install_dbus_config") {
sources = [ "dbus/org.chromium.CrosHealthd.conf" ]
install_path = "/etc/dbus-1/system.d"
if (use.wilco) {
sources += [
"dbus/WilcoDtcUpstart.conf",
"dbus/org.chromium.WilcoDtcSupportd.conf",
]
}
}
install_config("install_init_config") {
sources = [ "init/cros_healthd.conf" ]
install_path = "/etc/init"
if (use.wilco) {
sources += [
"init/wilco_dtc.conf",
"init/wilco_dtc_dispatcher.conf",
"init/wilco_dtc_supportd.conf",
]
}
}
install_config("install_tmpfiles_config") {
sources = [ "init/tmpfiles.d/cros_healthd.conf" ]
install_path = "/usr/lib/tmpfiles.d/on-demand"
}