2 # Copyright 1999-2012 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License, v2 or later
7 extra_started_commands="clear save deactivated"
8 command="/usr/bin/tpmd"
9 command_args="-o tss -g tss"
17 lsmod | grep -q "^tpmd_dev\b" \
18 || modprobe tpmd_dev &>/dev/null \
19 || eerror "Failed to load module tpmd_dev";
21 if [ ! -c /dev/tpm ] && [ ! -c /dev/tpm0 ] ; then
22 eerror "No TPM device found!"
29 ebegin "Starting tpm-emulator daemon with mode '$STARTUP_MODE' (tpmd)"
30 checkconfig || eend $?
31 checkpath -d -m 0775 -o tss /var/run/tpm
32 start-stop-daemon --start --exec "${command}" -- ${command_args} $STARTUP_MODE > /dev/null
37 ebegin "Stopping tpm-emulator daemon (tpmd)"
38 start-stop-daemon --stop --exec "${command}" -- ${command_args} > /dev/null
55 STARTUP_MODE='deactivated';