summaryrefslogtreecommitdiff
path: root/app-crypt/tpm-emulator/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-crypt/tpm-emulator/files
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'app-crypt/tpm-emulator/files')
-rw-r--r--app-crypt/tpm-emulator/files/tpm-emulator.confd-0.7.42
-rw-r--r--app-crypt/tpm-emulator/files/tpm-emulator.initd-0.7.459
2 files changed, 61 insertions, 0 deletions
diff --git a/app-crypt/tpm-emulator/files/tpm-emulator.confd-0.7.4 b/app-crypt/tpm-emulator/files/tpm-emulator.confd-0.7.4
new file mode 100644
index 000000000000..da24e57840b9
--- /dev/null
+++ b/app-crypt/tpm-emulator/files/tpm-emulator.confd-0.7.4
@@ -0,0 +1,2 @@
+STARTUP_MODE="save"
+#DEBUG="true"
diff --git a/app-crypt/tpm-emulator/files/tpm-emulator.initd-0.7.4 b/app-crypt/tpm-emulator/files/tpm-emulator.initd-0.7.4
new file mode 100644
index 000000000000..8d5b9be561b1
--- /dev/null
+++ b/app-crypt/tpm-emulator/files/tpm-emulator.initd-0.7.4
@@ -0,0 +1,59 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+STARTUP_MODE='save';
+
+extra_started_commands="clear save deactivated"
+command="/usr/bin/tpmd"
+command_args="-o tss -g tss"
+
+depend() {
+ use logger
+ after coldplug
+}
+
+checkconfig() {
+ lsmod | grep -q "^tpmd_dev\b" \
+ || modprobe tpmd_dev &>/dev/null \
+ || eerror "Failed to load module tpmd_dev";
+
+ if [ ! -c /dev/tpm ] && [ ! -c /dev/tpm0 ] ; then
+ eerror "No TPM device found!"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ ebegin "Starting tpm-emulator daemon with mode '$STARTUP_MODE' (tpmd)"
+ checkconfig || eend $?
+ checkpath -d -m 0775 -o tss /var/run/tpm
+ start-stop-daemon --start --exec "${command}" -- ${command_args} $STARTUP_MODE > /dev/null
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping tpm-emulator daemon (tpmd)"
+ start-stop-daemon --stop --exec "${command}" -- ${command_args} > /dev/null
+ eend $?
+}
+
+clear() {
+ STARTUP_MODE='clear';
+ stop
+ start
+}
+
+save() {
+ STARTUP_MODE='save';
+ stop
+ start
+}
+
+deactivated() {
+ STARTUP_MODE='deactivated';
+ stop
+ start
+}
+