All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Gaignard <benjamin.gaignard@linaro.org>
To: yocto@yoctoproject.org
Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Subject: [meta-security][PATCH] tpm2.0-tss: install resourcemgr service
Date: Thu, 23 Mar 2017 15:26:11 +0100	[thread overview]
Message-ID: <1490279171-25737-1-git-send-email-benjamin.gaignard@linaro.org> (raw)

Install systemd resource.mgr service and it needed user/group.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
---
 .../tpm2.0-tss/change-resourcemgr-location.patch   | 23 ++++++++++++++++++++++
 recipes-tpm/tpm2.0-tss/tpm2.0-tss_git.bb           | 22 ++++++++++++++++++---
 2 files changed, 42 insertions(+), 3 deletions(-)
 create mode 100644 recipes-tpm/tpm2.0-tss/tpm2.0-tss/change-resourcemgr-location.patch

diff --git a/recipes-tpm/tpm2.0-tss/tpm2.0-tss/change-resourcemgr-location.patch b/recipes-tpm/tpm2.0-tss/tpm2.0-tss/change-resourcemgr-location.patch
new file mode 100644
index 0000000..ba3775a
--- /dev/null
+++ b/recipes-tpm/tpm2.0-tss/tpm2.0-tss/change-resourcemgr-location.patch
@@ -0,0 +1,23 @@
+resourcemgr: change resourcemgr location
+
+Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
+---
+ contrib/resourcemgr.service | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/contrib/resourcemgr.service b/contrib/resourcemgr.service
+index 7f23739..e5b0900 100644
+--- a/contrib/resourcemgr.service
++++ b/contrib/resourcemgr.service
+@@ -3,7 +3,7 @@ Description=TPM2 resource manager & access broker
+ Documentation=http://www.github.com/01org/TPM2.0-TSS
+ 
+ [Service]
+-ExecStart=/usr/local/sbin/resourcemgr
++ExecStart=/usr/sbin/resourcemgr
+ StandardOutput=null
+ User=tss
+ Group=tss
+-- 
+1.9.1
+
diff --git a/recipes-tpm/tpm2.0-tss/tpm2.0-tss_git.bb b/recipes-tpm/tpm2.0-tss/tpm2.0-tss_git.bb
index a03559c..96b3d72 100644
--- a/recipes-tpm/tpm2.0-tss/tpm2.0-tss_git.bb
+++ b/recipes-tpm/tpm2.0-tss/tpm2.0-tss_git.bb
@@ -8,9 +8,10 @@ SRCREV = "8e25d0cbb287d30c93b2b77e99bc761dc67e31a9"
 SRC_URI = " \
     git://github.com/01org/TPM2.0-TSS.git;protocol=git;branch=master;name=TPM2.0-TSS;destsuffix=TPM2.0-TSS \
     file://ax_pthread.m4 \
-    file://fix_musl_select_include.patch "
+    file://fix_musl_select_include.patch \
+    file://change-resourcemgr-location.patch "
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig systemd
 
 S = "${WORKDIR}/${@d.getVar('BPN',d).upper()}"
 
@@ -24,6 +25,21 @@ do_configure_prepend () {
 	cd $currentdir
 }
 
+INHERIT += "extrausers"
+EXTRA_USERS_PARAMS = "\
+	useradd -p '' tss; \
+	groupadd tss; \
+	"
+
+SYSTEMD_PACKAGES += "resourcemgr"
+SYSTEMD_SERVICE_resourcemgr = "resourcemgr.service"
+SYSTEMD_AUTO_ENABLE_resourcemgr = "enable"
+
+do_install_append() {
+    install -d ${D}${systemd_system_unitdir}
+    install -m0644 ${S}/contrib/resourcemgr.service ${D}${systemd_system_unitdir}/resourcemgr.service
+}
+
 PROVIDES = "${PACKAGES}"
 PACKAGES = " \
     ${PN}-dbg \
@@ -64,4 +80,4 @@ FILES_libtctisocket-dev = " \
     ${libdir}/pkgconfig/tcti-socket.pc \
 "
 FILES_libtctisocket-staticdev = "${libdir}/libtcti-socket.*a"
-FILES_resourcemgr = "${sbindir}/resourcemgr"
+FILES_resourcemgr = "${sbindir}/resourcemgr ${systemd_system_unitdir}/resourcemgr.service"
-- 
1.9.1



             reply	other threads:[~2017-03-23 14:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23 14:26 Benjamin Gaignard [this message]
2017-03-24  9:28 ` [meta-security][PATCH] tpm2.0-tss: install resourcemgr service Patrick Ohly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490279171-25737-1-git-send-email-benjamin.gaignard@linaro.org \
    --to=benjamin.gaignard@linaro.org \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.