| # Copyright 2014 The Chromium OS Authors. All rights reserved. |
| # Distributed under the terms of the GNU General Public License v2 |
| |
| EAPI=7 |
| |
| CROS_WORKON_COMMIT="1da1cad5d615cf74bc411e73d09db73d00413d33" |
| CROS_WORKON_TREE=("eaed4f3b0a8201ef3951bf1960728885ff99e772" "059f88b6d3865a95fe012b8d1aa21e8a67149105" "659397030465799734b81ba387579048df5e1cac" "22516c22296d08f9e9ad327c1a4452a6657dc6ea" "216a5d3a60a3b3093fb5ad72142a9bbdc12db2c7" "33d321722ad3cf484b13b1534371ca0d9a98dccd" "825bff5c29fdc54d4b79cf09b0b8008ba64303b4" "e7dba8c91c1f3257c34d4a7ffff0ea2537aeb6bb") |
| CROS_WORKON_INCREMENTAL_BUILD=1 |
| CROS_WORKON_LOCALNAME="platform2" |
| CROS_WORKON_PROJECT="chromiumos/platform2" |
| CROS_WORKON_OUTOFTREE_BUILD=1 |
| # TODO(crbug.com/809389): Avoid directly including headers from other packages. |
| CROS_WORKON_SUBTREE="common-mk attestation chaps libhwsec metrics tpm_manager trunks .gn" |
| |
| PLATFORM_SUBDIR="attestation" |
| |
| inherit cros-workon libchrome platform user |
| |
| DESCRIPTION="Attestation service for Chromium OS" |
| HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/master/attestation/" |
| |
| LICENSE="Apache-2.0" |
| KEYWORDS="*" |
| IUSE="test tpm tpm2" |
| |
| REQUIRED_USE="tpm2? ( !tpm )" |
| |
| RDEPEND=" |
| tpm? ( |
| app-crypt/trousers:= |
| ) |
| tpm2? ( |
| chromeos-base/trunks:= |
| ) |
| chromeos-base/chaps:= |
| chromeos-base/system_api:=[fuzzer?] |
| >=chromeos-base/metrics-0.0.1-r3152:= |
| chromeos-base/minijail:= |
| chromeos-base/tpm_manager:= |
| " |
| |
| DEPEND=" |
| ${RDEPEND} |
| test? ( chromeos-base/libhwsec:= ) |
| chromeos-base/vboot_reference:= |
| tpm2? ( |
| chromeos-base/trunks:=[test?] |
| chromeos-base/chromeos-ec-headers:= |
| ) |
| " |
| |
| pkg_preinst() { |
| # Create user and group for attestation. |
| enewuser "attestation" |
| enewgroup "attestation" |
| # Create group for /mnt/stateful_partition/unencrypted/preserve. |
| enewgroup "preserve" |
| } |
| |
| src_install() { |
| insinto /etc/dbus-1/system.d |
| doins server/org.chromium.Attestation.conf |
| |
| insinto /etc/init |
| doins server/attestationd.conf |
| |
| dosbin "${OUT}"/attestationd |
| dobin "${OUT}"/attestation_client |
| |
| insinto /usr/share/policy |
| newins server/attestationd-seccomp-${ARCH}.policy attestationd-seccomp.policy |
| |
| insinto /etc/dbus-1/system.d |
| doins pca_agent/server/org.chromium.PcaAgent.conf |
| insinto /etc/init |
| doins pca_agent/server/pca_agentd.conf |
| dosbin "${OUT}"/pca_agentd |
| dobin "${OUT}"/pca_agent_client |
| |
| dolib.so "${OUT}"/lib/libattestation.so |
| |
| insinto /usr/include/attestation/common |
| doins common/attestation_interface.h |
| doins common/print_attestation_ca_proto.h |
| doins common/print_interface_proto.h |
| doins common/print_keystore_proto.h |
| |
| # Install the generated dbus-binding for fake pca agent. |
| # It does no harm to install the header even for non-test image build. |
| insinto /usr/include/attestation/pca-agent/dbus_adaptors |
| doins "${OUT}"/gen/include/attestation/pca-agent/dbus_adaptors/org.chromium.PcaAgent.h |
| |
| insinto /usr/share/policy |
| newins "pca_agent/server/pca_agentd-seccomp-${ARCH}.policy" pca_agentd-seccomp.policy |
| } |
| |
| platform_pkg_test() { |
| local tests=( |
| attestation_testrunner |
| ) |
| |
| local test_bin |
| for test_bin in "${tests[@]}"; do |
| platform_test "run" "${OUT}/${test_bin}" |
| done |
| } |