| # Copyright 2014 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| description "Chromium OS trunks daemon for TPM2.0" |
| author "chromium-os-dev@chromium.org" |
| |
| start on started boot-services and started dbus |
| stop on stopping boot-services and stopped chapsd |
| respawn |
| |
| # This enviroment variable may be modified in the ebuild file. |
| # The runtime TPM selection feature would be enabled if this variable is true. |
| env TPM_DYNAMIC=false |
| |
| pre-start script |
| if [ "${TPM_DYNAMIC}" = true ]; then |
| # Only start trunksd if TPM 2.0 device is active. |
| if [ "$(tpm_version_client)" -ne 2 ]; then |
| stop |
| exit 0 |
| fi |
| fi |
| end script |
| |
| expect fork |
| |
| exec trunksd |