diff options
author | Lans Zhang <jia.zhang@windriver.com> | 2017-07-20 10:28:20 +0800 |
---|---|---|
committer | Lans Zhang <jia.zhang@windriver.com> | 2017-07-20 10:28:20 +0800 |
commit | 3df0a11accb50bac611565754507b3f34e8b4ca8 (patch) | |
tree | 3c420ed0fd648e73650fba4bedd5ed6d54499c4a | |
parent | 42ac614eccbc9993856a31bb634a83858a0a5b69 (diff) | |
download | meta-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-x | meta-tpm/recipes-tpm/trousers/files/tcsd.conf | 1 | ||||
-rw-r--r-- | meta-tpm/recipes-tpm/trousers/files/tcsd.service | 6 | ||||
-rw-r--r-- | meta-tpm/recipes-tpm/trousers/trousers_0.3.14.bb | 114 | ||||
-rw-r--r-- | meta-tpm/recipes-tpm/trousers/trousers_git.bb | 116 |
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 @@ | |||
2 | Description=TrouSerS TCG Core Services daemon | 2 | Description=TrouSerS TCG Core Services daemon |
3 | After=syslog.target network.target | 3 | After=syslog.target network.target |
4 | ConditionPathExists=|/dev/tpm0 | 4 | ConditionPathExists=|/dev/tpm0 |
5 | ConditionPathExists=|/udev/tpm0 | ||
6 | ConditionPathExists=|/dev/tpm | 5 | ConditionPathExists=|/dev/tpm |
7 | ConditionPathExistsGlob=/sys/class/*/tpm0/@TPM_CAPS@ | ||
8 | 6 | ||
9 | [Service] | 7 | [Service] |
10 | Type=forking | 8 | Type=forking |
11 | ExecStartPre=/bin/sh -c "fgrep '@FAMILY_MAJOR@' /sys/class/*/tpm0/@TPM_CAPS@" | 9 | ExecStart=@SBINDIR@/tcsd |
12 | ExecStart=/usr/sbin/tcsd | ||
13 | |||
14 | TimeoutSec=30s | 10 | TimeoutSec=30s |
15 | Restart=on-failure | 11 | Restart=on-failure |
16 | RestartSec=4 | 12 | RestartSec=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 @@ | |||
1 | SUMMARY = "TrouSerS - An open-source TCG Software Stack implementation." | ||
2 | DESCRIPTION = " \ | ||
3 | Trousers is an open-source TCG Software Stack (TSS), released under the \ | ||
4 | Common Public License. Trousers aims to be compliant with the current (1.1b) \ | ||
5 | and upcoming (1.2) TSS specifications available from the Trusted Computing \ | ||
6 | Group website: http://www.trustedcomputinggroup.org. \ | ||
7 | " | ||
8 | HOMEPAGE = "https://sourceforge.net/projects/trousers" | ||
9 | SECTION = "security/tpm" | ||
10 | |||
11 | LICENSE = "BSD" | ||
12 | LIC_FILES_CHKSUM = "file://LICENSE;md5=8031b2ae48ededc9b982c08620573426" | ||
13 | |||
14 | SRC_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 | |||
27 | SRC_URI[md5sum] = "4a476b4f036dd20a764fb54fc24edbec" | ||
28 | SRC_URI[sha256sum] = "ce50713a261d14b735ec9ccd97609f0ad5ce69540af560e8c3ce9eb5f2d28f47" | ||
29 | |||
30 | S = "${WORKDIR}/${PN}-${PV}" | ||
31 | |||
32 | DEPENDS = "openssl" | ||
33 | |||
34 | inherit autotools pkgconfig useradd update-rc.d | ||
35 | inherit ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager', 'systemd', 'systemd', '', d)} | ||
36 | |||
37 | PACKAGECONFIG ?= "gmp " | ||
38 | PACKAGECONFIG[gmp] = "--with-gmp, --with-gmp=no, gmp" | ||
39 | PACKAGECONFIG[gtk] = "--with-gui=gtk, --with-gui=none, gtk+" | ||
40 | |||
41 | PROVIDES = "${PACKAGES}" | ||
42 | PACKAGES =+ " \ | ||
43 | libtspi \ | ||
44 | libtspi-dbg \ | ||
45 | libtspi-dev \ | ||
46 | libtspi-doc \ | ||
47 | libtspi-staticdev \ | ||
48 | " | ||
49 | |||
50 | FILES_libtspi = " \ | ||
51 | ${libdir}/libtspi.so.* \ | ||
52 | " | ||
53 | FILES_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 | " | ||
59 | FILES_libtspi-dev = " \ | ||
60 | ${includedir} \ | ||
61 | ${libdir}/*.so \ | ||
62 | ${libdir}/*.so.1 \ | ||
63 | " | ||
64 | FILES_libtspi-doc = " \ | ||
65 | ${mandir}/man3 \ | ||
66 | " | ||
67 | FILES_libtspi-staticdev = " \ | ||
68 | ${libdir}/*.la \ | ||
69 | ${libdir}/*.a \ | ||
70 | " | ||
71 | FILES_${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 | " | ||
78 | FILES_${PN}-dev += "${libdir}/trousers" | ||
79 | FILES_${PN} += "${systemd_unitdir}/system/tcsd.service" | ||
80 | CONFFILES_${PN} += "${sysconfig}/tcsd.conf" | ||
81 | |||
82 | INITSCRIPT_NAME = "trousers" | ||
83 | INITSCRIPT_PARAMS = "start 99 2 3 4 5 . stop 19 0 1 6 ." | ||
84 | |||
85 | USERADD_PACKAGES = "${PN}" | ||
86 | GROUPADD_PARAM_${PN} = "tss" | ||
87 | USERADD_PARAM_${PN} = "-M -d /var/lib/tpm -s /bin/false -g tss tss" | ||
88 | |||
89 | SYSTEMD_PACKAGES = "${PN}" | ||
90 | SYSTEMD_SERVICE_${PN} = "tcsd.service" | ||
91 | SYSTEMD_AUTO_ENABLE = "enable" | ||
92 | |||
93 | TPM_CAPS_x86 = 'device/caps' | ||
94 | FAMILY_MAJOR_x86 = 'TCG version: 1.2' | ||
95 | TPM_CAPS_x86-64 = 'device/caps' | ||
96 | FAMILY_MAJOR_x86-64 = 'TCG version: 1.2' | ||
97 | |||
98 | do_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 | |||
114 | BBCLASSEXTEND = "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 @@ | |||
1 | SUMMARY = "TrouSerS - An open-source TCG Software Stack implementation." | ||
2 | DESCRIPTION = "\ | ||
3 | Trousers is an open-source TCG Software Stack (TSS), released under the \ | ||
4 | Common Public License. Trousers aims to be compliant with the current (1.1b) \ | ||
5 | and upcoming (1.2) TSS specifications available from the Trusted Computing \ | ||
6 | Group website: http://www.trustedcomputinggroup.org. \ | ||
7 | " | ||
8 | HOMEPAGE = "https://sourceforge.net/projects/trousers" | ||
9 | SECTION = "security/tpm" | ||
10 | |||
11 | LICENSE = "BSD" | ||
12 | LIC_FILES_CHKSUM = "file://LICENSE;md5=8031b2ae48ededc9b982c08620573426" | ||
13 | |||
14 | DEPENDS = "openssl" | ||
15 | PROVIDES = "${PACKAGES}" | ||
16 | |||
17 | PV = "0.3.14+git${SRCPV}" | ||
18 | |||
19 | SRC_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 | " | ||
32 | SRCREV = "de57f069ef2297d6a6b3a0353e217a5a2f66e444" | ||
33 | |||
34 | S = "${WORKDIR}/git" | ||
35 | |||
36 | inherit autotools pkgconfig useradd update-rc.d \ | ||
37 | ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager', 'systemd', 'systemd', '', d)} | ||
38 | |||
39 | EXTRA_OECONF="--with-gui=none" | ||
40 | |||
41 | PACKAGECONFIG ?= "gmp " | ||
42 | PACKAGECONFIG[gmp] = "--with-gmp, --with-gmp=no, gmp" | ||
43 | PACKAGECONFIG[gtk] = "--with-gui=gtk, --with-gui=none, gtk+" | ||
44 | |||
45 | INITSCRIPT_NAME = "trousers" | ||
46 | INITSCRIPT_PARAMS = "start 99 2 3 4 5 . stop 19 0 1 6 ." | ||
47 | |||
48 | USERADD_PACKAGES = "${PN}" | ||
49 | GROUPADD_PARAM_${PN} = "--system tss" | ||
50 | USERADD_PARAM_${PN} = "--system -M -d /var/lib/tpm -s /bin/false -g tss tss" | ||
51 | |||
52 | SYSTEMD_PACKAGES = "${PN}" | ||
53 | SYSTEMD_SERVICE_${PN} = "tcsd.service" | ||
54 | SYSTEMD_AUTO_ENABLE = "enable" | ||
55 | |||
56 | do_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 | |||
74 | PACKAGES =+ "\ | ||
75 | libtspi \ | ||
76 | libtspi-dbg \ | ||
77 | libtspi-dev \ | ||
78 | libtspi-doc \ | ||
79 | libtspi-staticdev \ | ||
80 | " | ||
81 | |||
82 | FILES_libtspi = "\ | ||
83 | ${libdir}/libtspi.so.* \ | ||
84 | " | ||
85 | FILES_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 | " | ||
92 | FILES_libtspi-dev = "\ | ||
93 | ${includedir} \ | ||
94 | ${libdir}/*.so \ | ||
95 | " | ||
96 | FILES_libtspi-doc = "\ | ||
97 | ${mandir}/man3 \ | ||
98 | " | ||
99 | FILES_libtspi-staticdev = "\ | ||
100 | ${libdir}/*.la \ | ||
101 | ${libdir}/*.a \ | ||
102 | " | ||
103 | FILES_${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 | " | ||
111 | FILES_${PN}-dev += "${libdir}/trousers" | ||
112 | FILES_${PN} += "${systemd_unitdir}/system/tcsd.service" | ||
113 | |||
114 | CONFFILES_${PN} += "${sysconfig}/tcsd.conf" | ||
115 | |||
116 | BBCLASSEXTEND = "native" | ||