| # 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="169a340562ec4d917d6df20b8df392f65f0645bb" |
| CROS_WORKON_TREE=("b1c6245dddc7b5e10da108b13f7c3883aa0b6c2c" "677b75140e4ae1b1d889f929c630579a8b13357e" "a3f5ba63eea058fad5fcab6671f690a35328329d" "8a424a75e11d7920d32c970717d3eff3e60db0ec" "7e189936f29d145c4191ea147e48256c92fac75d" "dae00c69637e0e94b3ccfca22c7ecb62d4f63675" "9fd99bf51279bfd5841cde5997f0379182410b03" "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="distributed_cryptohome test tpm tpm2" |
| |
| REQUIRED_USE="tpm2? ( !tpm )" |
| |
| RDEPEND=" |
| tpm? ( |
| app-crypt/trousers:= |
| ) |
| tpm2? ( |
| chromeos-base/trunks:= |
| ) |
| chromeos-base/chaps:= |
| chromeos-base/metrics:= |
| 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 |
| sed -i 's/started tcsd/started tpm_managerd/' \ |
| "${D}/etc/init/attestationd.conf" || |
| die "Can't replace tcsd with tpm_managerd in 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/client |
| doins client/dbus_proxy.h |
| 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 |
| } |