blob: 4614088605cad4308e593b76b86aa05fe07650cd [file] [log] [blame]
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CROS_WORKON_INCREMENTAL_BUILD=1
CROS_WORKON_LOCALNAME="platform2"
CROS_WORKON_PROJECT="chromiumos/platform2"
CROS_WORKON_OUTOFTREE_BUILD=1
CROS_WORKON_SUBTREE="common-mk chromeos-config runtime_probe .gn"
PLATFORM_SUBDIR="runtime_probe"
inherit cros-workon platform user udev
DESCRIPTION="Runtime probing on device componenets."
HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/master/runtime_probe/"
LICENSE="BSD-Google"
KEYWORDS="~*"
IUSE="generated_cros_config unibuild asan fuzzer"
COMMON_DEPEND="
unibuild? (
!generated_cros_config? ( chromeos-base/chromeos-config:= )
generated_cros_config? ( chromeos-base/chromeos-config-bsp:= )
)
chromeos-base/chromeos-config-tools:=
"
RDEPEND="${COMMON_DEPEND}"
# Add vboot_reference as build time dependency to read cros_debug status
DEPEND="${COMMON_DEPEND}
chromeos-base/shill-client:=
chromeos-base/system_api:=[fuzzer?]
chromeos-base/vboot_reference:=
"
pkg_preinst() {
# Create user and group for runtime_probe
enewuser "runtime_probe"
enewgroup "cros_ec-access"
enewgroup "runtime_probe"
}
src_install() {
dobin "${OUT}/runtime_probe"
dobin "${OUT}/runtime_probe_helper"
# Install upstart configs and scripts.
insinto /etc/init
doins init/*.conf
# Install D-Bus configuration file.
insinto /etc/dbus-1/system.d
doins dbus/org.chromium.RuntimeProbe.conf
# Install D-Bus service activation configuration.
insinto /usr/share/dbus-1/system-services
doins dbus/org.chromium.RuntimeProbe.service
# Install sandbox information.
insinto /etc/runtime_probe/sandbox
doins sandbox/*.args
doins sandbox/"${ARCH}"/*-seccomp.policy
# Install seccomp policy file.
insinto /usr/share/policy
newins "seccomp/runtime_probe-seccomp-${ARCH}.policy" \
runtime_probe-seccomp.policy
# Install udev rules.
udev_dorules udev/*.rules
local fuzzer
for fuzzer in "${OUT}"/*_fuzzer; do
platform_fuzzer_install "${S}"/OWNERS "${fuzzer}"
done
}
platform_pkg_test() {
platform_test "run" "${OUT}/unittest_runner"
}