summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2017-10-08 09:58:50 -0700
committerArmin Kuster <akuster808@gmail.com>2017-10-10 07:24:59 -0700
commitef1e8d914462cfce093b84e9917250270be60569 (patch)
treef6d013ba941441df64c35cc17e523f06dec180ed
parentf6d48f60068292d672c227b8d4ae6d1f80a47957 (diff)
downloadmeta-security-ef1e8d914462cfce093b84e9917250270be60569.tar.gz
tpm2-abrmd: add package
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-tpm/recipes-tpm/tpm2-abrmd/files/tpm2-abrmd-init.sh65
-rw-r--r--meta-tpm/recipes-tpm/tpm2-abrmd/files/tpm2-abrmd.default1
-rw-r--r--meta-tpm/recipes-tpm/tpm2-abrmd/tpm2-abrmd_1.1.1.bb54
3 files changed, 120 insertions, 0 deletions
diff --git a/meta-tpm/recipes-tpm/tpm2-abrmd/files/tpm2-abrmd-init.sh b/meta-tpm/recipes-tpm/tpm2-abrmd/files/tpm2-abrmd-init.sh
new file mode 100644
index 0000000..c8dfb7d
--- /dev/null
+++ b/meta-tpm/recipes-tpm/tpm2-abrmd/files/tpm2-abrmd-init.sh
@@ -0,0 +1,65 @@
1#!/bin/sh
2
3### BEGIN INIT INFO
4# Provides: tpm2-abrmd
5# Required-Start: $local_fs $remote_fs $network
6# Required-Stop: $local_fs $remote_fs $network
7# Should-Start:
8# Should-Stop:
9# Default-Start: 2 3 4 5
10# Default-Stop: 0 1 6
11# Short-Description: starts tpm2-abrmd
12# Description: tpm2-abrmd implements the TCG resource manager
13### END INIT INFO
14
15PATH=/sbin:/bin:/usr/sbin:/usr/bin
16DAEMON=/usr/sbin/tpm2-abrmd
17NAME=tpm2-abrmd
18DESC="TCG TSS2 Access Broker and Resource Management daemon"
19USER="tss"
20
21test -x "${DAEMON}" || exit 0
22
23# Read configuration variable file if it is present
24[ -r /etc/default/$NAME ] && . /etc/default/$NAME
25
26case "${1}" in
27 start)
28 echo -n "Starting $DESC: "
29
30 if [ ! -e /dev/tpm* ]
31 then
32 echo "device driver not loaded, skipping."
33 exit 0
34 fi
35
36 start-stop-daemon --start --quiet --oknodo --background --pidfile /var/run/${NAME}.pid --user ${USER} --chuid ${USER} --exec ${DAEMON} -- ${DAEMON_OPTS}
37 RETVAL="$?"
38 echo "$NAME."
39 [ "$RETVAL" = 0 ] && pidof $DAEMON > /var/run/${NAME}.pid
40 exit $RETVAL
41 ;;
42
43 stop)
44 echo -n "Stopping $DESC: "
45
46 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/${NAME}.pid --user ${USER} --exec ${DAEMON}
47 RETVAL="$?"
48 echo "$NAME."
49 rm -f /var/run/${NAME}.pid
50 exit $RETVAL
51 ;;
52
53 restart|force-reload)
54 "${0}" stop
55 sleep 1
56 "${0}" start
57 exit $?
58 ;;
59 *)
60 echo "Usage: ${NAME} {start|stop|restart|force-reload|status}" >&2
61 exit 3
62 ;;
63esac
64
65exit 0
diff --git a/meta-tpm/recipes-tpm/tpm2-abrmd/files/tpm2-abrmd.default b/meta-tpm/recipes-tpm/tpm2-abrmd/files/tpm2-abrmd.default
new file mode 100644
index 0000000..987978a
--- /dev/null
+++ b/meta-tpm/recipes-tpm/tpm2-abrmd/files/tpm2-abrmd.default
@@ -0,0 +1 @@
DAEMON_OPTS="--tcti=device --logger=syslog --max-connections=20 --max-transient-objects=20 --fail-on-loaded-trans"
diff --git a/meta-tpm/recipes-tpm/tpm2-abrmd/tpm2-abrmd_1.1.1.bb b/meta-tpm/recipes-tpm/tpm2-abrmd/tpm2-abrmd_1.1.1.bb
new file mode 100644
index 0000000..27e2408
--- /dev/null
+++ b/meta-tpm/recipes-tpm/tpm2-abrmd/tpm2-abrmd_1.1.1.bb
@@ -0,0 +1,54 @@
1SUMMARY = "TPM2 Access Broker & Resource Manager"
2DESCRIPTION = "This is a system daemon implementing the TPM2 access \
3broker (TAB) & Resource Manager (RM) spec from the TCG. The daemon (tpm2-abrmd) \
4is implemented using Glib and the GObject system. In this documentation and \
5in the code we use `tpm2-abrmd` and `tabrmd` interchangeably. \
6"
7SECTION = "security/tpm"
8
9LICENSE = "BSD-2-Clause"
10LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=500b2e742befc3da00684d8a1d5fd9da"
11
12DEPENDS += "autoconf-archive dbus glib-2.0 pkgconfig tpm2.0-tss glib-2.0-native"
13
14SRC_URI = "\
15 git://github.com/01org/tpm2-abrmd.git \
16 file://tpm2-abrmd-init.sh \
17 file://tpm2-abrmd.default \
18"
19SRCREV = "c2ccda956bf15165770682dd5c578c58ee5fa6e2"
20
21S = "${WORKDIR}/git"
22
23inherit autotools pkgconfig systemd update-rc.d useradd
24
25SYSTEMD_PACKAGES += "${PN}"
26SYSTEMD_SERVICE_${PN} = "tpm2-abrmd.service"
27SYSTEMD_AUTO_ENABLE_${PN} = "disable"
28
29INITSCRIPT_NAME = "${PN}"
30INITSCRIPT_PARAMS = "start 99 2 3 4 5 . stop 19 0 1 6 ."
31
32USERADD_PACKAGES = "${PN}"
33GROUPADD_PARAM_${PN} = "tss"
34USERADD_PARAM_${PN} = "--system -M -d /var/lib/tpm -s /bin/false -g tss tss"
35
36PACKAGECONFIG ?="udev"
37PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd', '', d)}"
38
39PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir}, --with-systemdsystemunitdir=no"
40PACKAGECONFIG[udev] = "--with-udevrulesdir=${sysconfdir}/udev/rules.d, --without-udevrulesdir"
41
42do_install_append() {
43 install -d "${D}${sysconfdir}/init.d"
44 install -m 0755 "${WORKDIR}/tpm2-abrmd-init.sh" "${D}${sysconfdir}/init.d/tpm2-abrmd"
45
46 install -d "${D}${sysconfdir}/default"
47 install -m 0644 "${WORKDIR}/tpm2-abrmd.default" "${D}${sysconfdir}/default/tpm2-abrmd"
48}
49
50FILES_${PN} += "${libdir}/systemd/system-preset"
51
52RDEPENDS_${PN} += "libgcc dbus-glib libtss2 libtctidevice libtctisocket"
53
54BBCLASSEXTEND = "native"