summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLans Zhang <jia.zhang@windriver.com>2017-07-20 10:30:19 +0800
committerLans Zhang <jia.zhang@windriver.com>2017-07-20 10:30:19 +0800
commitdffeaacd06aa190ca99ff6c382cdcb1238376761 (patch)
treec126a0e0f9c137da4e5fad8391458b46f47e305b
parenta654b0702fad5989727eea5c9a8361b1481d0ce5 (diff)
downloadmeta-secure-core-dffeaacd06aa190ca99ff6c382cdcb1238376761.tar.gz
meta-tpm: code style fixup
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
-rw-r--r--meta-tpm/recipes-base/packagegroups/packagegroup-tpm.bb5
-rw-r--r--meta-tpm/recipes-kernel/linux/linux-yocto-rt_4.%.bbappend2
-rw-r--r--meta-tpm/recipes-kernel/linux/linux-yocto-tpm.inc2
-rw-r--r--meta-tpm/recipes-kernel/linux/linux-yocto/tpm.cfg13
-rw-r--r--meta-tpm/recipes-kernel/linux/linux-yocto/tpm.scc1
-rw-r--r--meta-tpm/recipes-kernel/linux/linux-yocto_4.%.bbappend2
-rw-r--r--meta-tpm/recipes-tpm/trousers/files/get-user-ps-path-use-POSIX-getpwent-instead-of-getpwe.patch49
7 files changed, 56 insertions, 18 deletions
diff --git a/meta-tpm/recipes-base/packagegroups/packagegroup-tpm.bb b/meta-tpm/recipes-base/packagegroups/packagegroup-tpm.bb
index 684a392..460320b 100644
--- a/meta-tpm/recipes-base/packagegroups/packagegroup-tpm.bb
+++ b/meta-tpm/recipes-base/packagegroups/packagegroup-tpm.bb
@@ -1,6 +1,9 @@
1DESCRIPTION = "Basic packagegroup for TCG TSS and utilities that use it." 1DESCRIPTION = "Basic packagegroup for TCG TSS and utilities that use it."
2LICENSE = "MIT" 2LICENSE = "MIT"
3PR = "r0" 3LIC_FILES_CHKSUM = "\
4 file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
5 file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420 \
6"
4 7
5inherit packagegroup 8inherit packagegroup
6 9
diff --git a/meta-tpm/recipes-kernel/linux/linux-yocto-rt_4.%.bbappend b/meta-tpm/recipes-kernel/linux/linux-yocto-rt_4.%.bbappend
index 8fbd7ba..32bfc50 100644
--- a/meta-tpm/recipes-kernel/linux/linux-yocto-rt_4.%.bbappend
+++ b/meta-tpm/recipes-kernel/linux/linux-yocto-rt_4.%.bbappend
@@ -1 +1 @@
include linux-yocto-tpm.inc require linux-yocto-tpm.inc
diff --git a/meta-tpm/recipes-kernel/linux/linux-yocto-tpm.inc b/meta-tpm/recipes-kernel/linux/linux-yocto-tpm.inc
index 276e154..4285531 100644
--- a/meta-tpm/recipes-kernel/linux/linux-yocto-tpm.inc
+++ b/meta-tpm/recipes-kernel/linux/linux-yocto-tpm.inc
@@ -1,6 +1,6 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/linux-yocto:" 1FILESEXTRAPATHS_prepend := "${THISDIR}/linux-yocto:"
2 2
3SRC_URI += " \ 3SRC_URI += "\
4 ${@bb.utils.contains('DISTRO_FEATURES', 'tpm', \ 4 ${@bb.utils.contains('DISTRO_FEATURES', 'tpm', \
5 'file://tpm.scc file://tpm.cfg', '', d)} \ 5 'file://tpm.scc file://tpm.cfg', '', d)} \
6" 6"
diff --git a/meta-tpm/recipes-kernel/linux/linux-yocto/tpm.cfg b/meta-tpm/recipes-kernel/linux/linux-yocto/tpm.cfg
index ac18405..0ab3b78 100644
--- a/meta-tpm/recipes-kernel/linux/linux-yocto/tpm.cfg
+++ b/meta-tpm/recipes-kernel/linux/linux-yocto/tpm.cfg
@@ -1,16 +1,3 @@
1..........................................................................
2. WARNING
3.
4. This file is a kernel configuration fragment, and not a full kernel
5. configuration file. The final kernel configuration is made up of
6. an assembly of processed fragments, each of which is designed to
7. capture a specific part of the final configuration (e.g. platform
8. configuration, feature configuration, and board specific hardware
9. configuration). For more information on kernel configuration, please
10. consult the product documentation.
11.
12..........................................................................
13
14CONFIG_TCG_TPM=y 1CONFIG_TCG_TPM=y
15CONFIG_TCG_TIS=y 2CONFIG_TCG_TIS=y
16CONFIG_TCG_ATMEL=y 3CONFIG_TCG_ATMEL=y
diff --git a/meta-tpm/recipes-kernel/linux/linux-yocto/tpm.scc b/meta-tpm/recipes-kernel/linux/linux-yocto/tpm.scc
index 90cfe56..046e8d6 100644
--- a/meta-tpm/recipes-kernel/linux/linux-yocto/tpm.scc
+++ b/meta-tpm/recipes-kernel/linux/linux-yocto/tpm.scc
@@ -1,4 +1,3 @@
1define KFEATURE_DESCRIPTION "TPM 1.x enablement" 1define KFEATURE_DESCRIPTION "TPM 1.x enablement"
2 2
3kconf hardware tpm.cfg 3kconf hardware tpm.cfg
4
diff --git a/meta-tpm/recipes-kernel/linux/linux-yocto_4.%.bbappend b/meta-tpm/recipes-kernel/linux/linux-yocto_4.%.bbappend
index 8fbd7ba..32bfc50 100644
--- a/meta-tpm/recipes-kernel/linux/linux-yocto_4.%.bbappend
+++ b/meta-tpm/recipes-kernel/linux/linux-yocto_4.%.bbappend
@@ -1 +1 @@
include linux-yocto-tpm.inc require linux-yocto-tpm.inc
diff --git a/meta-tpm/recipes-tpm/trousers/files/get-user-ps-path-use-POSIX-getpwent-instead-of-getpwe.patch b/meta-tpm/recipes-tpm/trousers/files/get-user-ps-path-use-POSIX-getpwent-instead-of-getpwe.patch
new file mode 100644
index 0000000..3f5a144
--- /dev/null
+++ b/meta-tpm/recipes-tpm/trousers/files/get-user-ps-path-use-POSIX-getpwent-instead-of-getpwe.patch
@@ -0,0 +1,49 @@
1trousers: fix compiling with musl
2
3use POSIX getpwent instead of getpwent_r
4
5Upstream-Status: Submitted
6
7Signed-off-by: Armin Kuster <akuster@mvista.com>
8
9Index: git/src/tspi/ps/tspps.c
10===================================================================
11--- git.orig/src/tspi/ps/tspps.c
12+++ git/src/tspi/ps/tspps.c
13@@ -66,9 +66,6 @@ get_user_ps_path(char **file)
14 TSS_RESULT result;
15 char *file_name = NULL, *home_dir = NULL;
16 struct passwd *pwp;
17-#if (defined (__linux) || defined (linux) || defined(__GLIBC__))
18- struct passwd pw;
19-#endif
20 struct stat stat_buf;
21 char buf[PASSWD_BUFSIZE];
22 uid_t euid;
23@@ -96,24 +93,15 @@ get_user_ps_path(char **file)
24 #else
25 setpwent();
26 while (1) {
27-#if (defined (__linux) || defined (linux) || defined(__GLIBC__))
28- rc = getpwent_r(&pw, buf, PASSWD_BUFSIZE, &pwp);
29- if (rc) {
30- LogDebugFn("USER PS: Error getting path to home directory: getpwent_r: %s",
31- strerror(rc));
32- endpwent();
33- return TSPERR(TSS_E_INTERNAL_ERROR);
34- }
35-
36-#elif (defined (__FreeBSD__) || defined (__OpenBSD__))
37 if ((pwp = getpwent()) == NULL) {
38 LogDebugFn("USER PS: Error getting path to home directory: getpwent: %s",
39 strerror(rc));
40 endpwent();
41+#if (defined (__FreeBSD__) || defined (__OpenBSD__))
42 MUTEX_UNLOCK(user_ps_path);
43+#endif
44 return TSPERR(TSS_E_INTERNAL_ERROR);
45 }
46-#endif
47 if (euid == pwp->pw_uid) {
48 home_dir = strdup(pwp->pw_dir);
49 break;