blob: 7757699f667fa57753f7df99b557f041b39933b2 [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_COMMIT="fbc48d2b52e5ccb300e861761d675d48dc7a36e8"
CROS_WORKON_TREE=("b1c6245dddc7b5e10da108b13f7c3883aa0b6c2c" "957cd340def64e10a69a5c56285e40df001dad6a" "26765d77125b3857917f67977eb945600ff7670e" "e7dba8c91c1f3257c34d4a7ffff0ea2537aeb6bb")
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"
}