blob: 7b10ffc963ed77c9b5c24cdef9c2ddb8a105e6c5 [file] [log] [blame]
# Copyright 2022 The ChromiumOS Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CROS_WORKON_COMMIT="8b6e11a069e490c761cdab7ab3ff59434806cd9c"
CROS_WORKON_TREE=("41d899585b7a07ea908a0cca2944a7b8a4d13655" "102d4ec63eaf55397c3fc456d3b70e574692dc44" "0d9d2046eb78dc8620f7594f245298f9fd964832" "faa5b8036561b66b5b9d79ea1af8a95927a0ae0f" "989acbd33fd18024396e010b1be43d25cbdf942d" "f73f25bb045d099841b3ac929b6d3218060216df" "48055d0695b9f9dbfaf4545e2bfd0797d7ee30ed" "f91b6afd5f2ae04ee9a2c19109a3a4a36f7659e6")
CROS_WORKON_INCREMENTAL_BUILD=1
CROS_WORKON_LOCALNAME="platform2"
CROS_WORKON_PROJECT="chromiumos/platform2"
CROS_WORKON_OUTOFTREE_BUILD=1
CROS_WORKON_SUBTREE="common-mk attestation libhwsec-foundation metrics tpm_manager trunks vtpm .gn"
PLATFORM_SUBDIR="vtpm"
# Do not run test parallelly until unit tests are fixed.
# shellcheck disable=SC2034
PLATFORM_PARALLEL_GTEST_TEST="no"
inherit cros-workon libchrome platform user
DESCRIPTION="Virtual TPM service for Chromium OS"
HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/vtpm/"
LICENSE="BSD-Google"
KEYWORDS="*"
IUSE="profiling test"
RDEPEND="
chromeos-base/attestation:=[test?]
chromeos-base/libhwsec-foundation:=
chromeos-base/system_api:=
chromeos-base/tpm_manager-client:=
chromeos-base/trunks:=
dev-libs/protobuf:=
"
DEPEND="
${RDEPEND}
chromeos-base/attestation-client:=
chromeos-base/trunks:=[test?]
"
BDEPEND="
chromeos-base/chromeos-dbus-bindings
chromeos-base/minijail
dev-libs/protobuf
"
pkg_preinst() {
# Create user and group for vtpm.
enewuser "vtpm"
enewgroup "vtpm"
}
src_install() {
platform_src_install
# Allow specific syscalls for profiling.
# TODO (b/242806964): Need a better approach for fixing up the seccomp policy
# related issues (i.e. fix with a single function call)
if use profiling; then
echo -e "\n# Syscalls added for profiling case only.\nmkdir: 1\nftruncate: 1\n" >> \
"${D}/usr/share/policy/vtpmd-seccomp.policy"
fi
}
platform_pkg_test() {
platform test_all
}