summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLans Zhang <jia.zhang@windriver.com>2017-07-20 10:28:20 +0800
committerLans Zhang <jia.zhang@windriver.com>2017-07-20 10:28:20 +0800
commit3df0a11accb50bac611565754507b3f34e8b4ca8 (patch)
tree3c420ed0fd648e73650fba4bedd5ed6d54499c4a
parent42ac614eccbc9993856a31bb634a83858a0a5b69 (diff)
downloadmeta-secure-core-3df0a11accb50bac611565754507b3f34e8b4ca8.tar.gz
trousers: update to the latest and code style fixup
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
-rwxr-xr-xmeta-tpm/recipes-tpm/trousers/files/tcsd.conf1
-rw-r--r--meta-tpm/recipes-tpm/trousers/files/tcsd.service6
-rw-r--r--meta-tpm/recipes-tpm/trousers/trousers_0.3.14.bb114
-rw-r--r--meta-tpm/recipes-tpm/trousers/trousers_git.bb116
4 files changed, 117 insertions, 120 deletions
diff --git a/meta-tpm/recipes-tpm/trousers/files/tcsd.conf b/meta-tpm/recipes-tpm/trousers/files/tcsd.conf
index 1adf7aa..731c85d 100755
--- a/meta-tpm/recipes-tpm/trousers/files/tcsd.conf
+++ b/meta-tpm/recipes-tpm/trousers/files/tcsd.conf
@@ -1,4 +1,3 @@
1
2# 1#
3# This is the configuration file for the trousers tcsd. (The Trusted Computing 2# This is the configuration file for the trousers tcsd. (The Trusted Computing
4# Software Stack Core Services Daemon). 3# Software Stack Core Services Daemon).
diff --git a/meta-tpm/recipes-tpm/trousers/files/tcsd.service b/meta-tpm/recipes-tpm/trousers/files/tcsd.service
index 59f573b..f245dad 100644
--- a/meta-tpm/recipes-tpm/trousers/files/tcsd.service
+++ b/meta-tpm/recipes-tpm/trousers/files/tcsd.service
@@ -2,15 +2,11 @@
2Description=TrouSerS TCG Core Services daemon 2Description=TrouSerS TCG Core Services daemon
3After=syslog.target network.target 3After=syslog.target network.target
4ConditionPathExists=|/dev/tpm0 4ConditionPathExists=|/dev/tpm0
5ConditionPathExists=|/udev/tpm0
6ConditionPathExists=|/dev/tpm 5ConditionPathExists=|/dev/tpm
7ConditionPathExistsGlob=/sys/class/*/tpm0/@TPM_CAPS@
8 6
9[Service] 7[Service]
10Type=forking 8Type=forking
11ExecStartPre=/bin/sh -c "fgrep '@FAMILY_MAJOR@' /sys/class/*/tpm0/@TPM_CAPS@" 9ExecStart=@SBINDIR@/tcsd
12ExecStart=/usr/sbin/tcsd
13
14TimeoutSec=30s 10TimeoutSec=30s
15Restart=on-failure 11Restart=on-failure
16RestartSec=4 12RestartSec=4
diff --git a/meta-tpm/recipes-tpm/trousers/trousers_0.3.14.bb b/meta-tpm/recipes-tpm/trousers/trousers_0.3.14.bb
deleted file mode 100644
index e12543f..0000000
--- a/meta-tpm/recipes-tpm/trousers/trousers_0.3.14.bb
+++ /dev/null
@@ -1,114 +0,0 @@
1SUMMARY = "TrouSerS - An open-source TCG Software Stack implementation."
2DESCRIPTION = " \
3Trousers is an open-source TCG Software Stack (TSS), released under the \
4Common Public License. Trousers aims to be compliant with the current (1.1b) \
5and upcoming (1.2) TSS specifications available from the Trusted Computing \
6Group website: http://www.trustedcomputinggroup.org. \
7"
8HOMEPAGE = "https://sourceforge.net/projects/trousers"
9SECTION = "security/tpm"
10
11LICENSE = "BSD"
12LIC_FILES_CHKSUM = "file://LICENSE;md5=8031b2ae48ededc9b982c08620573426"
13
14SRC_URI = " \
15 http://sourceforge.net/projects/trousers/files/trousers/0.3.14/trousers-0.3.14.tar.gz;subdir=${PN}-${PV} \
16 file://fix-deadlock-and-potential-hung.patch \
17 file://trousers.init.sh \
18 file://fix-event-log-parsing-problem.patch \
19 file://fix-incorrect-report-of-insufficient-buffer.patch \
20 file://trousers-conditional-compile-DES-related-code.patch \
21 file://Fix-segment-fault-if-client-hostname-cannot-be-retri.patch \
22 file://trousers-udev.rules \
23 file://tcsd.service \
24 file://tcsd.conf \
25 "
26
27SRC_URI[md5sum] = "4a476b4f036dd20a764fb54fc24edbec"
28SRC_URI[sha256sum] = "ce50713a261d14b735ec9ccd97609f0ad5ce69540af560e8c3ce9eb5f2d28f47"
29
30S = "${WORKDIR}/${PN}-${PV}"
31
32DEPENDS = "openssl"
33
34inherit autotools pkgconfig useradd update-rc.d
35inherit ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager', 'systemd', 'systemd', '', d)}
36
37PACKAGECONFIG ?= "gmp "
38PACKAGECONFIG[gmp] = "--with-gmp, --with-gmp=no, gmp"
39PACKAGECONFIG[gtk] = "--with-gui=gtk, --with-gui=none, gtk+"
40
41PROVIDES = "${PACKAGES}"
42PACKAGES =+ " \
43 libtspi \
44 libtspi-dbg \
45 libtspi-dev \
46 libtspi-doc \
47 libtspi-staticdev \
48 "
49
50FILES_libtspi = " \
51 ${libdir}/libtspi.so.* \
52 "
53FILES_libtspi-dbg = " \
54 ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/tspi \
55 ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/trspi \
56 ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/include/*.h \
57 ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/include/tss \
58 "
59FILES_libtspi-dev = " \
60 ${includedir} \
61 ${libdir}/*.so \
62 ${libdir}/*.so.1 \
63 "
64FILES_libtspi-doc = " \
65 ${mandir}/man3 \
66 "
67FILES_libtspi-staticdev = " \
68 ${libdir}/*.la \
69 ${libdir}/*.a \
70 "
71FILES_${PN}-dbg = " \
72 ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/tcs \
73 ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/tcsd \
74 ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/tddl \
75 ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/trousers \
76 ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/include/trousers \
77 "
78FILES_${PN}-dev += "${libdir}/trousers"
79FILES_${PN} += "${systemd_unitdir}/system/tcsd.service"
80CONFFILES_${PN} += "${sysconfig}/tcsd.conf"
81
82INITSCRIPT_NAME = "trousers"
83INITSCRIPT_PARAMS = "start 99 2 3 4 5 . stop 19 0 1 6 ."
84
85USERADD_PACKAGES = "${PN}"
86GROUPADD_PARAM_${PN} = "tss"
87USERADD_PARAM_${PN} = "-M -d /var/lib/tpm -s /bin/false -g tss tss"
88
89SYSTEMD_PACKAGES = "${PN}"
90SYSTEMD_SERVICE_${PN} = "tcsd.service"
91SYSTEMD_AUTO_ENABLE = "enable"
92
93TPM_CAPS_x86 = 'device/caps'
94FAMILY_MAJOR_x86 = 'TCG version: 1.2'
95TPM_CAPS_x86-64 = 'device/caps'
96FAMILY_MAJOR_x86-64 = 'TCG version: 1.2'
97
98do_install_append() {
99 install -d "${D}${sysconfdir}/init.d"
100 install -m 0600 "${WORKDIR}/tcsd.conf" "${D}${sysconfdir}"
101 chown tss:tss "${D}${sysconfdir}/tcsd.conf"
102 install -m 0755 "${WORKDIR}/trousers.init.sh" "${D}${sysconfdir}/init.d/trousers"
103
104 install -d "${D}${sysconfdir}/udev/rules.d"
105 install -m 0644 "${WORKDIR}/trousers-udev.rules" \
106 "${D}${sysconfdir}/udev/rules.d/45-trousers.rules"
107
108 install -d "${D}${systemd_unitdir}/system"
109 install -m 0644 "${WORKDIR}/tcsd.service" "${D}${systemd_unitdir}/system"
110 sed -i 's:@TPM_CAPS@:${TPM_CAPS}:' "${D}${systemd_unitdir}/system/tcsd.service"
111 sed -i 's/@FAMILY_MAJOR@/${FAMILY_MAJOR}/' "${D}${systemd_unitdir}/system/tcsd.service"
112}
113
114BBCLASSEXTEND = "native"
diff --git a/meta-tpm/recipes-tpm/trousers/trousers_git.bb b/meta-tpm/recipes-tpm/trousers/trousers_git.bb
new file mode 100644
index 0000000..1cacde2
--- /dev/null
+++ b/meta-tpm/recipes-tpm/trousers/trousers_git.bb
@@ -0,0 +1,116 @@
1SUMMARY = "TrouSerS - An open-source TCG Software Stack implementation."
2DESCRIPTION = "\
3Trousers is an open-source TCG Software Stack (TSS), released under the \
4Common Public License. Trousers aims to be compliant with the current (1.1b) \
5and upcoming (1.2) TSS specifications available from the Trusted Computing \
6Group website: http://www.trustedcomputinggroup.org. \
7"
8HOMEPAGE = "https://sourceforge.net/projects/trousers"
9SECTION = "security/tpm"
10
11LICENSE = "BSD"
12LIC_FILES_CHKSUM = "file://LICENSE;md5=8031b2ae48ededc9b982c08620573426"
13
14DEPENDS = "openssl"
15PROVIDES = "${PACKAGES}"
16
17PV = "0.3.14+git${SRCPV}"
18
19SRC_URI = "\
20 git://git.code.sf.net/p/trousers/trousers \
21 file://fix-deadlock-and-potential-hung.patch \
22 file://fix-event-log-parsing-problem.patch \
23 file://fix-incorrect-report-of-insufficient-buffer.patch \
24 file://trousers-conditional-compile-DES-related-code.patch \
25 file://Fix-segment-fault-if-client-hostname-cannot-be-retri.patch \
26 file://get-user-ps-path-use-POSIX-getpwent-instead-of-getpwe.patch \
27 file://trousers.init.sh \
28 file://trousers-udev.rules \
29 file://tcsd.service \
30 file://tcsd.conf \
31"
32SRCREV = "de57f069ef2297d6a6b3a0353e217a5a2f66e444"
33
34S = "${WORKDIR}/git"
35
36inherit autotools pkgconfig useradd update-rc.d \
37 ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager', 'systemd', 'systemd', '', d)}
38
39EXTRA_OECONF="--with-gui=none"
40
41PACKAGECONFIG ?= "gmp "
42PACKAGECONFIG[gmp] = "--with-gmp, --with-gmp=no, gmp"
43PACKAGECONFIG[gtk] = "--with-gui=gtk, --with-gui=none, gtk+"
44
45INITSCRIPT_NAME = "trousers"
46INITSCRIPT_PARAMS = "start 99 2 3 4 5 . stop 19 0 1 6 ."
47
48USERADD_PACKAGES = "${PN}"
49GROUPADD_PARAM_${PN} = "--system tss"
50USERADD_PARAM_${PN} = "--system -M -d /var/lib/tpm -s /bin/false -g tss tss"
51
52SYSTEMD_PACKAGES = "${PN}"
53SYSTEMD_SERVICE_${PN} = "tcsd.service"
54SYSTEMD_AUTO_ENABLE = "enable"
55
56do_install_append() {
57 install -d "${D}${sysconfdir}/init.d"
58 install -m 0755 "${WORKDIR}/trousers.init.sh" "${D}${sysconfdir}/init.d/trousers"
59
60 install -m 0600 "${WORKDIR}/tcsd.conf" "${D}${sysconfdir}"
61 chown tss:tss "${D}${sysconfdir}/tcsd.conf"
62
63 install -d "${D}${sysconfdir}/udev/rules.d"
64 install -m 0644 "${WORKDIR}/trousers-udev.rules" \
65 "${D}${sysconfdir}/udev/rules.d/45-trousers.rules"
66
67 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
68 install -d "${D}${systemd_unitdir}/system"
69 install -m 0644 "${WORKDIR}/tcsd.service" "${D}${systemd_unitdir}/system"
70 sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/tcsd.service
71 fi
72}
73
74PACKAGES =+ "\
75 libtspi \
76 libtspi-dbg \
77 libtspi-dev \
78 libtspi-doc \
79 libtspi-staticdev \
80"
81
82FILES_libtspi = "\
83 ${libdir}/libtspi.so.* \
84"
85FILES_libtspi-dbg = "\
86 ${libdir}/.debug \
87 ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/tspi \
88 ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/trspi \
89 ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/include/*.h \
90 ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/include/tss \
91"
92FILES_libtspi-dev = "\
93 ${includedir} \
94 ${libdir}/*.so \
95"
96FILES_libtspi-doc = "\
97 ${mandir}/man3 \
98"
99FILES_libtspi-staticdev = "\
100 ${libdir}/*.la \
101 ${libdir}/*.a \
102"
103FILES_${PN}-dbg = "\
104 ${sbindir}/.debug \
105 ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/tcs \
106 ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/tcsd \
107 ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/tddl \
108 ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/trousers \
109 ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/include/trousers \
110"
111FILES_${PN}-dev += "${libdir}/trousers"
112FILES_${PN} += "${systemd_unitdir}/system/tcsd.service"
113
114CONFFILES_${PN} += "${sysconfig}/tcsd.conf"
115
116BBCLASSEXTEND = "native"